Skip to content

Add Traffic Ops Golang Steering Targets #2803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2018

Conversation

rob05c
Copy link
Member

@rob05c rob05c commented Sep 11, 2018

What does this PR do?

Add Traffic Ops Golang Steering Targets

Which TC components are affected by this PR?

  • Documentation
  • Grove
  • Traffic Analytics
  • Traffic Monitor
  • Traffic Ops
  • Traffic Ops ORT
  • Traffic Portal
  • Traffic Router
  • Traffic Stats
  • Traffic Vault
  • Other _________

What is the best way to verify this PR?

go test, /api/1.2/steering/dsid/targets

Check all that apply

  • This PR includes tests
  • This PR includes documentation updates
  • This PR includes an update to CHANGELOG.md
  • This PR includes all required license headers
  • This PR includes a database migration (ensure that migration sequence is correct)
  • This PR fixes a serious security flaw. Read more: www.apache.org/security

@rob05c rob05c added new feature A new feature, capability or behavior Traffic Ops API (golang) labels Sep 11, 2018
@asfgit
Copy link
Contributor

asfgit commented Sep 11, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2412/
Test FAILed.

@rob05c rob05c force-pushed the to-go-steering-targets branch from dee4d61 to 72c3449 Compare September 11, 2018 15:40
@asfgit
Copy link
Contributor

asfgit commented Sep 11, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2413/
Test FAILed.

@rob05c rob05c force-pushed the to-go-steering-targets branch from 72c3449 to 822cf3d Compare September 11, 2018 19:27
@asfgit
Copy link
Contributor

asfgit commented Sep 11, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2414/
Test PASSed.

@rob05c rob05c force-pushed the to-go-steering-targets branch from 822cf3d to 4ccceea Compare September 12, 2018 16:52
@asfgit
Copy link
Contributor

asfgit commented Sep 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2419/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Sep 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2421/
Test FAILed.

@rob05c
Copy link
Member Author

rob05c commented Sep 12, 2018

retest this please

@asfgit
Copy link
Contributor

asfgit commented Sep 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2427/
Test PASSed.

@@ -47,9 +47,6 @@ type SteeringTargetNullable struct {

func (st SteeringTargetNullable) Validate(tx *sql.Tx) error {
errs := []string{}
if st.TargetID == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we putting validation rules on the struct instead of in the controller? Seems like our Business Rules will be scattered otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the validation applies to the object. Not sure what you mean by "controller". If you mean the "CRUDer" objects, only a small percentage of our endpoints are "CRUD", by making all Validate funcs members of the real objects, we prevent them being scattered, and can keep them all in one place.

Putting it in lib/tc also makes the validation accessible to external libraries, if it's useful to someone to do their own validation.

@dewrich dewrich merged commit eca0a7e into apache:master Sep 14, 2018
@rob05c rob05c deleted the to-go-steering-targets branch January 2, 2019 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature, capability or behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants