You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/08/17 20:16:47 UTC

[GitHub] [trafficcontrol] rob05c opened a new issue #4969: Fix traffic_ops/client changed symbols

rob05c opened a new issue #4969:
URL: https://github.com/apache/trafficcontrol/issues/4969


   Recently, a `http.Header` was added to the TO client funcs. This is necessary to let clients pass IMS/IUS/etc headers. But we need to add new functions, to avoid breaking existing clients.
   
   So, for example, `traffic_ops/client/cdn.go` was changed from
   ```
   func (to *Session) GetCDNs() ([]tc.CDN, ReqInf, error)
   ```
   To
   ```
   func (to *Session) GetCDNs(header http.Header) ([]tc.CDN, ReqInf, error)
   ```
   
   This breaks any clients using it. It needs to follow the standard deprecated-for-one-major-version procedure. It should be changed to:
   
   ```
   // GetCDNs is Deprecated in and will be removed in Traffic Control 6.0.
   func (to *Session) GetCDNs() ([]tc.CDN, ReqInf, error) {
     return to.GetCDNsWithHdr(nil)
   }
   func (to *Session) GetCDNsWithHdr(header http.Header) ([]tc.CDN, ReqInf, error) { 
   ```
   
   I'm not particular about the name, as long as the existing symbol is preserved to not break users. In fact, if could be `func (to *Session) CDNs(header http.Header) ([]tc.CDN, ReqInf, error)` if people preferred. (I think it used to be, before `GetCDNs` was added with `ReqInf`.)
   
   This needs done for all the changed function names in `traffic_ops/client`.
   
   Note this is concerning the Traffic Control library version, and not breaking users of libraries. It has nothing to do with the Traffic Ops API Version.
   
   ## I'm submitting a ...
   -  bug report
   
   ## Traffic Control components affected ...
   -  Traffic Control Client
   
   ## Current behavior:
   Existing function was removed, breaking clients.
   
   ## Expected / new behavior:
   Existing function continues to exist, pending deprecation-and-removal process.
   
   ## Minimal reproduction of the problem with instructions:
   Try to pull and update the client for an existing app using a changed function, observe build failure.
   
   ## Anything else:


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on issue #4969: Fix traffic_ops/client changed symbols

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4969:
URL: https://github.com/apache/trafficcontrol/issues/4969#issuecomment-675589519


   no need for 2 bug labels :)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c closed issue #4969: Fix traffic_ops/client changed symbols

Posted by GitBox <gi...@apache.org>.
rob05c closed issue #4969:
URL: https://github.com/apache/trafficcontrol/issues/4969


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org