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 2021/06/30 14:56:48 UTC

[GitHub] [trafficcontrol] srijeet0406 opened a new pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

srijeet0406 opened a new pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986


   <!--
   ************ STOP!! ************
   If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
   -->
   ## What does this PR (Pull Request) do?
   <!-- Explain the changes you made here. If this fixes an Issue, identify it by
   replacing the text in the checkbox item with the Issue number e.g.
   
   - [x] This PR fixes #9001 OR is not related to any Issue
   
   ^ This will automatically close Issue number 9001 when the Pull Request is
   merged (The '#' is important).
   
   Be sure you check the box properly, see the "The following criteria are ALL
   met by this PR" section for details.
   -->
   
   - [x] This PR is not related to any Issue <!-- You can check for an issue here: https://github.com/apache/trafficcontrol/issues -->
   
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - Documentation
   - Traffic Ops
   - CI tests
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your Pull Request. If
   it includes tests (and most should), outline here the steps needed to run the
   tests. If not, lay out the manual testing procedure and please explain why
   tests are unnecessary for this Pull Request. -->
   Make sure all the unit/ API tests pass.
   Make sure that none of the api 4.0 operations related to delivery services or delivery service requests accepts or returns the `long description 1` and `long description 2` fields.
   Make sure the UI doesn't show those fields anymore.
   ## If this is a bug fix, what versions of Traffic Control are affected?
   <!-- If this PR fixes a bug, please list here all of the affected versions - to
   the best of your knowledge. It's also pretty helpful to include a commit hash
   of where 'master' is at the time this PR is opened (if it affects master),
   because what 'master' means will change over time. For example, if this PR
   fixes a bug that's present in master (at commit hash '1df853c8'), in v4.0.0,
   and in the current 4.0.1 Release candidate (e.g. RC1), then this list would
   look like:
   
   - master (1df853c8)
   - 4.0.0
   - 4.0.1 (RC1)
   
   If you don't know what other versions might have this bug, AND don't know how
   to find the commit hash of 'master', then feel free to leave this section
   blank (or, preferably, delete it entirely).
    -->
   - master
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [x] This PR includes tests 
   - [x] This PR includes documentation 
   - [x] This PR includes an update to CHANGELOG.md 
   - [x] This PR includes any and all required license headers
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-872423432


   The table still appears to work, but the long desc 2 and 3 fields are just empty since they were removed from the API response.
   
   For the follow-up PR, we should probably also rename the `Long Description 1` field label in the DS forms to just `Long Description` since it's the only one now.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 edited a comment on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-872292804


   @srijeet0406 - you need to remove these fields from the TP ds tables as well. i don't see that change in this PR.
   
   ![image](https://user-images.githubusercontent.com/251272/124140674-eab10380-da45-11eb-9527-a2886a98376a.png)
   
   otherwise, I'm guessing the ds tables are broken if those fields are not removed.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp merged pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp merged pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 edited a comment on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750


   @srijeet0406 sorry for the late comment. so what happens if i do a PUT /api/4.0/ds w/o long1 and long2? do those values get wiped from the db if they exist?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] srijeet0406 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882675512


   Yeah, no DB changes were made in this PR. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#discussion_r661777193



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -339,6 +339,13 @@ type DeliveryServiceRemovedFieldsV11 struct {
 	CacheURL *string `json:"cacheurl" db:"cacheurl"`
 }
 
+// RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V 4.x DS, and returns the resulting struct.
+func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4 {
+	ds.LongDesc1 = nil
+	ds.LongDesc2 = nil
+	return *ds
+}
+

Review comment:
       Oh, right. DS hoops. Carry on :+1: 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#discussion_r661680370



##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go
##########
@@ -352,67 +354,132 @@ func createV40(w http.ResponseWriter, r *http.Request, inf *api.APIInfo, dsV40 t
 	if errCode, userErr, sysErr := dbhelpers.CheckTopology(inf.Tx, ds); userErr != nil || sysErr != nil {
 		return nil, errCode, userErr, sysErr
 	}
-	resultRows, err := tx.Query(insertQuery(),
-		&ds.Active,
-		&ds.AnonymousBlockingEnabled,
-		&ds.CCRDNSTTL,
-		&ds.CDNID,
-		&ds.CheckPath,
-		&ds.ConsistentHashRegex,
-		&deepCachingType,
-		&ds.DisplayName,
-		&ds.DNSBypassCNAME,
-		&ds.DNSBypassIP,
-		&ds.DNSBypassIP6,
-		&ds.DNSBypassTTL,
-		&ds.DSCP,
-		&ds.EdgeHeaderRewrite,
-		&ds.GeoLimitRedirectURL,
-		&ds.GeoLimit,
-		&ds.GeoLimitCountries,
-		&ds.GeoProvider,
-		&ds.GlobalMaxMBPS,
-		&ds.GlobalMaxTPS,
-		&ds.FQPacingRate,
-		&ds.HTTPBypassFQDN,
-		&ds.InfoURL,
-		&ds.InitialDispersion,
-		&ds.IPV6RoutingEnabled,
-		&ds.LogsEnabled,
-		&ds.LongDesc,
-		&ds.LongDesc1,
-		&ds.LongDesc2,
-		&ds.MaxDNSAnswers,
-		&ds.MaxOriginConnections,
-		&ds.MidHeaderRewrite,
-		&ds.MissLat,
-		&ds.MissLong,
-		&ds.MultiSiteOrigin,
-		&ds.OriginShield,
-		&ds.ProfileID,
-		&ds.Protocol,
-		&ds.QStringIgnore,
-		&ds.RangeRequestHandling,
-		&ds.RegexRemap,
-		&ds.RegionalGeoBlocking,
-		&ds.RemapText,
-		&ds.RoutingName,
-		&ds.SigningAlgorithm,
-		&ds.SSLKeyVersion,
-		&ds.TenantID,
-		&ds.Topology,
-		&ds.TRRequestHeaders,
-		&ds.TRResponseHeaders,
-		&ds.TypeID,
-		&ds.XMLID,
-		&ds.EcsEnabled,
-		&ds.RangeSliceBlockSize,
-		&ds.FirstHeaderRewrite,
-		&ds.InnerHeaderRewrite,
-		&ds.LastHeaderRewrite,
-		&ds.ServiceCategory,
-		&ds.MaxRequestHeaderBytes,
-	)
+	if omitExtraLongDescFields {
+		if ds.LongDesc1 != nil || ds.LongDesc2 != nil {
+			return nil, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
##########
@@ -716,6 +740,18 @@ func putV40(w http.ResponseWriter, r *http.Request, inf *api.APIInfo) (result ds
 		dsr.Status,
 		inf.IntParams["id"],
 	}
+	if dsr.Original != nil {
+		if dsr.Original.LongDesc1 != nil || dsr.Original.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: docs/source/overview/delivery_services.rst
##########
@@ -460,34 +460,6 @@ Free text field that has no strictly defined purpose, but it is suggested that i
 	| longDesc | Traffic Control source code and :ref:`to-api` responses | unchanged (``string``, ``String`` etc.) |
 	+----------+---------------------------------------------------------+-----------------------------------------+
 
-.. _ds-longdesc2:

Review comment:
       the fields should also be removed in the v4 API docs (`grep` for longDesc1 and longDesc2)

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/request/assign.go
##########
@@ -223,6 +223,16 @@ func PutAssignment(w http.ResponseWriter, r *http.Request) {
 	}
 	var resp interface{}
 	if inf.Version.Major >= 4 {
+		if dsr.Requested.LongDesc1 != nil || dsr.Requested.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
##########
@@ -449,7 +458,18 @@ func createV4(w http.ResponseWriter, r *http.Request, inf *api.APIInfo) (result
 		api.HandleErr(w, r, tx, http.StatusBadRequest, userErr, nil)
 		return
 	}
-
+	if dsr.Original != nil {
+		if dsr.Original.LongDesc1 != nil || dsr.Original.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/safe.go
##########
@@ -65,11 +85,20 @@ func UpdateSafe(w http.ResponseWriter, r *http.Request) {
 		api.HandleErr(w, r, tx, http.StatusBadRequest, fmt.Errorf("decoding: %s", err), nil)
 		return
 	}
-	if ok, err := updateDSSafe(tx, dsID, dsr); err != nil {
+	if version.Major > 3 && version.Minor >= 0 {
+		if dsr.LongDesc1 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 field are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field name, i.e. `longDesc1` just to be clear. Also `are` -> `is`

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
##########
@@ -449,7 +458,18 @@ func createV4(w http.ResponseWriter, r *http.Request, inf *api.APIInfo) (result
 		api.HandleErr(w, r, tx, http.StatusBadRequest, userErr, nil)
 		return
 	}
-
+	if dsr.Original != nil {
+		if dsr.Original.LongDesc1 != nil || dsr.Original.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)
+			return
+		}
+	}
+	if dsr.Requested != nil {
+		if dsr.Requested.LongDesc1 != nil || dsr.Requested.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go
##########
@@ -1006,67 +1075,132 @@ func updateV40(w http.ResponseWriter, r *http.Request, inf *api.APIInfo, dsV40 *
 		}
 	}
 
-	resultRows, err := tx.Query(updateDSQuery(),
-		&ds.Active,
-		&ds.CCRDNSTTL,
-		&ds.CDNID,
-		&ds.CheckPath,
-		&deepCachingType,
-		&ds.DisplayName,
-		&ds.DNSBypassCNAME,
-		&ds.DNSBypassIP,
-		&ds.DNSBypassIP6,
-		&ds.DNSBypassTTL,
-		&ds.DSCP,
-		&ds.EdgeHeaderRewrite,
-		&ds.GeoLimitRedirectURL,
-		&ds.GeoLimit,
-		&ds.GeoLimitCountries,
-		&ds.GeoProvider,
-		&ds.GlobalMaxMBPS,
-		&ds.GlobalMaxTPS,
-		&ds.FQPacingRate,
-		&ds.HTTPBypassFQDN,
-		&ds.InfoURL,
-		&ds.InitialDispersion,
-		&ds.IPV6RoutingEnabled,
-		&ds.LogsEnabled,
-		&ds.LongDesc,
-		&ds.LongDesc1,
-		&ds.LongDesc2,
-		&ds.MaxDNSAnswers,
-		&ds.MidHeaderRewrite,
-		&ds.MissLat,
-		&ds.MissLong,
-		&ds.MultiSiteOrigin,
-		&ds.OriginShield,
-		&ds.ProfileID,
-		&ds.Protocol,
-		&ds.QStringIgnore,
-		&ds.RangeRequestHandling,
-		&ds.RegexRemap,
-		&ds.RegionalGeoBlocking,
-		&ds.RemapText,
-		&ds.RoutingName,
-		&ds.SigningAlgorithm,
-		&ds.SSLKeyVersion,
-		&ds.TenantID,
-		&ds.TRRequestHeaders,
-		&ds.TRResponseHeaders,
-		&ds.TypeID,
-		&ds.XMLID,
-		&ds.AnonymousBlockingEnabled,
-		&ds.ConsistentHashRegex,
-		&ds.MaxOriginConnections,
-		&ds.EcsEnabled,
-		&ds.RangeSliceBlockSize,
-		&ds.Topology,
-		&ds.FirstHeaderRewrite,
-		&ds.InnerHeaderRewrite,
-		&ds.LastHeaderRewrite,
-		&ds.ServiceCategory,
-		&ds.MaxRequestHeaderBytes,
-		&ds.ID)
+	if omitExtraLongDescFields {
+		if ds.LongDesc1 != nil || ds.LongDesc2 != nil {
+			return nil, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear

##########
File path: CHANGELOG.md
##########
@@ -101,6 +101,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 - The `traffic_ops_ort.pl` tool has been deprecated in favor of `t3c`, and will be removed in the next major version.
 
 ### Removed
+- Removed the `Long Description 2` and `Long Description 3` from the UI, and changed the backend so that routes corresponding API 4.0 and above no longer accept or return these fields. 

Review comment:
       the changelog message should specify that those are delivery service fields

##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
##########
@@ -716,6 +740,18 @@ func putV40(w http.ResponseWriter, r *http.Request, inf *api.APIInfo) (result ds
 		dsr.Status,
 		inf.IntParams["id"],
 	}
+	if dsr.Original != nil {
+		if dsr.Original.LongDesc1 != nil || dsr.Original.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)
+			return
+		}
+	}
+	if dsr.Requested != nil {
+		if dsr.Requested.LongDesc1 != nil || dsr.Requested.LongDesc2 != nil {
+			api.HandleErr(w, r, tx, http.StatusBadRequest, errors.New("the Long Description 1 and Long Description 2 fields are no longer supported in API 4.0 onwards"), nil)

Review comment:
       this error message should probably use the json field names, i.e. `longDesc1` and `longDesc2` just to be clear




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-872292804


   @srijeet0406 - you need to remove these fields from the TP ds tables as well. i don't see that change in this PR.
   
   ![image](https://user-images.githubusercontent.com/251272/124140674-eab10380-da45-11eb-9527-a2886a98376a.png)
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 edited a comment on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750


   @srijeet0406 sorry for the late comment. so what happens if i do a PUT /api/4.0/ds w/o long1 and long2? do those values get wiped from the db if they exist?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882674752


   They're omitted from the update query, so they should be unchanged in the DB.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#discussion_r661775786



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -339,6 +339,13 @@ type DeliveryServiceRemovedFieldsV11 struct {
 	CacheURL *string `json:"cacheurl" db:"cacheurl"`
 }
 
+// RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V 4.x DS, and returns the resulting struct.
+func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4 {
+	ds.LongDesc1 = nil
+	ds.LongDesc2 = nil
+	return *ds
+}
+

Review comment:
       That would break how his implementation works. It optionally inserts/updates those fields depending on which API version was requested, so we can't set them to nil in `UpgradeToV4` which is used in `createV31` and `updateV31`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#discussion_r661785710



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -339,6 +339,13 @@ type DeliveryServiceRemovedFieldsV11 struct {
 	CacheURL *string `json:"cacheurl" db:"cacheurl"`
 }
 
+// RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V 4.x DS, and returns the resulting struct.
+func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4 {
+	ds.LongDesc1 = nil
+	ds.LongDesc2 = nil
+	return *ds
+}
+

Review comment:
       I can't wait until everything has been collapsed up to v4.0 and we can get rid of all these hoops :) 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] srijeet0406 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882675512


   Yeah, no DB changes were made in this PR. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882680013


   > They're omitted from the update query, so they should be unchanged in the DB.
   
   ok, that's good. i know there are important values in long1 and long2 and losing those values by simply doing a ds update via 4.0 could be bad.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750


   @srijeet0406 sorry for the late comment. so what happens if i do a PUT /api/4.0/ds w/o long2 and long3? do those values get wiped from the db if they exist?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#discussion_r661772983



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -339,6 +339,13 @@ type DeliveryServiceRemovedFieldsV11 struct {
 	CacheURL *string `json:"cacheurl" db:"cacheurl"`
 }
 
+// RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V 4.x DS, and returns the resulting struct.
+func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4 {
+	ds.LongDesc1 = nil
+	ds.LongDesc2 = nil
+	return *ds
+}
+

Review comment:
       I think this needs to be called in the upgrade method from v31 to v40




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750






-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750






-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] srijeet0406 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-872619557


   Here is the follow up PR: https://github.com/apache/trafficcontrol/pull/5989


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882674752


   They're omitted from the update query, so they should be unchanged in the DB.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 edited a comment on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882670750


   @srijeet0406 sorry for the late comment. so what happens if i do a PUT /api/4.0/ds w/o long1 and long2? do those values get wiped from the db if they exist?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] srijeet0406 commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882675512


   Yeah, no DB changes were made in this PR. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] rawlinp commented on pull request #5986: Remove Long Desc 1 and Long Desc 2 fields from API 4.0

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5986:
URL: https://github.com/apache/trafficcontrol/pull/5986#issuecomment-882674752


   They're omitted from the update query, so they should be unchanged in the DB.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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