Add asn field to server#7023
Conversation
ocket8888
left a comment
There was a problem hiding this comment.
We have a build failure/warning in the docs on master (it's recoverable which is why the action reports a success), so I'm tryna put some extra effort into checking out the docs of things that I otherwise don't look at to prevent stuff like that from slipping through again. I don't intend to review the rest of the code.
There was a problem hiding this comment.
Code LGTM. Verified that one can see asn field only in 4.1 /servers API (GET) route and all other REST API calls for /servers work fine. asn used as query param in 4.1 GET servers also gives the correct response.
The asn column is now seen in TP as a list if a cachegroup has more than one asn assigned to it.
Unit tests and Integration tests (v3/v4) pass successfully on local.
ocket8888
left a comment
There was a problem hiding this comment.
The ServerV4 type alias in lib/go-tc/servers.go still says that the latest version of a server is ServerV40. This means that other API endpoints that show servers - e.g. /deliveryservices/{{ID}}/servers/eligible etc. - all now have different representations of a server than /servers. This is, in my opinion, bad. An API object should have exactly one representation.
I've updated the |
|
IDK why the |
fb521f2 to
9e85768
Compare
That's because #6960 was erroneously merged with a go fmt failure. |
|
A fix is now open #7038 |
This will be addressed in a follow up PR. |
47ede74 to
21e1d71
Compare
ocket8888
left a comment
There was a problem hiding this comment.
Docs look good now, and all actions pass
* Adding ASN to Server struct * doc changes * fix typo * add godoc * address code review comments * address code review changes * address code review comments * remove extra doc line

This PR is not related to any issue. It adds the
ASNfield to the server struct, so that users can useasnas a query param toGETservers.Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Run TO and TP locally.
Hit the
4.1 GET /serversroute and make sure that theasnsfield shows up in the response.Hit the same endpoint and add
asn=<>as a query param.Make sure you see the correct servers in the response.
Make sure the other routes DO NOT return this new field.
Make sure all other CRUD routes for servers work fine.
Test TP to verify that you can show/ hide the new field in servers.
If this is a bugfix, which Traffic Control versions contained the bug?
PR submission checklist