Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Flexible Topologies in Traffic Ops and Traffic Portal#4633

Merged
rawlinp merged 113 commits intoapache:masterfrom
zrhoffman:topologies
May 13, 2020
Merged

Flexible Topologies in Traffic Ops and Traffic Portal#4633
rawlinp merged 113 commits intoapache:masterfrom
zrhoffman:topologies

Conversation

@zrhoffman
Copy link
Copy Markdown
Member

@zrhoffman zrhoffman commented Apr 13, 2020

What does this PR (Pull Request) do?

This PR

Which Traffic Control components are affected by this PR?

  • Documentation
  • Traffic Control Clients: Go, Python
  • Traffic Ops
  • Traffic Portal

What is the best way to verify this PR?

  • Run Traffic Ops API tests
  • Run Traffic Portal tests
  • Build docs

You can also navigate in TP to tp.domain.com/#!/topologies and CRUD topologies.

The following criteria are ALL met by this PR

@mitchell852 mitchell852 added WIP "Work-in-Progress" - do not merge! (use 'draft' pull requests from now on) Traffic Portal v1 related to Traffic Portal version 1 Traffic Ops related to Traffic Ops labels Apr 13, 2020
@ocket8888 ocket8888 added this to the Flexible Topologies milestone Apr 14, 2020
Comment thread traffic_ops/traffic_ops_golang/routing/routes.go Outdated
@zrhoffman zrhoffman changed the title WIP: Flexible Topologies in Traffic Ops and Traffic Portal Flexible Topologies in Traffic Ops and Traffic Portal Apr 15, 2020
@mitchell852 mitchell852 removed the WIP "Work-in-Progress" - do not merge! (use 'draft' pull requests from now on) label Apr 15, 2020
@zrhoffman
Copy link
Copy Markdown
Member Author

This PR is ready for review.

@mitchell852 mitchell852 added the new feature A new feature, capability or behavior label Apr 15, 2020
Comment thread traffic_ops/traffic_ops_golang/routing/routes.go Outdated
Comment thread traffic_ops/app/db/migrations/20200402133144_create_topology_tables.sql Outdated
@zrhoffman
Copy link
Copy Markdown
Member Author

Rebased onto master

Comment thread docs/source/api/v2/topologies.rst Outdated
Comment thread docs/source/api/v2/topologies.rst Outdated
Comment thread docs/source/api/v2/topologies.rst Outdated
Comment thread docs/source/api/v2/topologies.rst Outdated
Comment thread docs/source/api/v2/topologies.rst Outdated
Comment thread traffic_portal/app/src/common/service/utils/TopologyUtils.js Outdated
Copy link
Copy Markdown
Contributor

@rawlinp rawlinp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got most of the way through reviewing this, except for the real meat of the API implementation and validation. I'll hopefully finish up the rest early next week.

Comment thread docs/source/api/v3/topologies.rst Outdated
Comment thread docs/source/api/v3/topologies.rst Outdated
Comment thread docs/source/api/v3/topologies.rst Outdated
Comment thread docs/source/api/v3/topologies.rst Outdated
Comment thread lib/go-tc/cachegroups.go Outdated
Comment thread traffic_ops/testing/api/v3/topologies_test.go
Comment thread traffic_ops/testing/api/v3/topologies_test.go Outdated
Comment thread traffic_ops/testing/api/v3/topologies_test.go Outdated
Comment thread traffic_ops/traffic_ops_golang/routing/routes.go Outdated
Comment thread traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go Outdated
Copy link
Copy Markdown
Contributor

@rawlinp rawlinp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I got through the rest of the TO changes. We need to be adamant about defer rows.Close() whenever we run a DB query -- otherwise, we may end up depleting all of the available DB connections over time if we're not careful.

Comment thread traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
Comment thread traffic_ops/traffic_ops_golang/topology/topologies.go Outdated
Comment thread traffic_ops/traffic_ops_golang/topology/topologies.go Outdated
Comment thread traffic_ops/traffic_ops_golang/topology/topologies.go Outdated
Comment thread traffic_ops/traffic_ops_golang/topology/topologies.go
return interfaces, nil, nil, http.StatusOK
}

func (topology *TOTopology) removeParents() error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brutal

return nil, nil, http.StatusOK
}

func (topology *TOTopology) addParents() (error, error, int) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heartwarming :D

Comment thread traffic_ops/traffic_ops_golang/topology/topologies.go Outdated
@zrhoffman zrhoffman requested a review from rawlinp May 13, 2020 19:25
Copy link
Copy Markdown
Contributor

@rawlinp rawlinp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests, TO API tests, manual CRUD testing via TP, and DB up/down migration were all successful.

@rawlinp rawlinp merged commit 88f4f2a into apache:master May 13, 2020
@zrhoffman zrhoffman removed this from the Flexible Topologies milestone Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation related to documentation new feature A new feature, capability or behavior Traffic Ops related to Traffic Ops Traffic Portal v1 related to Traffic Portal version 1

Projects

None yet

4 participants