[GitHub] moltzaum edited a comment on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
moltzaum edited a comment on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450381705
 
 
   I curled both endpoints. The one I have here is also just short enough to 
fit on a single line, which is why I chose it. Also, both endpoints use the 
same subroutine in perl so it isn't the problem.
   
   EDIT: I also copied all the header and endpoint information from TP using 
inspect. That's why I think my issue is with my environment, not the endpoint 
itself.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] moltzaum edited a comment on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
moltzaum edited a comment on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450381705
 
 
   I curled both endpoints. The one I have here is also just short enough to 
fit on a single line, which is why I chose it. Also, both endpoints use the 
same subroutine in perl so it isn't the problem.
   
   EDIT: I also copied all the header and endpoint information that TP was 
using with inspect. That's why I think my issue is with my environment, not the 
endpoint itself.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] moltzaum edited a comment on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
moltzaum edited a comment on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450381705
 
 
   I curled both endpoints. The one I have here is also just short enough to 
fit on a single line, which is why I chose it. Also, both endpoints use the 
same subroutine in perl so it isn't the problem.
   
   EDIT: I also copied all the header information from TP using inspect. That's 
why I think my issue is with my environment, not the endpoint itself.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3166: TP: sorts the results of GET /tenants to represent the hierarchy

2018-12-28 Thread GitBox
asfgit commented on issue #3166: TP: sorts the results of GET /tenants to 
represent the hierarchy
URL: https://github.com/apache/trafficcontrol/pull/3166#issuecomment-450388635
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2992/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh closed pull request #3166: TP: sorts the results of GET /tenants to represent the hierarchy

2018-12-28 Thread GitBox
dangogh closed pull request #3166: TP: sorts the results of GET /tenants to 
represent the hierarchy
URL: https://github.com/apache/trafficcontrol/pull/3166
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
index 38002f658..c41489967 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var FormDeliveryServiceController = function(deliveryService, dsCurrent, 
origin, type, types, $scope, $location, $uibModal, $window, formUtils, 
locationUtils, tenantUtils, deliveryServiceUtils, cdnService, profileService, 
tenantService, propertiesModel) {
+var FormDeliveryServiceController = function(deliveryService, dsCurrent, 
origin, type, types, $scope, $location, $uibModal, $window, formUtils, 
locationUtils, tenantUtils, deliveryServiceUtils, cdnService, profileService, 
tenantService, propertiesModel, userModel) {
 
 var getCDNs = function() {
 cdnService.getCDNs()
@@ -36,10 +36,13 @@ var FormDeliveryServiceController = 
function(deliveryService, dsCurrent, origin,
 };
 
 var getTenants = function() {
-tenantService.getTenants()
-.then(function(result) {
-$scope.tenants = result;
-tenantUtils.addLevels($scope.tenants);
+tenantService.getTenant(userModel.user.tenantId)
+.then(function(tenant) {
+tenantService.getTenants()
+.then(function(tenants) {
+$scope.tenants = 
tenantUtils.hierarchySort(tenantUtils.groupTenantsByParent(tenants), 
tenant.parentId, []);
+tenantUtils.addLevels($scope.tenants);
+});
 });
 };
 
@@ -299,5 +302,5 @@ var FormDeliveryServiceController = 
function(deliveryService, dsCurrent, origin,
 
 };
 
-FormDeliveryServiceController.$inject = ['deliveryService', 'dsCurrent', 
'origin', 'type', 'types', '$scope', '$location', '$uibModal', '$window', 
'formUtils', 'locationUtils', 'tenantUtils', 'deliveryServiceUtils', 
'cdnService', 'profileService', 'tenantService', 'propertiesModel'];
+FormDeliveryServiceController.$inject = ['deliveryService', 'dsCurrent', 
'origin', 'type', 'types', '$scope', '$location', '$uibModal', '$window', 
'formUtils', 'locationUtils', 'tenantUtils', 'deliveryServiceUtils', 
'cdnService', 'profileService', 'tenantService', 'propertiesModel', 
'userModel'];
 module.exports = FormDeliveryServiceController;
diff --git 
a/traffic_portal/app/src/common/modules/form/origin/FormOriginController.js 
b/traffic_portal/app/src/common/modules/form/origin/FormOriginController.js
index 2231a1fc6..f6deaa887 100644
--- a/traffic_portal/app/src/common/modules/form/origin/FormOriginController.js
+++ b/traffic_portal/app/src/common/modules/form/origin/FormOriginController.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var FormOriginController = function(origin, $scope, $window, $location, 
formUtils, locationUtils, tenantUtils, deliveryServiceService, profileService, 
tenantService, coordinateService, cacheGroupService, originService) {
+var FormOriginController = function(origin, $scope, $window, $location, 
formUtils, locationUtils, tenantUtils, deliveryServiceService, profileService, 
tenantService, coordinateService, cacheGroupService, userModel) {
 
 var getProfiles = function() {
 profileService.getProfiles({ orderby: 'name' })
@@ -29,10 +29,13 @@ var FormOriginController = function(origin, $scope, 
$window, $location, formUtil
 };
 
 var getTenants = function() {
-tenantService.getTenants()
-.then(function(result) {
-$scope.tenants = result;
-tenantUtils.addLevels($scope.tenants);
+tenantService.getTenant(userModel.user.tenantId)
+.then(function(tenant) {
+tenantService.getTenants()
+.then(function(tenants) {
+$scope.tenants = 
tenantUtils.hierarchySort(tenantUtils.groupTenantsByParent(tenants), 
tenant.parentId, []);
+tenantUtils.addLevels($scope.tenants);
+});
 });
 };
 
@@ -97,5 +100,5 @@ var FormOriginController = function(origin, $scope, $window, 
$location, formUtil
 
 };
 
-FormOriginController.$inject = ['origin', '$scope', '$window', '$location', 
'formUtils', 'locationUtils', 'tenantUtils', 'deliveryServiceService', 
'profileService', 

[GitHub] dangogh closed issue #3159: GET /api/tenants ordering changed from Perl to Go

2018-12-28 Thread GitBox
dangogh closed issue #3159: GET /api/tenants ordering changed from Perl to Go
URL: https://github.com/apache/trafficcontrol/issues/3159
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh closed pull request #3169: CIAB: Fix Automatic snapshot/queue-updates on startup.

2018-12-28 Thread GitBox
dangogh closed pull request #3169: CIAB: Fix Automatic snapshot/queue-updates 
on startup.
URL: https://github.com/apache/trafficcontrol/pull/3169
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/source/admin/quick_howto/ciab.rst 
b/docs/source/admin/quick_howto/ciab.rst
index 770e4ff5c..03d79774d 100644
--- a/docs/source/admin/quick_howto/ciab.rst
+++ b/docs/source/admin/quick_howto/ciab.rst
@@ -171,6 +171,14 @@ The "enroller" provides an efficient way for Traffic Ops 
to be populated with da
 
 The enroller runs within CDN in a Box using the ``-dir `` switch which 
provides the above behavior. It can also be run using the ``-http :`` 
switch to instead have it listen on the indicated port. In this case, it 
accepts only POST requests with the JSON provided using the POST JSON method, 
e.g. ``curl -X POST https://enroller/api/1.4/regions -d @newregion.json``.  CDN 
in a Box does not currently use this method, but may be modified in the future 
to avoid using the shared volume approach.
 
+Auto Snapshot/Queue-Updates
+---
+An automatic snapshot of the current Traffic Ops CDN configuration/toplogy 
will be performed once the "enroller" has finished loading all of the data and 
a minimum number of servers have been enrolled.  To enable this feature, set 
the boolean ``AUTO_SNAPQUEUE_ENABLED`` to ``true`` [7]_.  The snapshot and 
queue-updates actions will not be performed until all servers in 
``AUTO_SNAPQUEUE_SERVERS`` (comma-delimited string) have been enrolled.  The 
current enrolled servers will be polled every ``AUTO_SNAPQUEUE_POLL_INTERVAL`` 
seconds, and each action (snapshot and queue-updates) will be delayed 
``AUTO_SNAPQUEUE_ACTION_WAIT`` seconds [8]_.
+
+.. [7] Automatic Snapshot/Queue-Updates is enabled by default in 
``infrastructure/cdn-in-a-box/variables.env``.
+.. [8] Server poll interval and delay action wait are defaulted to a value of 
2 seconds.
+
+
 Mock Origin Service
 ---
 The default "origin" service container provides a basic static file HTTP 
server as the central respository for content. Additional files can be added to 
the origin root content directory located at 
``infrastructure/cdn-in-a-box/origin/content``. To request content directly 
from the origin directly and bypass the CDN:
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/config.sh 
b/infrastructure/cdn-in-a-box/traffic_ops/config.sh
index b310d0111..a653d09f7 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/config.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/config.sh
@@ -90,7 +90,8 @@ cat <<-EOF >/opt/traffic_ops/app/conf/cdn.conf
 "max_db_connections": 20,
 "backend_max_connections": {
 "mojolicious": 4
-}
+},
+"crconfig_snapshot_use_client_request_host": true
 },
 "cors" : {
 "access_control_allow_origin" : "*"
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh 
b/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
index 1aa8094c0..5914cebff 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
@@ -90,17 +90,38 @@ while true; do
   sleep 2
 done
 
-# Snapshot the CDN 
-until [ $(to-get '/CRConfig-Snapshots/CDN-in-a-Box/CRConfig.json' 2>/dev/null 
| jq -c -e '.config|length') -gt 0 ] ; do 
-  sleep 2
-  echo "Do Snapshot for CDN-in-a-Box..."; 
-  to-put 'api/1.3/cdns/2/snapshot'
+### Automatic Queue/Snapshot ###
+while [[ "$AUTO_SNAPQUEUE_ENABLED" = true ]] ; do
+  # AUTO_SNAPQUEUE_SERVERS should be a comma delimited list of expected docker 
service names to be enrolled - see varibles.env
+  expected_servers_json=$(echo "$AUTO_SNAPQUEUE_SERVERS" | tr ',' '\n' | jq -R 
. | jq -M -c -e -s '.|sort')
+  expected_servers_list=$(jq -r -n --argjson expected "$expected_servers_json" 
'$expected|join(",")')
+  expected_servers_total=$(jq -r -n --argjson expected 
"$expected_servers_json" '$expected|length')
+
+  current_servers_json=$(to-get 'api/1.4/servers' 2>/dev/null | jq -c -e 
'[.response[] | .xmppId] | sort')
+  [ -z "$current_servers_json" ] && current_servers_json='[]'
+  current_servers_list=$(jq -r -n --argjson current "$current_servers_json" 
'$current|join(",")')
+  current_servers_total=$(jq -r -n --argjson current "$current_servers_json" 
'$current|length')
+ 
+  remain_servers_json=$(jq -n --argjson expected "$expected_servers_json" 
--argjson current "$current_servers_json" '$expected-$current')
+  remain_servers_list=$(jq -r -n --argjson remain "$remain_servers_json" 
'$remain|join(",")')
+  remain_servers_total=$(jq -r -n --argjson remain "$remain_servers_json" 
'$remain|length')
+
+  echo "AUTO-SNAPQUEUE - Expected Servers ($expected_servers_total): 
$expected_servers_l

[GitHub] dangogh commented on issue #3138: CIAB Trafficmonitor shows a lot of "Request Error: ... service still starting, some caches unpolled"

2018-12-28 Thread GitBox
dangogh commented on issue #3138: CIAB Trafficmonitor shows a lot of "Request 
Error: ... service still starting, some caches unpolled"
URL: https://github.com/apache/trafficcontrol/issues/3138#issuecomment-450393366
 
 
   fixed by #3169 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh closed issue #3138: CIAB Trafficmonitor shows a lot of "Request Error: ... service still starting, some caches unpolled"

2018-12-28 Thread GitBox
dangogh closed issue #3138: CIAB Trafficmonitor shows a lot of "Request Error: 
... service still starting, some caches unpolled"
URL: https://github.com/apache/trafficcontrol/issues/3138
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on issue #3160: Add some steps in the CIAB README

2018-12-28 Thread GitBox
dangogh commented on issue #3160: Add some steps in the CIAB README
URL: https://github.com/apache/trafficcontrol/pull/3160#issuecomment-450393618
 
 
   @Shihta -- with #3169 merged,  ok to close this ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
dangogh commented on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450401089
 
 
   yes -- verified the problem in CIAB,  but also in another full test 
environment, so not limited to your environment.   These endpoints are still in 
Perl, so we should get them implemented in Go rather than trying to fix in Perl.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] moltzaum commented on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
moltzaum commented on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450401717
 
 
   Interesting. Do you know what the issue might be, especially if it works 
with TP still?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3157: Added error context helper to help with tests. Also wrote unit tests for it.

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3157: Added error context helper 
to help with tests. Also wrote unit tests for it.
URL: https://github.com/apache/trafficcontrol/pull/3157#discussion_r244376252
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/test/error_context.go
 ##
 @@ -0,0 +1,214 @@
+/*
+
+   Licensed 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.
+*/
+
+package test
+
+import "fmt"
+
+type errorCode struct {
+   error
+   cause error
+   code  int
+}
+
+type ErrorCoder interface {
+   Error() string
+   ErrorCode() int
+   Cause() error
+   Prepend(string, ...interface{}) ErrorCoder
+}
+
+func NewError(code int, fmtStr string, fmtArgs ...interface{}) ErrorCoder {
+   err := fmt.Errorf(fmtStr, fmtArgs...)
+   return &errorCode{err, err, code}
+}
+
+func (e errorCode) ErrorCode() int {
+   return e.code
+}
+
+// not a pointer receiver, does not modify itself
+func (e errorCode) Prepend(fmtStr string, fmtArgs ...interface{}) ErrorCoder {
+   err := fmt.Errorf(fmtStr, fmtArgs...)
+   e.error = fmt.Errorf("%v %v", err, e.error)
+   return e
+}
+
+func (e errorCode) Cause() error {
+   return e.cause
+}
+
+func AddErrorCode(code int, err error) ErrorCoder {
+   return NewError(code, "%v", err)
+}
+
+// ErrorContext
+// contains a list of all error codes (a whitelist)
+// - allows user to make sure they are creating the correct errors
+// - actually a map
+// lookup can be done without linear search
+// we can use the map to keep count of which errors are 
made
+// contains mapping from error code to name (either for testing metainfo or 
used in case no args are given)
+// not required for all error codes, or for any
+//
+// context.NewError was made to improve upon test.NewError
+type ErrorContext struct {
+   calledNewError  bool
+   createdNewError bool
+   doPanic bool
+   namestring
+   codes   map[uint]uint
+   description map[uint]string
+}
+
+func NewErrorContext(contextName string, errCodes []uint) *ErrorContext {
+
+   codeMap := make(map[uint]uint)
+   for _, code := range errCodes {
+   codeMap[code] = 0
+   }
+
+   descMap := make(map[uint]string)
+
+   return &ErrorContext{
+   calledNewError:  false,
+   createdNewError: false,
+   doPanic: false,
+   name:contextName,
+   codes:   codeMap,
+   description: descMap,
+   }
+}
+
+// although highly discouraged, panic mode is made as an option
+// made this decision partially because type assertions and map membership 
have similar options
+// if a user doesn't have panic mode on, they should still terminate after 
running into an error
+// panic is off by default, and must be turned on explicitly
+// panic must be turned on before errors are created
+// once turned on the panic mode can't be turned off
+func (ec *ErrorContext) TurnPanicOn() error {
+   if ec.calledNewError {
+   return ec.internalError(BAD_INIT_TIMING, nil)
+   }
+   ec.doPanic = true
+   return nil
+}
+
+// msg should be a plain string without special formatting
+func (ec *ErrorContext) AddMapping(code uint, msg string) error {
+   if ec.calledNewError {
+   return ec.internalError(BAD_INIT_TIMING, nil)
+   }
+   if !ec.whitelisted(code) {
+   return ec.internalError(BAD_MAP_CREATE, code)
+   }
+   if _, exists := ec.description[code]; exists {
+   return ec.internalError(BAD_DUP_MAPPING, code)
+   }
+   ec.description[code] = msg
+   return nil
+}
+
+// the function argument will not override the current contents of the map, 
everything is additive
+// an error is returned if a duplicate code is added
+func (ec *ErrorContext) AddMap(mapping map[uint]string) error {
+   for code, desc := range mapping {
+   if err := ec.AddMapping(code, desc); err != nil {
+   return err
+   }
+   }
+   return nil
+}
+
+// all internal errors
+const BAD_ERROR_CODE = -1  // when bad error code is given in creation of new 
error
+const BAD_MAP_LOOKUP = -2  // when creating an error with no error message, 
default message wasn't found
+const BAD_MAP_CREATE = -3  // when bad error code is given in crea

[GitHub] dangogh commented on a change in pull request #3157: Added error context helper to help with tests. Also wrote unit tests for it.

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3157: Added error context helper 
to help with tests. Also wrote unit tests for it.
URL: https://github.com/apache/trafficcontrol/pull/3157#discussion_r244377319
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/test/error_context.go
 ##
 @@ -0,0 +1,214 @@
+/*
+
+   Licensed 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.
+*/
+
+package test
+
+import "fmt"
+
+type errorCode struct {
+   error
+   cause error
+   code  int
+}
+
+type ErrorCoder interface {
+   Error() string
+   ErrorCode() int
+   Cause() error
+   Prepend(string, ...interface{}) ErrorCoder
+}
+
+func NewError(code int, fmtStr string, fmtArgs ...interface{}) ErrorCoder {
+   err := fmt.Errorf(fmtStr, fmtArgs...)
+   return &errorCode{err, err, code}
+}
+
+func (e errorCode) ErrorCode() int {
+   return e.code
+}
+
+// not a pointer receiver, does not modify itself
+func (e errorCode) Prepend(fmtStr string, fmtArgs ...interface{}) ErrorCoder {
+   err := fmt.Errorf(fmtStr, fmtArgs...)
+   e.error = fmt.Errorf("%v %v", err, e.error)
+   return e
+}
+
+func (e errorCode) Cause() error {
+   return e.cause
+}
+
+func AddErrorCode(code int, err error) ErrorCoder {
+   return NewError(code, "%v", err)
+}
+
+// ErrorContext
+// contains a list of all error codes (a whitelist)
+// - allows user to make sure they are creating the correct errors
+// - actually a map
+// lookup can be done without linear search
+// we can use the map to keep count of which errors are 
made
+// contains mapping from error code to name (either for testing metainfo or 
used in case no args are given)
+// not required for all error codes, or for any
+//
+// context.NewError was made to improve upon test.NewError
+type ErrorContext struct {
+   calledNewError  bool
+   createdNewError bool
+   doPanic bool
+   namestring
+   codes   map[uint]uint
 
 Review comment:
   had to trace thru the code to figure out where the whitelist came from, then 
saw the comment above.  Should this be called "whitelist" to make that apparent?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on issue #3168: Cannot update current user with curl

2018-12-28 Thread GitBox
dangogh commented on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450405508
 
 
   ahh..looking at the payload sent by TP -- format requires it to be 
embedded in an object with the "user" key:
   ```
   {
  "user" : {
"username": "me",
...
  }
   }
   ```
   
   Example in the docs shows the same:
   https://trafficcontrol.apache.org/docs/latest/api/user_current.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 commented on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
mitchell852 commented on issue #3096: Traffic Portal dbdump failure shows no 
error message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450407496
 
 
   I tried GET /api/1.4/dbdump with less than admin role and got this:
   
   
![image](https://user-images.githubusercontent.com/251272/50524872-71f81780-0a95-11e9-8289-007723c7c2eb.png)
   
   The 403 is correct but confused why `data: ArrayBuffer(49)` is in there. 
Seems like it sends a 403 AND the contents of the dbdump...obviously, it 
shouldn't do that.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 edited a comment on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
mitchell852 edited a comment on issue #3096: Traffic Portal dbdump failure 
shows no error message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450407496
 
 
   I tried GET /api/1.4/dbdump with less than admin role and got this:
   
   
![image](https://user-images.githubusercontent.com/251272/50524872-71f81780-0a95-11e9-8289-007723c7c2eb.png)
   
   The 403 is correct but confused why `data: ArrayBuffer(49)` is in there. 
Seems like it sends a 403 AND the contents of the dbdump...obviously, it 
shouldn't do that.
   
   Even though it clearly looks like you get kicked out before doing the dbdump 
if you are not admin role:
   
   
https://github.com/apache/trafficcontrol/blob/master/traffic_ops/app/lib/API/Database.pm#L29


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 opened a new pull request #3170: handles error scenario for dbdump in TP

2018-12-28 Thread GitBox
mitchell852 opened a new pull request #3170: handles error scenario for dbdump 
in TP
URL: https://github.com/apache/trafficcontrol/pull/3170
 
 
    What does this PR do?
   
   Fixes #3096 
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [ ] Traffic Ops
   - [ ] Traffic Ops ORT
   - [x] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] Other _
   
    What is the best way to verify this PR?
   
   1. Launch TP
   2. Log in as user w/ role != admin
   3. Attempt to do a dbdump
   
   
![image](https://user-images.githubusercontent.com/251272/50525059-82f55880-0a96-11e9-9e67-c61a30a4002e.png)
   
   5. You should see an error message
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 edited a comment on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
mitchell852 edited a comment on issue #3096: Traffic Portal dbdump failure 
shows no error message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450407496
 
 
   I tried GET /api/1.4/dbdump with less than admin role and got this:
   
   
![image](https://user-images.githubusercontent.com/251272/50524872-71f81780-0a95-11e9-8289-007723c7c2eb.png)
   
   The 403 is correct but confused on a couple of things:
   
   1. Where is the alerts array?
   2. Why is `data: ArrayBuffer(49)` in there. Seems like it sends a 403 AND 
the contents of the dbdump...obviously, it shouldn't do that.
   
   Even though it clearly looks like you get kicked out before doing the dbdump 
if you are not admin role:
   
   
https://github.com/apache/trafficcontrol/blob/master/traffic_ops/app/lib/API/Database.pm#L29


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3170: handles error scenario for dbdump in TP

2018-12-28 Thread GitBox
asfgit commented on issue #3170: handles error scenario for dbdump in TP
URL: https://github.com/apache/trafficcontrol/pull/3170#issuecomment-450409443
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2993/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244383973
 
 

 ##
 File path: traffic_ops/client/asn.go
 ##
 @@ -132,33 +130,3 @@ func (to *Session) DeleteASNByASN(asn int) (tc.Alerts, 
ReqInf, error) {
err = json.NewDecoder(resp.Body).Decode(&alerts)
return alerts, reqInf, nil
 }
-
-func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) 
(tc.Alerts, ReqInf, error) {
-   route := apiBase + `/deliveryservice_server/` + strconv.Itoa(dsID) + 
"/" + strconv.Itoa(serverID)
 
 Review comment:
   +1 on moving these -- dunno why they got in `asn.go` in the first place..


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244386192
 
 

 ##
 File path: traffic_ops/testing/api/v14/tenants_test.go
 ##
 @@ -110,27 +114,195 @@ func DeleteTestTenants(t *testing.T) {
if err != nil {
t.Errorf("cannot GET Tenant by name: %v - %v\n", t1, err)
}
+   expectedChildDeleteErrMsg := `Tenant '` + strconv.Itoa(tenant1.ID) + `' 
has child tenants. Please update these child tenants and retry.`
+   if _, err := TOSession.DeleteTenant(strconv.Itoa(tenant1.ID)); err == 
nil {
+   t.Fatalf("%s has child tenants -- should not be able to 
delete", t1)
+   } else if !strings.Contains(err.Error(), expectedChildDeleteErrMsg) {
+   t.Errorf("expected error: %s;  got %s", 
expectedChildDeleteErrMsg, err.Error())
+   }
+
+   deletedTenants := map[string]struct{}{}
+   for {
 
 Review comment:
   +1
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244386709
 
 

 ##
 File path: traffic_ops/testing/api/v14/user_test.go
 ##
 @@ -61,11 +63,10 @@ func CreateTestUsers(t *testing.T) {
for _, user := range testData.Users {
 
resp, _, err := TOSession.CreateUser(&user)
-   log.Debugln("Response: ", resp.Alerts)
-
if err != nil {
-   t.Errorf("could not CREATE user: %v\n", err)
+   t.Fatalf("could not CREATE user: %v\n", err)
 
 Review comment:
   +1 -- if the Fatalf occurs before the test gets cleaned up,  the following 
test may fail.   Really should only use Fatalf if we can't recover from the 
situation,  and that should be made very clear.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244387559
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/tenant/tenancy.go
 ##
 @@ -171,13 +188,46 @@ func IsTenancyEnabledTx(tx *sql.Tx) (bool, error) {
 }
 
 // IsResourceAuthorizedToUserTx returns a boolean value describing if the user 
has access to the provided resource tenant id and an error
-// if use_tenancy is set to false (0 in the db) this method will return true 
allowing access.
+// If use_tenancy is set to false (0 in the db) this method will return true 
allowing access.
+// If the user tenant is inactive (or any of its parent tenants are inactive), 
false will be returned.
 func IsResourceAuthorizedToUserTx(resourceTenantID int, user 
*auth.CurrentUser, tx *sql.Tx) (bool, error) {
-   // $1 is the user tenant ID and $2 is the resource tenant ID
-   query := `WITH RECURSIVE q AS (SELECT id, active FROM tenant WHERE id = 
$1
-   UNION SELECT t.id, t.active FROM TENANT t JOIN q ON q.id = t.parent_id),
-   tenancy AS (SELECT COALESCE(value::boolean,FALSE) AS value FROM 
parameter WHERE name = 'use_tenancy' AND config_file = 'global' UNION ALL 
SELECT FALSE FETCH FIRST 1 ROW ONLY)
-   SELECT id, active, tenancy.value AS use_tenancy FROM tenancy, q WHERE 
id = $2 UNION ALL SELECT -1, false, tenancy.value AS use_tenancy FROM tenancy 
FETCH FIRST 1 ROW ONLY;`
+   query := `
+WITH RECURSIVE
+user_tenant_id as (select $1::bigint as v),
+resource_tenant_id as (select $2::bigint as v),
+user_tenant_parents AS (
+  SELECT active, parent_id FROM tenant WHERE id = (select v from 
user_tenant_id)
+  UNION
+  SELECT t.active, t.parent_id FROM TENANT t JOIN user_tenant_parents ON 
user_tenant_parents.parent_id = t.id
+),
+q AS (
+  SELECT id, active FROM tenant WHERE id = (select v from user_tenant_id)
+  UNION
+  SELECT t.id, t.active FROM TENANT t JOIN q ON q.id = t.parent_id
+),
+tenancy AS (
+  SELECT
+COALESCE(value::boolean,FALSE) AS value
+  FROM
+parameter
+  WHERE
+name = 'use_tenancy'
+AND config_file = 'global'
+  UNION ALL SELECT FALSE
+  FETCH FIRST 1 ROW ONLY
+)
+SELECT
+  id,
+  (select bool_and(active) from user_tenant_parents) as active,
+  tenancy.value AS use_tenancy
+FROM
+  tenancy,
+  q
+WHERE
+  id = (select v from resource_tenant_id)
+UNION ALL SELECT -1, false, tenancy.value AS use_tenancy FROM tenancy
+FETCH FIRST 1 ROW ONLY;
+`
 
 
 Review comment:
   We've already decided to eliminate the `use_tenancy` param and have it now 
always set to 1.Can we get rid of that portion?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244385609
 
 

 ##
 File path: traffic_ops/client/deliveryserviceserver.go
 ##
 @@ -42,3 +45,48 @@ func (to *Session) CreateDeliveryServiceServers(dsID int, 
serverIDs []int, repla
}
return &resp.Response, nil
 }
+
+func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) 
(tc.Alerts, ReqInf, error) {
+   route := apiBase + `/deliveryservice_server/` + strconv.Itoa(dsID) + 
"/" + strconv.Itoa(serverID)
+   reqResp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, errors.New("requesting from Traffic 
Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.Alerts{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.Alerts{}, reqInf, errors.New("decoding response: " + 
err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServers() 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver`
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServersN(n int) 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver` + `?limit=` + 
strconv.Itoa(n)
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
 
 Review comment:
   that's a lot of duplicate code..  can the former call the latter with n=-1 
(for no limit)?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy 
and Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244387065
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/tenant/tenancy.go
 ##
 @@ -136,11 +136,28 @@ func GetUserTenantListTx(user auth.CurrentUser, tx 
*sql.Tx) ([]tc.TenantNullable
return tenants, nil
 }
 
+// GetUserTenantIDListTx returns a list of tenant IDs accessible to the given 
tenant.
+// Note: If the given tenant or any of its parents are inactive, no IDs will 
be returned. If child tenants are needed even if the current tenant is 
inactive, use GetUserTenantListTx instead.
 func GetUserTenantIDListTx(tx *sql.Tx, userTenantID int) ([]int, error) {
query := `
-WITH RECURSIVE q AS (SELECT id, name, active, parent_id FROM tenant WHERE id = 
$1
-UNION SELECT t.id, t.name, t.active, t.parent_id  FROM tenant t JOIN q ON q.id 
= t.parent_id)
-SELECT id FROM q;
+WITH RECURSIVE
+user_tenant_id as (select $1::bigint as v),
+user_tenant_parents AS (
+  SELECT active, parent_id FROM tenant WHERE id = (select v from 
user_tenant_id)
+  UNION
+  SELECT t.active, t.parent_id FROM TENANT t JOIN user_tenant_parents ON 
user_tenant_parents.parent_id = t.id
+),
+user_tenant_active AS (
+  SELECT bool_and(active) as v FROM user_tenant_parents
+),
+user_tenant_children AS (
+  SELECT id, name, active, parent_id
+  FROM tenant WHERE id = (SELECT v FROM user_tenant_id) AND (SELECT v FROM 
user_tenant_active)
+  UNION
+  SELECT t.id, t.name, t.active, t.parent_id
+  FROM tenant t JOIN user_tenant_children ON user_tenant_children.id = 
t.parent_id
+)
+SELECT id FROM user_tenant_children;
 
 Review comment:
   +1 -- this is much clearer, although still pretty hairy.   I wonder if it 
would be worth creating this as an SQL function that can be tested/maintained 
outside of the code?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 commented on issue #3117: Bad regex for PUT method of /api/1.x/users endpoint

2018-12-28 Thread GitBox
mitchell852 commented on issue #3117: Bad regex for PUT method of 
/api/1.x/users endpoint
URL: https://github.com/apache/trafficcontrol/issues/3117#issuecomment-450431841
 
 
   First of all, I think the`.json` is just silly because does our API support 
anything other than json? but that's another story i guess. 
   
   But I'd say when in doubt just follow the examples already in routes.go so i 
guess:
   
   ```
{1.4, http.MethodGet, `users/?(\.json)?$`
{1.4, http.MethodGet, `users/{id}$`
{1.4, http.MethodPut, `users/{id}$`
{1.4, http.MethodPost, `users/?$`
   ```
   Also, why is it 1.4? If these are simply rewrites of the Perl routes, it 
should be 1.1
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244457995
 
 

 ##
 File path: traffic_ops/testing/api/v14/user_test.go
 ##
 @@ -61,11 +63,10 @@ func CreateTestUsers(t *testing.T) {
for _, user := range testData.Users {
 
resp, _, err := TOSession.CreateUser(&user)
-   log.Debugln("Response: ", resp.Alerts)
-
if err != nil {
-   t.Errorf("could not CREATE user: %v\n", err)
+   t.Fatalf("could not CREATE user: %v\n", err)
 
 Review comment:
   >Really should only use Fatalf if we can't recover from the situation
   
   That's exactly what happens here, that's why I changed it. If an error is 
returned, the following line
   ```
   log.Debugln("Response: ", resp.Alerts)
   ```
   
   will panic. If an error is returned, the test can't keep going, which is 
exactly what `Fatalf` is for. Because of the panic, the test won't get cleaned 
up anyway, and subsequent tests will fail anyway. Using `Fatal` instead of 
`Error` avoids the panic stacktrace, and makes it easier to see what went wrong 
to fix it.
   
   We really need to fix the API Test framework to clean up tests even if they 
panic or `t.Fatalf`. I don't think it'll be hard, I think it's as simple as 
changing all our tests from e.g.
   ```
   func TestCacheGroups(t *testing.T) {
CreateTestTypes(t)
CreateTestCacheGroups(t)
GetTestCacheGroups(t)
CheckCacheGroupsAuthentication(t)
UpdateTestCacheGroups(t)
DeleteTestCacheGroups(t)
DeleteTestTypes(t)
   }
   ```
   To
   ```
   func TestCacheGroups(t *testing.T) {
defer DeleteTestTypes(t)
CreateTestTypes(t)
defer DeleteTestCacheGroups(t)
CreateTestCacheGroups(t)
GetTestCacheGroups(t)
CheckCacheGroupsAuthentication(t)
UpdateTestCacheGroups(t)
   }
   ```
   (similar to 
https://github.com/apache/trafficcontrol/blob/d083557e1a59cd4620b7652fd2821bf5d18d1ad3/traffic_ops/testing/api/v14/origins_test.go#L24
 but the `defer Delete`s need to come before their `Create`s).
   
   But that should probably be its own PR.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244458126
 
 

 ##
 File path: traffic_ops/client/deliveryserviceserver.go
 ##
 @@ -42,3 +45,48 @@ func (to *Session) CreateDeliveryServiceServers(dsID int, 
serverIDs []int, repla
}
return &resp.Response, nil
 }
+
+func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) 
(tc.Alerts, ReqInf, error) {
+   route := apiBase + `/deliveryservice_server/` + strconv.Itoa(dsID) + 
"/" + strconv.Itoa(serverID)
+   reqResp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, errors.New("requesting from Traffic 
Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.Alerts{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.Alerts{}, reqInf, errors.New("decoding response: " + 
err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServers() 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver`
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServersN(n int) 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver` + `?limit=` + 
strconv.Itoa(n)
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
 
 Review comment:
   Does `/deliveryserviceserver?limit=-1` work?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244458377
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/tenant/tenancy.go
 ##
 @@ -171,13 +188,46 @@ func IsTenancyEnabledTx(tx *sql.Tx) (bool, error) {
 }
 
 // IsResourceAuthorizedToUserTx returns a boolean value describing if the user 
has access to the provided resource tenant id and an error
-// if use_tenancy is set to false (0 in the db) this method will return true 
allowing access.
+// If use_tenancy is set to false (0 in the db) this method will return true 
allowing access.
+// If the user tenant is inactive (or any of its parent tenants are inactive), 
false will be returned.
 func IsResourceAuthorizedToUserTx(resourceTenantID int, user 
*auth.CurrentUser, tx *sql.Tx) (bool, error) {
-   // $1 is the user tenant ID and $2 is the resource tenant ID
-   query := `WITH RECURSIVE q AS (SELECT id, active FROM tenant WHERE id = 
$1
-   UNION SELECT t.id, t.active FROM TENANT t JOIN q ON q.id = t.parent_id),
-   tenancy AS (SELECT COALESCE(value::boolean,FALSE) AS value FROM 
parameter WHERE name = 'use_tenancy' AND config_file = 'global' UNION ALL 
SELECT FALSE FETCH FIRST 1 ROW ONLY)
-   SELECT id, active, tenancy.value AS use_tenancy FROM tenancy, q WHERE 
id = $2 UNION ALL SELECT -1, false, tenancy.value AS use_tenancy FROM tenancy 
FETCH FIRST 1 ROW ONLY;`
+   query := `
+WITH RECURSIVE
+user_tenant_id as (select $1::bigint as v),
+resource_tenant_id as (select $2::bigint as v),
+user_tenant_parents AS (
+  SELECT active, parent_id FROM tenant WHERE id = (select v from 
user_tenant_id)
+  UNION
+  SELECT t.active, t.parent_id FROM TENANT t JOIN user_tenant_parents ON 
user_tenant_parents.parent_id = t.id
+),
+q AS (
+  SELECT id, active FROM tenant WHERE id = (select v from user_tenant_id)
+  UNION
+  SELECT t.id, t.active FROM TENANT t JOIN q ON q.id = t.parent_id
+),
+tenancy AS (
+  SELECT
+COALESCE(value::boolean,FALSE) AS value
+  FROM
+parameter
+  WHERE
+name = 'use_tenancy'
+AND config_file = 'global'
+  UNION ALL SELECT FALSE
+  FETCH FIRST 1 ROW ONLY
+)
+SELECT
+  id,
+  (select bool_and(active) from user_tenant_parents) as active,
+  tenancy.value AS use_tenancy
+FROM
+  tenancy,
+  q
+WHERE
+  id = (select v from resource_tenant_id)
+UNION ALL SELECT -1, false, tenancy.value AS use_tenancy FROM tenancy
+FETCH FIRST 1 ROW ONLY;
+`
 
 
 Review comment:
   I think we made the decision, but the code doesn't currently enforce it, at 
present users can still leave tenancy disabled.
   
   I think we need to merge https://github.com/apache/trafficcontrol/pull/2791 
before removing `use_tenancy` checks.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix 
TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#issuecomment-450468941
 
 
   Fixed merge conflicts.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
asfgit commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix 
TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#issuecomment-450469698
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2994/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
asfgit commented on issue #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix 
TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#issuecomment-450470446
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2995/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244461170
 
 

 ##
 File path: traffic_ops/client/deliveryserviceserver.go
 ##
 @@ -42,3 +45,48 @@ func (to *Session) CreateDeliveryServiceServers(dsID int, 
serverIDs []int, repla
}
return &resp.Response, nil
 }
+
+func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) 
(tc.Alerts, ReqInf, error) {
+   route := apiBase + `/deliveryservice_server/` + strconv.Itoa(dsID) + 
"/" + strconv.Itoa(serverID)
+   reqResp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, errors.New("requesting from Traffic 
Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.Alerts{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.Alerts{}, reqInf, errors.New("decoding response: " + 
err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServers() 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver`
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServersN(n int) 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver` + `?limit=` + 
strconv.Itoa(n)
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
 
 Review comment:
   Ok, I changed them to use a common func. IMO the abstraction isn't worth the 
readability cost. So, I changed it in the safest way I could think of.
   
   A sigil (-1 or 0) would be confusing, since not passing a limit results in 
the default API limit of 20, not infinite (which is the bug adding a `N` func 
fixes); likewise passing the API limit would be bug-prone if the API changed; 
so, passing the query param itself seemed the safest and least confusing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244458126
 
 

 ##
 File path: traffic_ops/client/deliveryserviceserver.go
 ##
 @@ -42,3 +45,48 @@ func (to *Session) CreateDeliveryServiceServers(dsID int, 
serverIDs []int, repla
}
return &resp.Response, nil
 }
+
+func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) 
(tc.Alerts, ReqInf, error) {
+   route := apiBase + `/deliveryservice_server/` + strconv.Itoa(dsID) + 
"/" + strconv.Itoa(serverID)
+   reqResp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, errors.New("requesting from Traffic 
Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.Alerts{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.Alerts{}, reqInf, errors.New("decoding response: " + 
err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServers() 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver`
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
+}
+
+func (to *Session) GetDeliveryServiceServersN(n int) 
(tc.DeliveryServiceServerResponse, ReqInf, error) {
+   route := apiBase + `/deliveryserviceserver` + `?limit=` + 
strconv.Itoa(n)
+   reqResp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("requesting from Traffic Ops: " + err.Error())
+   }
+   defer reqResp.Body.Close()
+   resp := tc.DeliveryServiceServerResponse{}
+   if err = json.NewDecoder(reqResp.Body).Decode(&resp); err != nil {
+   return tc.DeliveryServiceServerResponse{}, reqInf, 
errors.New("decoding response: " + err.Error())
+   }
+   return resp, reqInf, nil
 
 Review comment:
   Does `/deliveryserviceserver?limit=-1` work?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy

2018-12-28 Thread GitBox
rob05c commented on a change in pull request #3163: Fix Traffic Ops Tenancy and 
Activity Bugs, Fix TO API Test Framework to work with Tenancy
URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244462785
 
 

 ##
 File path: traffic_ops/testing/api/v14/user_test.go
 ##
 @@ -61,11 +63,10 @@ func CreateTestUsers(t *testing.T) {
for _, user := range testData.Users {
 
resp, _, err := TOSession.CreateUser(&user)
-   log.Debugln("Response: ", resp.Alerts)
-
if err != nil {
-   t.Errorf("could not CREATE user: %v\n", err)
+   t.Fatalf("could not CREATE user: %v\n", err)
 
 Review comment:
   Actually, thinking about this some more, I think we should use `Fatalf` 
anywhere the test can't continue, irrespective of `defer` cleanups attempts. 
   
   There are always going to be cases where "delete" can't clean up 
appropriately, after a test fails at some point. Test errors are just like 
compile errors: you should only ever consider the first failure. Because any 
one failure can cause a chain of other unrelated failures, or worse, false 
successes. Any one test failure is a failure of the entire test suite. 
   
   The only right answer is to only consider the first failure, and cleanup is 
irrelevant, because all subsequent tests, pass or fail, are invalid.
   
   This means all build pipelines (and people) should be using `go test 
-failfast`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c edited a comment on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
rob05c edited a comment on issue #3096: Traffic Portal dbdump failure shows no 
error message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450472611
 
 
   >Seems like it sends a 403 AND the contents of the dbdump...obviously, it 
shouldn't do that.
   
   This is likely fixed by https://github.com/apache/trafficcontrol/pull/3165.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
rob05c commented on issue #3096: Traffic Portal dbdump failure shows no error 
message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450472611
 
 
   >Seems like it sends a 403 AND the contents of the dbdump...obviously, it 
shouldn't do that.
   This is likely fixed by https://github.com/apache/trafficcontrol/pull/3165.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c edited a comment on issue #3096: Traffic Portal dbdump failure shows no error message

2018-12-28 Thread GitBox
rob05c edited a comment on issue #3096: Traffic Portal dbdump failure shows no 
error message
URL: https://github.com/apache/trafficcontrol/issues/3096#issuecomment-450472611
 
 
   >Seems like it sends a 403 AND the contents of the dbdump...obviously, it 
shouldn't do that.
   
   This may be fixed by https://github.com/apache/trafficcontrol/pull/3165.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3171: Add TO api helper safety to prevent double writes

2018-12-30 Thread GitBox
rob05c opened a new pull request #3171: Add TO api helper safety to prevent 
double writes
URL: https://github.com/apache/trafficcontrol/pull/3171
 
 
    What does this PR do?
   
   Adds a safety to all api helper write funcs, to prevent double writes.
   
   This catches a common programming mistake, of doing `if err != nil { 
HandleErr() }` instead of `if err != nil { HandleErr(); return}`, and `if foo { 
WriteResp(foo) } WriteResp(bar)` instead of `if foo { WriteResp(foo); return } 
WriteResp(bar)`.
   
   If a `return` is missed resulting in a double write, now the api func will 
not write the second time (which is almost always the correct behavior), and 
will log an error.
   
   Includes unit tests, to both verify that a double-write doesn't write twice, 
and to verify single writes do still write correctly.
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [x] 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`
   
    Check all that apply
   
   - [x] 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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3171: Add TO api helper safety to prevent double writes

2018-12-30 Thread GitBox
asfgit commented on issue #3171: Add TO api helper safety to prevent double 
writes
URL: https://github.com/apache/trafficcontrol/pull/3171#issuecomment-450581333
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2996/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3172: Fix TO cdns/dnsseckeys empty response to {}

2018-12-31 Thread GitBox
rob05c opened a new pull request #3172: Fix TO cdns/dnsseckeys empty response 
to {}
URL: https://github.com/apache/trafficcontrol/pull/3172
 
 
   Fixes #3154
   
    What does this PR do?
   
   Fixes #3154
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [x] Traffic Ops
   - [ ] Traffic Ops ORT
   - [ ] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] Other _
   
    What is the best way to verify this PR?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3172: Fix TO cdns/dnsseckeys empty response to {}

2018-12-31 Thread GitBox
asfgit commented on issue #3172: Fix TO cdns/dnsseckeys empty response to {}
URL: https://github.com/apache/trafficcontrol/pull/3172#issuecomment-450672073
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2997/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 commented on issue #3168: Cannot update current user with curl

2018-12-31 Thread GitBox
ocket commented on issue #3168: Cannot update current user with curl
URL: https://github.com/apache/trafficcontrol/issues/3168#issuecomment-450675691
 
 
   Correct, the `/current` endpoint requires embedding, the others do not. For 
unknown reasons.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ezelkow1 edited a comment on issue #3138: CIAB Trafficmonitor shows a lot of "Request Error: ... service still starting, some caches unpolled"

2018-12-31 Thread GitBox
ezelkow1 edited a comment on issue #3138: CIAB Trafficmonitor shows a lot of 
"Request Error: ... service still starting, some caches unpolled"
URL: https://github.com/apache/trafficcontrol/issues/3138#issuecomment-449614575
 
 
   ?To make a snapshot hit the camera looking button at the top right of the UI 
in traffic portal. Then select your CDN-in-a-Box cdn. That will do the snapshot 
to store and start the CDN that the router and monitor depend on
   
   
   From: Dan Kirkwood 
   Sent: Saturday, December 22, 2018 8:45 PM
   To: apache/trafficcontrol
   Cc: Zelkowitz, Evan; Mention
   Subject: Re: [apache/trafficcontrol] CIAB Trafficmonitor shows a lot of 
"Request Error: ... service still starting, some caches unpolled" (#3138)
   
   
   Hi @Shihta .. this is something we are aware of 
and are working at. Please be aware that CIAB is still unstable and is intended 
for demonstration and testing purposes only. We really appreciate reports like 
this -- it'll help us improve its stability..
   
   -
   You are receiving this because you were mentioned.
   Reply to this email directly, view it on 
GitHub,
 or mute the 
thread.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2018-12-31 Thread GitBox
rob05c opened a new pull request #3173: Fix Traffic Ops API Tests to delete on 
t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173
 
 
   Fixes TO API Delete tests to run even if t.Fatal is called, or a
   panic occurs.
   
   It fixes it, by introducing a WithObjs abstraction, which also
   reduces duplication, and is harder to get wrong than forgetting a
   defer call.
   
    What does this PR do?
   
   Fixes #(issue_number)
   
    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?
   
   
    Check all that apply
   
   - [x] 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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2018-12-31 Thread GitBox
asfgit commented on issue #3173: Fix Traffic Ops API Tests to delete on t.Fatal 
or panic
URL: https://github.com/apache/trafficcontrol/pull/3173#issuecomment-450682449
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2998/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3174: Remove TO unnecessary WithCluster

2018-12-31 Thread GitBox
rob05c opened a new pull request #3174: Remove TO unnecessary WithCluster
URL: https://github.com/apache/trafficcontrol/pull/3174
 
 
   Removes the TO WithCluster function. Since the Riak cluster is now
   a shared global variable, and never destructed, the WithCluster
   abstraction serves no purpose, and just makes the code confusing.
   
    What does this PR do?
   
   Fixes #(issue_number)
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [x] Traffic Ops
   - [ ] Traffic Ops ORT
   - [ ] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] Other _
   
    What is the best way to verify this PR?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3174: Remove Traffic Ops unnecessary WithCluster function

2018-12-31 Thread GitBox
asfgit commented on issue #3174: Remove Traffic Ops unnecessary WithCluster 
function
URL: https://github.com/apache/trafficcontrol/pull/3174#issuecomment-450684071
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/2999/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Shihta commented on issue #3160: Add some steps in the CIAB README

2019-01-01 Thread GitBox
Shihta commented on issue #3160: Add some steps in the CIAB README
URL: https://github.com/apache/trafficcontrol/pull/3160#issuecomment-450767948
 
 
   @dangogh sure


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Shihta closed pull request #3160: Add some steps in the CIAB README

2019-01-01 Thread GitBox
Shihta closed pull request #3160: Add some steps in the CIAB README
URL: https://github.com/apache/trafficcontrol/pull/3160
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/source/admin/quick_howto/ciab.rst 
b/docs/source/admin/quick_howto/ciab.rst
index 770e4ff5c..2c14b4885 100644
--- a/docs/source/admin/quick_howto/ciab.rst
+++ b/docs/source/admin/quick_howto/ciab.rst
@@ -77,7 +77,15 @@ In a typical scenario, if the steps in `Building`_ have been 
followed, all that'
 
 .. seealso:: :ref:`tr-api` and :ref:`tm-api`
 
-While the components may be interacted with by the host using these ports, the 
true operation of the CDN can only truly be seen from within the Docker 
network. To see the CDN in action, connect to a container within the CDN in a 
Box project and use cURL to request the URL 
``http://video.demo1.mycdn.ciab.test`` which will be resolved by the DNS 
container to the IP of the Traffic Router, which will provide a ``302 FOUND`` 
response pointing to the Edge-Tier cache. A typical choice for this is the 
"enroller" service, which has a very nuanced purpose not discussed here but 
already has the ``curl`` command line tool installed. For a more user-friendly 
interface into the CDN network, see `VNC Server`_.
+While the components may be interacted with by the host using these ports, the 
true operation of the CDN can only truly be seen from within the Docker network.
+
+Before you go to see the CDN in action, there is an additional action must 
operate on the portal:
+
+1. Visit your Traffic Portal and go to `CDNs / CDN-in-a-Box 
`_
+2. Click on **Diff CDN Config Snapshot**
+3. Click on **Perform Snapshot** after you checked those changes
+
+After that, connect to a container within the CDN in a Box project and use 
cURL to request the URL ``http://video.demo1.mycdn.ciab.test`` which will be 
resolved by the DNS container to the IP of the Traffic Router, which will 
provide a ``302 FOUND`` response pointing to the Edge-Tier cache. A typical 
choice for this is the "enroller" service, which has a very nuanced purpose not 
discussed here but already has the ``curl`` command line tool installed. For a 
more user-friendly interface into the CDN network, see `VNC Server`_.
 
 .. code-block:: shell
:caption: Example Command to See the CDN in Action
diff --git a/infrastructure/cdn-in-a-box/README.md 
b/infrastructure/cdn-in-a-box/README.md
index 7a5be291c..4fc33f75d 100644
--- a/infrastructure/cdn-in-a-box/README.md
+++ b/infrastructure/cdn-in-a-box/README.md
@@ -46,12 +46,21 @@ directories, such that their filenames are as follows:
 * `traffic_ops/traffic_ops.rpm`
 * `traffic_portal/traffic_portal.rpm`
 
-Finally, run the test CDN using the command:
+Run the test CDN using the command:
 
 ```bash
 docker-compose up --build
 ```
 
+Take a CDN config snapshot after your containers are all set:
+
+1. Visit your Traffic Portal and go to 
[`https://trafficportal.infra.ciab.test/#!/cdns/2`](https://trafficportal.infra.ciab.test/#!/cdns/2)
+2. Click on **Diff CDN Config Snapshot**
+3. Click on **Perform Snapshot** after you checked those changes
+
+Your CIAB is ready and you can access the demo site now:
+[`http://video.demo1.mycdn.ciab.test`](http://video.demo1.mycdn.ciab.test)
+
 ## Components
 > The following assumes that the default configuration provided in
 > [`variables.env`](./variables.env) is used.


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3175: WIP Add Delivery Service Snapshots

2019-01-01 Thread GitBox
rob05c opened a new pull request #3175: WIP Add Delivery Service Snapshots
URL: https://github.com/apache/trafficcontrol/pull/3175
 
 
   WIP - Adds Delivery Service Snapshots.
   
   Still WIP, needs work, but I thought I'd make it available for public 
comment.
   
   See 
https://cwiki.apache.org/confluence/display/TC/Traffic+Control++Self+Service+Proposal+for+Change+Integrity
   
   This follows the plan, with one major exception: it creates new "snapshot" 
tables, which are copied into on snapshot. This is because Perl touches many of 
these tables, and the Perl can't be easily fixed.
   
   The idea is, if we want DS snapshots now, we can implement them much sooner, 
without rewriting all of Perl, with these "snapshot" tables. Then, when Perl 
finally goes away, we can simply create a database migration to rename the 
"snapshot" tables.
   
   IMO This shouldn't be merged without 304 Not Modified support, either. 
Because the CRConfig is now generated every time, it takes longer, and the 
Monitors are constantly polling, so this adds time to that poll and work to the 
TO/DB. It's pretty easy to add, IMO there's no legitimate reason to merge this 
without adding that support, to mitigate the cost increase.
   
   *Specifically Includes*
   - database migrations to create the "_snapshot" tables.
   - functions to copy "real" data into snapshot tables
   - a new API endpoint, `deliveryservices/{ds-name}/snapshot`
   - changes CRConfig Snapshot function to just insert the timestamp, and copy 
into snapshot tables
   - changes CRConfig Get Snapshot function to build the CRConfig on-the-fly, 
from the timestamp and snapshot tables
   - changes CRConfig Get Live Snapshot to copy into snapshot tables, and query 
their latest values (reproducing existing live behavior)
   
   *Things That Need To Happen Before This Can Be Merged*
   - [ ] Mailing List Consensus
   - [ ] Fix SQL injection vulnerabilities in `WithCDNSnapshotTimeReal` and 
`UpdateDSDSSSnapshot`
   - [ ] Traffic Portal UI button to Snapshot ("Save") Delivery Service
   - [ ] Change `monitoring.json` to also build on-the-fly from snapshot tables
   - [ ] Parity Testing
   - [ ] Decide how to deal with the next TO upgrade requiring all DSes be 
snapshotted
   - [ ] Update DB migration dates
   - [ ] Add 304 Not Modified Support
   
    What does this PR do?
   
    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?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3175: WIP Add Delivery Service Snapshots

2019-01-01 Thread GitBox
asfgit commented on issue #3175: WIP Add Delivery Service Snapshots
URL: https://github.com/apache/trafficcontrol/pull/3175#issuecomment-450781793
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3000/
   Test FAILed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 closed issue #3154: GET api/1.4/cdns/name/:name/dnsseckeys returns a 200 with no response key

2019-01-01 Thread GitBox
mitchell852 closed issue #3154: GET api/1.4/cdns/name/:name/dnsseckeys returns 
a 200 with no response key
URL: https://github.com/apache/trafficcontrol/issues/3154
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mitchell852 closed pull request #3172: Fix TO cdns/dnsseckeys empty response to {}

2019-01-01 Thread GitBox
mitchell852 closed pull request #3172: Fix TO cdns/dnsseckeys empty response to 
{}
URL: https://github.com/apache/trafficcontrol/pull/3172
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/cdn/dnssec.go 
b/traffic_ops/traffic_ops_golang/cdn/dnssec.go
index 446ef5a7c..52f3ade60 100644
--- a/traffic_ops/traffic_ops_golang/cdn/dnssec.go
+++ b/traffic_ops/traffic_ops_golang/cdn/dnssec.go
@@ -79,7 +79,7 @@ func GetDNSSECKeys(w http.ResponseWriter, r *http.Request) {
}
if !keysExist {
// TODO emulates Perl; change to error, 404?
-   api.WriteRespAlert(w, r, tc.SuccessLevel, " - Dnssec keys for 
"+cdnName+" could not be found. ") // emulates Perl
+   api.WriteRespAlertObj(w, r, tc.SuccessLevel, " - Dnssec keys 
for "+cdnName+" could not be found. ", struct{}{}) // emulates Perl
return
}
 
@@ -113,7 +113,7 @@ func GetDNSSECKeysV11(w http.ResponseWriter, r 
*http.Request) {
}
if !keysExist {
// TODO emulates Perl; change to error, 404?
-   api.WriteRespAlert(w, r, tc.SuccessLevel, " - Dnssec keys for 
"+cdnName+" could not be found. ") // emulates Perl
+   api.WriteRespAlertObj(w, r, tc.SuccessLevel, " - Dnssec keys 
for "+cdnName+" could not be found. ", struct{}{}) // emulates Perl
return
}
api.WriteResp(w, r, riakKeys)


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 opened a new pull request #3176: Fixed old path spec in the egg section of remote pip installation instructions

2019-01-02 Thread GitBox
ocket opened a new pull request #3176: Fixed old path spec in the egg 
section of remote pip installation instructions
URL: https://github.com/apache/trafficcontrol/pull/3176
 
 
   ## What does this PR do?
   The egg path in the Python client README refers to the old directory 
structure, this fixes it to work properly with the new layout.
   
   ## 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
   - [x] Python Client
   
   ## What is the best way to verify this PR?
   Try to copy/paste the installation commands so that it works properly.
   
   ## Check all that apply
   
   - [ ] This PR includes tests
   - [x] 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](http://www.apache.org/security/)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3176: Fixed old path spec in the egg section of remote pip installation instructions

2019-01-02 Thread GitBox
asfgit commented on issue #3176: Fixed old path spec in the egg section of 
remote pip installation instructions
URL: https://github.com/apache/trafficcontrol/pull/3176#issuecomment-450900448
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3001/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on issue #2500: astats providing bad interface data with virtio KVM driver on ATS servers

2019-01-02 Thread GitBox
rawlinp commented on issue #2500: astats providing bad interface data with 
virtio KVM driver on ATS servers
URL: https://github.com/apache/trafficcontrol/issues/2500#issuecomment-450915794
 
 
   I'm leaning towards the profile parameter option just because using a VM 
with the virtio driver should be a very targeted use case. Astats should just 
return the default bandwidth if the link speed cannot be determined or is < 1.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 opened a new pull request #3177: Added warning SQL query for duplicated origins

2019-01-02 Thread GitBox
ocket opened a new pull request #3177: Added warning SQL query for 
duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177
 
 
   ## What does this PR do?
   This adds a check to `admin`'s (and `admin.pl`'s) upgrade, migration and 
status commands for checking for "bad data". That's intended to be expanded on 
an as-needed basis as more bad data configurations are discovered. Currently 
checks for Delivery Services that share origin FQDNs.
   
   The check can also be run on its own by using the 'check' command of `admin` 
(and `admin.pl`).
   
   ## Which TC components are affected by this PR?
   
   - [x] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [x] Traffic Ops
   - [ ] Traffic Ops ORT
   - [ ] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] Other _
   
   ## What is the best way to verify this PR?
   Try to run the `admin` and `admin.pl` "upgrade", "migration", "status" and 
"check"  commands against various environments and verify the new "check" step 
doesn't break anything.
   
   ## Check all that apply
   - [ ] This PR includes tests
   - [x] 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](http://www.apache.org/security/)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3177: Added warning SQL query for duplicated origins

2019-01-02 Thread GitBox
asfgit commented on issue #3177: Added warning SQL query for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#issuecomment-450947593
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3002/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3177: Added warning SQL query for duplicated origins

2019-01-02 Thread GitBox
asfgit commented on issue #3177: Added warning SQL query for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#issuecomment-450950407
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3003/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh closed pull request #3176: Fixed old path spec in the egg section of remote pip installation instructions

2019-01-02 Thread GitBox
dangogh closed pull request #3176: Fixed old path spec in the egg section of 
remote pip installation instructions
URL: https://github.com/apache/trafficcontrol/pull/3176
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_control/clients/python/README.rst 
b/traffic_control/clients/python/README.rst
index e51d10451..ad587024f 100644
--- a/traffic_control/clients/python/README.rst
+++ b/traffic_control/clients/python/README.rst
@@ -14,10 +14,10 @@ The official installation method is to use ``pip`` to 
install directly from from
 .. code-block:: shell
:caption: Install Using 'pip' From GitHub
 
-   pip install 
git+https://github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops";
+   pip install 
git+https://github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python";
 
# or
-   # pip install 
git+ssh://g...@github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops"
+   # pip install 
"git+ssh://g...@github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python"
 
 Local Installation
 --


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jhg03a commented on issue #2500: astats providing bad interface data with virtio KVM driver on ATS servers

2019-01-02 Thread GitBox
jhg03a commented on issue #2500: astats providing bad interface data with 
virtio KVM driver on ATS servers
URL: https://github.com/apache/trafficcontrol/issues/2500#issuecomment-450979401
 
 
   I found a workaround in Openstack by adding an additional piece of metadata 
to the base image for now that'd gotten me unblocked for now, but may not be 
consistent/available in all Openstack implementations.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh opened a new pull request #3178: fix copyright issues

2019-01-03 Thread GitBox
dangogh opened a new pull request #3178: fix copyright issues
URL: https://github.com/apache/trafficcontrol/pull/3178
 
 
    What does this PR do?
   
   Updates copyright range end-year to 2019 in NOTICE (only because it's a 
range).   Removes Comcast copyrights on files where that snuck in of late.
   
    Which TC components are affected by this PR?
   
   - [x] 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?
   
   Verify NOTICE has appropriate copyright year range.   Verify no "Copyright 
Comcast" appears anywhere in source.   Verify RAT and weasel tests pass.
   
    Check all that apply
   
   - [ ] This PR includes tests
   - [ ] This PR includes documentation updates
   - [ ] This PR includes an update to CHANGELOG.md
   - [x] 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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] elsloo closed pull request #3178: fix copyright issues

2019-01-03 Thread GitBox
elsloo closed pull request #3178: fix copyright issues
URL: https://github.com/apache/trafficcontrol/pull/3178
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/NOTICE b/NOTICE
index 15efcb70c..7f1f7b42e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Traffic Control
-Copyright 2016-2018 The Apache Software Foundation
+Copyright 2016-2019 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git a/infrastructure/cdn-in-a-box/ort/setup.py 
b/infrastructure/cdn-in-a-box/ort/setup.py
index 3589889ec..96b513c7d 100755
--- a/infrastructure/cdn-in-a-box/ort/setup.py
+++ b/infrastructure/cdn-in-a-box/ort/setup.py
@@ -1,19 +1,17 @@
 #!/usr/bin/env python3
-
-# Copyright 2018 Comcast Cable Communications Management, LLC
-
+#
 # Licensed 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
-
+#
+# 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.
-
+#
 
 """
 The setuptools-based install script for Traffic Ops ORT
diff --git a/traffic_ops/testing/api/config/config.go 
b/traffic_ops/testing/api/config/config.go
index e5281625e..957cd20be 100644
--- a/traffic_ops/testing/api/config/config.go
+++ b/traffic_ops/testing/api/config/config.go
@@ -1,18 +1,21 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
-
-   Licensed 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.
-*/
+ * 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.
+ */
 
 package config
 
diff --git a/traffic_ops/testing/api/log/log.go 
b/traffic_ops/testing/api/log/log.go
index 649b0dcb6..7e14dccf3 100644
--- a/traffic_ops/testing/api/log/log.go
+++ b/traffic_ops/testing/api/log/log.go
@@ -1,18 +1,21 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
-
-   Licensed 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.
-*/
+ * 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 ex

[GitHub] asfgit commented on issue #3178: fix copyright issues

2019-01-03 Thread GitBox
asfgit commented on issue #3178: fix copyright issues
URL: https://github.com/apache/trafficcontrol/pull/3178#issuecomment-451189668
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3004/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh opened a new pull request #3179: 3.0.x copyright

2019-01-03 Thread GitBox
dangogh opened a new pull request #3179: 3.0.x copyright
URL: https://github.com/apache/trafficcontrol/pull/3179
 
 
    What does this PR do?
   
   Fixes copyright issues where the incorrect header was used in several source 
files.   Also updates the year range in NOTICE.
   
    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?
   
   grep for `Copyright .*Comcast` in all source.  Check date range in NOTICE.
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3179: 3.0.x copyright

2019-01-03 Thread GitBox
asfgit commented on issue #3179: 3.0.x copyright
URL: https://github.com/apache/trafficcontrol/pull/3179#issuecomment-451212021
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3005/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dg4prez closed pull request #3179: 3.0.x copyright

2019-01-03 Thread GitBox
dg4prez closed pull request #3179: 3.0.x copyright
URL: https://github.com/apache/trafficcontrol/pull/3179
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/NOTICE b/NOTICE
index 15efcb70c..7f1f7b42e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Traffic Control
-Copyright 2016-2018 The Apache Software Foundation
+Copyright 2016-2019 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git a/traffic_ops/testing/api/config/config.go 
b/traffic_ops/testing/api/config/config.go
index 5154edd31..5cea25206 100644
--- a/traffic_ops/testing/api/config/config.go
+++ b/traffic_ops/testing/api/config/config.go
@@ -1,18 +1,21 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
-
-   Licensed 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.
-*/
+ * 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.
+ */
 
 package config
 
diff --git a/traffic_ops/testing/api/log/log.go 
b/traffic_ops/testing/api/log/log.go
index 649b0dcb6..7e14dccf3 100644
--- a/traffic_ops/testing/api/log/log.go
+++ b/traffic_ops/testing/api/log/log.go
@@ -1,18 +1,21 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
-
-   Licensed 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.
-*/
+ * 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.
+ */
 
 package log
 
@@ -51,4 +54,3 @@ func Success(t *testing.T, msg string, args ...interface{}) {
m := fmt.Sprintf(msg, args...)
t.Log(fmt.Sprintf("\t %-80s", m), Succeed)
 }
-
diff --git a/traffic_ops/testing/api/test/http.go 
b/traffic_ops/testing/api/test/http.go
index d74a56ccb..a5af63df6 100644
--- a/traffic_ops/testing/api/test/http.go
+++ b/traffic_ops/testing/api/test/http.go
@@ -1,18 +1,21 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
-
-   Licensed 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 WARRANTIE

[GitHub] rob05c opened a new pull request #3180: Fix CiaB to not use req host hdr in CRConfig

2019-01-03 Thread GitBox
rob05c opened a new pull request #3180: Fix CiaB to not use req host hdr in 
CRConfig
URL: https://github.com/apache/trafficcontrol/pull/3180
 
 
   Specifically fixes the TO API tests to pass, when run against
   the CiaB.
   
    What does this PR do?
   
   Fixes #(issue_number)
   
    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?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh closed pull request #3180: Fix CiaB to not use req host hdr in CRConfig

2019-01-03 Thread GitBox
dangogh closed pull request #3180: Fix CiaB to not use req host hdr in CRConfig
URL: https://github.com/apache/trafficcontrol/pull/3180
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/infrastructure/cdn-in-a-box/traffic_ops/config.sh 
b/infrastructure/cdn-in-a-box/traffic_ops/config.sh
index a653d09f7..b310d0111 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/config.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/config.sh
@@ -90,8 +90,7 @@ cat <<-EOF >/opt/traffic_ops/app/conf/cdn.conf
 "max_db_connections": 20,
 "backend_max_connections": {
 "mojolicious": 4
-},
-"crconfig_snapshot_use_client_request_host": true
+}
 },
 "cors" : {
 "access_control_allow_origin" : "*"


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] JBevillC opened a new issue #3181: TO API - DeliveryServices AddSSLKeys Incorrectly stores X509 certificate missing Subject/Authority Key as zero length string.

2019-01-03 Thread GitBox
JBevillC opened a new issue #3181: TO API - DeliveryServices AddSSLKeys 
Incorrectly stores X509 certificate missing Subject/Authority Key as zero 
length string.
URL: https://github.com/apache/trafficcontrol/issues/3181
 
 
   _Method_: POST
   _Endpoint_: api/1.4/deliveryservices/sslkeys/add
   _Description:_ Importing X509 SSL certificate and corresponding 
intermediate/root X509 certificates that do not contain X509v3 Subject Key 
Identifier (SKI) and corresponding Authority Key Identifier (AKI) results in 
the certificate being stored in Traffic Vault as a zero length string.  
Further, all intermediate CA certificates that follow are ignored for X509 
certificate validation. Additionally,  the RSA key and certificate-request 
(csr) do get stored correctly in traffic vault, but the certificate ('crt' 
field in json) is a zero length string. The response code for this import 
operation is incorrectly sent back to the client as a 200 indicating a 
successful import.
   
   _Impact_: Traffic Router Languid SSL connector is impacted (partially and 
fully) upon receiving incomplete/invalid SSL Key/Certificate data from Traffic 
Ops SSLKeysAPIs.  This presents a problem in that the incomplete/invalid SSL 
key/cert pair causes TrafficRouter to throw an exception related to an invalid 
X509 certificate.  After exception has occurred, any new TLS handshake attempts 
hang and eventually timeout, thus a HTTPS services have been partially or fully 
impacted.
   
   _Possible Solution_:
   All X509 certificates that do not contain Subject/Authority Key Identifier 
X509v3 should be rejected with proper 4XX HTTP code and corresponding JSON 
error description.  Traffic Router should also be updated to handle invalid 
certificate data received from Traffic Ops without partial/full impact to SSL 
Languid connector.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] JBevillC commented on issue #3181: TO API - DeliveryServices AddSSLKeys Incorrectly stores X509 certificate missing Subject/Authority Key as zero length string.

2019-01-03 Thread GitBox
JBevillC commented on issue #3181: TO API - DeliveryServices AddSSLKeys 
Incorrectly stores X509 certificate missing Subject/Authority Key as zero 
length string.
URL: https://github.com/apache/trafficcontrol/issues/3181#issuecomment-451286364
 
 
   From trafficops_golang/deliveryservices/keys.go: 
https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/deliveryservice/keys.go#L328-L335
   pemEncodedChain remains as a zero length string if all certificates 
submitted for import are  missing the Subjective/Authority Key Indicator X509v3 
metadata.:
   ```
pemEncodedChain := ""
for _, link := range chain[0] {
// Only print non-self signed elements of the chain
if link.AuthorityKeyId != nil && 
!bytes.Equal(link.AuthorityKeyId, link.SubjectKeyId) {
block := &pem.Block{Type: "CERTIFICATE", Bytes: 
link.Raw}
pemEncodedChain += string(pem.EncodeToMemory(block))
}
}
   ```
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2019-01-03 Thread GitBox
dangogh commented on a change in pull request #3173: Fix Traffic Ops API Tests 
to delete on t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173#discussion_r245142949
 
 

 ##
 File path: traffic_ops/testing/api/v14/withobjs.go
 ##
 @@ -0,0 +1,93 @@
+/*
+
+   Licensed 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.
+*/
+
+package v14
+
+import (
+   "testing"
+)
+
+// WithObjs creates the objs in order, runs f, and defers deleting the objs in 
the same order.
+//
+// Because deletion is deferred, using this ensures objects will be cleaned up 
if f panics or calls t.Fatal, as much as possible.
+//
+// Note that f itself may still create things which are not cleaned up 
properly, and likewise, the object creation and deletion tests themselves may 
fail.
+// All tests in the Traffic Ops API Testing framework use the same Traffic Ops 
instance, with persistent data. Because of this, when any test fails, all 
subsequent tests should be considered invalid, irrespective whether they pass 
or fail. Users are encouraged to use `go test -failfast`.
+func WithObjs(t *testing.T, objs []TCObj, f func()) {
+   for _, obj := range objs {
+   defer withFuncs[obj].Delete(t)
+   withFuncs[obj].Create(t)
+   }
+   f()
+}
+
+type TCObj int
+
+const (
+   CacheGroups TCObj = iota
+   CDNs
+   CDNFederations
+   Coordinates
+   DeliveryServices
+   DeliveryServiceRequests
+   DeliveryServiceRequestComments
+   Divisions
+   Origins
+   Parameters
+   PhysLocations
+   Profiles
+   ProfileParameters
+   Regions
+   Roles
+   Servers
+   Statuses
+   StaticDNSEntries
+   SteeringTargets
+   Tenants
+   Types
+   Users
+   UsersDeliveryServices
+)
+
+type TCObjFuncs struct {
+   Create func(t *testing.T)
+   Delete func(t *testing.T)
+}
+
+var withFuncs = map[TCObj]TCObjFuncs{
+   CacheGroups:{CreateTestCacheGroups, 
DeleteTestCacheGroups},
+   CDNs:   {CreateTestCDNs, DeleteTestCDNs},
+   CDNFederations: {CreateTestCDNFederations, 
DeleteTestCDNFederations},
+   Coordinates:{CreateTestCoordinates, 
DeleteTestCoordinates},
+   DeliveryServices:   {CreateTestDeliveryServices, 
DeleteTestDeliveryServices},
+   DeliveryServiceRequests:{CreateTestDeliveryServiceRequests, 
DeleteTestDeliveryServiceRequests},
+   DeliveryServiceRequestComments: 
{CreateTestDeliveryServiceRequestComments, 
DeleteTestDeliveryServiceRequestComments},
+   Divisions:  {CreateTestDivisions, 
DeleteTestDivisions},
+   Origins:{CreateTestOrigins, DeleteTestOrigins},
+   Parameters: {CreateTestParameters, 
DeleteTestParameters},
+   PhysLocations:  {CreateTestPhysLocations, 
DeleteTestPhysLocations},
+   Profiles:   {CreateTestProfiles, 
DeleteTestProfiles},
+   ProfileParameters:  {CreateTestProfileParameters, 
DeleteTestProfileParameters},
+   Regions:{CreateTestRegions, DeleteTestRegions},
+   Roles:  {CreateTestRoles, DeleteTestRoles},
+   Servers:{CreateTestServers, DeleteTestServers},
+   Statuses:   {CreateTestStatuses, 
DeleteTestStatuses},
+   StaticDNSEntries:   {CreateTestStaticDNSEntries, 
DeleteTestStaticDNSEntries},
+   SteeringTargets:{CreateTestSteeringTargets, 
DeleteTestSteeringTargets},
+   Tenants:{CreateTestTenants, DeleteTestTenants},
+   Types:  {CreateTestTypes, DeleteTestTypes},
+   Users:  {CreateTestUsers, ForceDeleteTestUsers},
+   UsersDeliveryServices: {CreateTestUsersDeliveryServices, 
DeleteTestUsersDeliveryServices},
 
 Review comment:
   minor nit -- indentation that `go fmt` would fix..


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2019-01-03 Thread GitBox
rob05c commented on a change in pull request #3173: Fix Traffic Ops API Tests 
to delete on t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173#discussion_r245144120
 
 

 ##
 File path: traffic_ops/testing/api/v14/withobjs.go
 ##
 @@ -0,0 +1,93 @@
+/*
+
+   Licensed 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.
+*/
+
+package v14
+
+import (
+   "testing"
+)
+
+// WithObjs creates the objs in order, runs f, and defers deleting the objs in 
the same order.
+//
+// Because deletion is deferred, using this ensures objects will be cleaned up 
if f panics or calls t.Fatal, as much as possible.
+//
+// Note that f itself may still create things which are not cleaned up 
properly, and likewise, the object creation and deletion tests themselves may 
fail.
+// All tests in the Traffic Ops API Testing framework use the same Traffic Ops 
instance, with persistent data. Because of this, when any test fails, all 
subsequent tests should be considered invalid, irrespective whether they pass 
or fail. Users are encouraged to use `go test -failfast`.
+func WithObjs(t *testing.T, objs []TCObj, f func()) {
+   for _, obj := range objs {
+   defer withFuncs[obj].Delete(t)
+   withFuncs[obj].Create(t)
+   }
+   f()
+}
+
+type TCObj int
+
+const (
+   CacheGroups TCObj = iota
+   CDNs
+   CDNFederations
+   Coordinates
+   DeliveryServices
+   DeliveryServiceRequests
+   DeliveryServiceRequestComments
+   Divisions
+   Origins
+   Parameters
+   PhysLocations
+   Profiles
+   ProfileParameters
+   Regions
+   Roles
+   Servers
+   Statuses
+   StaticDNSEntries
+   SteeringTargets
+   Tenants
+   Types
+   Users
+   UsersDeliveryServices
+)
+
+type TCObjFuncs struct {
+   Create func(t *testing.T)
+   Delete func(t *testing.T)
+}
+
+var withFuncs = map[TCObj]TCObjFuncs{
+   CacheGroups:{CreateTestCacheGroups, 
DeleteTestCacheGroups},
+   CDNs:   {CreateTestCDNs, DeleteTestCDNs},
+   CDNFederations: {CreateTestCDNFederations, 
DeleteTestCDNFederations},
+   Coordinates:{CreateTestCoordinates, 
DeleteTestCoordinates},
+   DeliveryServices:   {CreateTestDeliveryServices, 
DeleteTestDeliveryServices},
+   DeliveryServiceRequests:{CreateTestDeliveryServiceRequests, 
DeleteTestDeliveryServiceRequests},
+   DeliveryServiceRequestComments: 
{CreateTestDeliveryServiceRequestComments, 
DeleteTestDeliveryServiceRequestComments},
+   Divisions:  {CreateTestDivisions, 
DeleteTestDivisions},
+   Origins:{CreateTestOrigins, DeleteTestOrigins},
+   Parameters: {CreateTestParameters, 
DeleteTestParameters},
+   PhysLocations:  {CreateTestPhysLocations, 
DeleteTestPhysLocations},
+   Profiles:   {CreateTestProfiles, 
DeleteTestProfiles},
+   ProfileParameters:  {CreateTestProfileParameters, 
DeleteTestProfileParameters},
+   Regions:{CreateTestRegions, DeleteTestRegions},
+   Roles:  {CreateTestRoles, DeleteTestRoles},
+   Servers:{CreateTestServers, DeleteTestServers},
+   Statuses:   {CreateTestStatuses, 
DeleteTestStatuses},
+   StaticDNSEntries:   {CreateTestStaticDNSEntries, 
DeleteTestStaticDNSEntries},
+   SteeringTargets:{CreateTestSteeringTargets, 
DeleteTestSteeringTargets},
+   Tenants:{CreateTestTenants, DeleteTestTenants},
+   Types:  {CreateTestTypes, DeleteTestTypes},
+   Users:  {CreateTestUsers, ForceDeleteTestUsers},
+   UsersDeliveryServices: {CreateTestUsersDeliveryServices, 
DeleteTestUsersDeliveryServices},
 
 Review comment:
   `gofmt` did that, looks like a quirk/bug of `gofmt`


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on issue #3181: TO API - DeliveryServices AddSSLKeys Incorrectly stores X509 certificate missing Subject/Authority Key as zero length string.

2019-01-03 Thread GitBox
rawlinp commented on issue #3181: TO API - DeliveryServices AddSSLKeys 
Incorrectly stores X509 certificate missing Subject/Authority Key as zero 
length string.
URL: https://github.com/apache/trafficcontrol/issues/3181#issuecomment-451305169
 
 
   I'd think if there were self-signed elements in the chain, it wouldn't pass 
the previous check which calls 
https://golang.org/pkg/crypto/x509/#Certificate.Verify and causes TO to accept 
a self-signed cert with a warning. So maybe the ```if link.AuthorityKeyId != 
nil && !bytes.Equal(link.AuthorityKeyId, link.SubjectKeyId) {``` line is 
unnecessary, and it should just append all the links to `pemEncodedChain` 
regardless of the SKI and AKI? I'd think the `Verify` method would check if SKI 
and AKI don't properly match up through the chain.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh commented on a change in pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2019-01-03 Thread GitBox
dangogh commented on a change in pull request #3173: Fix Traffic Ops API Tests 
to delete on t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173#discussion_r245161953
 
 

 ##
 File path: traffic_ops/testing/api/v14/withobjs.go
 ##
 @@ -0,0 +1,93 @@
+/*
+
+   Licensed 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.
+*/
+
+package v14
+
+import (
+   "testing"
+)
+
+// WithObjs creates the objs in order, runs f, and defers deleting the objs in 
the same order.
+//
+// Because deletion is deferred, using this ensures objects will be cleaned up 
if f panics or calls t.Fatal, as much as possible.
+//
+// Note that f itself may still create things which are not cleaned up 
properly, and likewise, the object creation and deletion tests themselves may 
fail.
+// All tests in the Traffic Ops API Testing framework use the same Traffic Ops 
instance, with persistent data. Because of this, when any test fails, all 
subsequent tests should be considered invalid, irrespective whether they pass 
or fail. Users are encouraged to use `go test -failfast`.
+func WithObjs(t *testing.T, objs []TCObj, f func()) {
+   for _, obj := range objs {
+   defer withFuncs[obj].Delete(t)
+   withFuncs[obj].Create(t)
+   }
+   f()
+}
+
+type TCObj int
+
+const (
+   CacheGroups TCObj = iota
+   CDNs
+   CDNFederations
+   Coordinates
+   DeliveryServices
+   DeliveryServiceRequests
+   DeliveryServiceRequestComments
+   Divisions
+   Origins
+   Parameters
+   PhysLocations
+   Profiles
+   ProfileParameters
+   Regions
+   Roles
+   Servers
+   Statuses
+   StaticDNSEntries
+   SteeringTargets
+   Tenants
+   Types
+   Users
+   UsersDeliveryServices
+)
+
+type TCObjFuncs struct {
+   Create func(t *testing.T)
+   Delete func(t *testing.T)
+}
+
+var withFuncs = map[TCObj]TCObjFuncs{
+   CacheGroups:{CreateTestCacheGroups, 
DeleteTestCacheGroups},
+   CDNs:   {CreateTestCDNs, DeleteTestCDNs},
+   CDNFederations: {CreateTestCDNFederations, 
DeleteTestCDNFederations},
+   Coordinates:{CreateTestCoordinates, 
DeleteTestCoordinates},
+   DeliveryServices:   {CreateTestDeliveryServices, 
DeleteTestDeliveryServices},
+   DeliveryServiceRequests:{CreateTestDeliveryServiceRequests, 
DeleteTestDeliveryServiceRequests},
+   DeliveryServiceRequestComments: 
{CreateTestDeliveryServiceRequestComments, 
DeleteTestDeliveryServiceRequestComments},
+   Divisions:  {CreateTestDivisions, 
DeleteTestDivisions},
+   Origins:{CreateTestOrigins, DeleteTestOrigins},
+   Parameters: {CreateTestParameters, 
DeleteTestParameters},
+   PhysLocations:  {CreateTestPhysLocations, 
DeleteTestPhysLocations},
+   Profiles:   {CreateTestProfiles, 
DeleteTestProfiles},
+   ProfileParameters:  {CreateTestProfileParameters, 
DeleteTestProfileParameters},
+   Regions:{CreateTestRegions, DeleteTestRegions},
+   Roles:  {CreateTestRoles, DeleteTestRoles},
+   Servers:{CreateTestServers, DeleteTestServers},
+   Statuses:   {CreateTestStatuses, 
DeleteTestStatuses},
+   StaticDNSEntries:   {CreateTestStaticDNSEntries, 
DeleteTestStaticDNSEntries},
+   SteeringTargets:{CreateTestSteeringTargets, 
DeleteTestSteeringTargets},
+   Tenants:{CreateTestTenants, DeleteTestTenants},
+   Types:  {CreateTestTypes, DeleteTestTypes},
+   Users:  {CreateTestUsers, ForceDeleteTestUsers},
+   UsersDeliveryServices: {CreateTestUsersDeliveryServices, 
DeleteTestUsersDeliveryServices},
 
 Review comment:
   hmm..   fixed it for me running go 1.11.1


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-03 Thread GitBox
rawlinp commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245163251
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   Since this script is deprecated I don't think we should be adding new 
functionality to it. I think the new functionality should only be added to 
admin.go unless there is a very good reason it also needs to be in admin.pl. If 
there is a very good reason for it, then admin.pl should just shell out to the 
admin binary so that the checks aren't duplicated.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2019-01-03 Thread GitBox
rob05c commented on a change in pull request #3173: Fix Traffic Ops API Tests 
to delete on t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173#discussion_r245165527
 
 

 ##
 File path: traffic_ops/testing/api/v14/withobjs.go
 ##
 @@ -0,0 +1,93 @@
+/*
+
+   Licensed 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.
+*/
+
+package v14
+
+import (
+   "testing"
+)
+
+// WithObjs creates the objs in order, runs f, and defers deleting the objs in 
the same order.
+//
+// Because deletion is deferred, using this ensures objects will be cleaned up 
if f panics or calls t.Fatal, as much as possible.
+//
+// Note that f itself may still create things which are not cleaned up 
properly, and likewise, the object creation and deletion tests themselves may 
fail.
+// All tests in the Traffic Ops API Testing framework use the same Traffic Ops 
instance, with persistent data. Because of this, when any test fails, all 
subsequent tests should be considered invalid, irrespective whether they pass 
or fail. Users are encouraged to use `go test -failfast`.
+func WithObjs(t *testing.T, objs []TCObj, f func()) {
+   for _, obj := range objs {
+   defer withFuncs[obj].Delete(t)
+   withFuncs[obj].Create(t)
+   }
+   f()
+}
+
+type TCObj int
+
+const (
+   CacheGroups TCObj = iota
+   CDNs
+   CDNFederations
+   Coordinates
+   DeliveryServices
+   DeliveryServiceRequests
+   DeliveryServiceRequestComments
+   Divisions
+   Origins
+   Parameters
+   PhysLocations
+   Profiles
+   ProfileParameters
+   Regions
+   Roles
+   Servers
+   Statuses
+   StaticDNSEntries
+   SteeringTargets
+   Tenants
+   Types
+   Users
+   UsersDeliveryServices
+)
+
+type TCObjFuncs struct {
+   Create func(t *testing.T)
+   Delete func(t *testing.T)
+}
+
+var withFuncs = map[TCObj]TCObjFuncs{
+   CacheGroups:{CreateTestCacheGroups, 
DeleteTestCacheGroups},
+   CDNs:   {CreateTestCDNs, DeleteTestCDNs},
+   CDNFederations: {CreateTestCDNFederations, 
DeleteTestCDNFederations},
+   Coordinates:{CreateTestCoordinates, 
DeleteTestCoordinates},
+   DeliveryServices:   {CreateTestDeliveryServices, 
DeleteTestDeliveryServices},
+   DeliveryServiceRequests:{CreateTestDeliveryServiceRequests, 
DeleteTestDeliveryServiceRequests},
+   DeliveryServiceRequestComments: 
{CreateTestDeliveryServiceRequestComments, 
DeleteTestDeliveryServiceRequestComments},
+   Divisions:  {CreateTestDivisions, 
DeleteTestDivisions},
+   Origins:{CreateTestOrigins, DeleteTestOrigins},
+   Parameters: {CreateTestParameters, 
DeleteTestParameters},
+   PhysLocations:  {CreateTestPhysLocations, 
DeleteTestPhysLocations},
+   Profiles:   {CreateTestProfiles, 
DeleteTestProfiles},
+   ProfileParameters:  {CreateTestProfileParameters, 
DeleteTestProfileParameters},
+   Regions:{CreateTestRegions, DeleteTestRegions},
+   Roles:  {CreateTestRoles, DeleteTestRoles},
+   Servers:{CreateTestServers, DeleteTestServers},
+   Statuses:   {CreateTestStatuses, 
DeleteTestStatuses},
+   StaticDNSEntries:   {CreateTestStaticDNSEntries, 
DeleteTestStaticDNSEntries},
+   SteeringTargets:{CreateTestSteeringTargets, 
DeleteTestSteeringTargets},
+   Tenants:{CreateTestTenants, DeleteTestTenants},
+   Types:  {CreateTestTypes, DeleteTestTypes},
+   Users:  {CreateTestUsers, ForceDeleteTestUsers},
+   UsersDeliveryServices: {CreateTestUsersDeliveryServices, 
DeleteTestUsersDeliveryServices},
 
 Review comment:
   I'll try upgrading


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dangogh opened a new pull request #3182: 3.0.x portal build

2019-01-03 Thread GitBox
dangogh opened a new pull request #3182: 3.0.x portal build
URL: https://github.com/apache/trafficcontrol/pull/3182
 
 
    What does this PR do?
   
   Fixes traffic_portal build issues in addition to updating ca-certificates in 
all builds.  These had been fixed in master recently.
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [ ] Traffic Monitor
   - [ ] Traffic Ops
   - [ ] Traffic Ops ORT
   - [x] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] Other _
   
    What is the best way to verify this PR?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3182: 3.0.x portal build

2019-01-03 Thread GitBox
asfgit commented on issue #3182: 3.0.x portal build
URL: https://github.com/apache/trafficcontrol/pull/3182#issuecomment-451318587
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3006/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dg4prez closed pull request #3182: 3.0.x portal build

2019-01-04 Thread GitBox
dg4prez closed pull request #3182: 3.0.x portal build
URL: https://github.com/apache/trafficcontrol/pull/3182
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/infrastructure/docker/build/Dockerfile-docs 
b/infrastructure/docker/build/Dockerfile-docs
index 58f818fff..0728f430c 100644
--- a/infrastructure/docker/build/Dockerfile-docs
+++ b/infrastructure/docker/build/Dockerfile-docs
@@ -23,7 +23,9 @@ MAINTAINER Jonathan Gray
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
epel-release \
git \
rpm-build && \
diff --git a/infrastructure/docker/build/Dockerfile-grove 
b/infrastructure/docker/build/Dockerfile-grove
index 818a6552e..e29626107 100644
--- a/infrastructure/docker/build/Dockerfile-grove
+++ b/infrastructure/docker/build/Dockerfile-grove
@@ -23,7 +23,9 @@ MAINTAINER Chris Lemmons
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
epel-release && \
yum -y clean all
 RUNyum -y install \
diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg 
b/infrastructure/docker/build/Dockerfile-grovetccfg
index 3ff98ed3e..837214642 100644
--- a/infrastructure/docker/build/Dockerfile-grovetccfg
+++ b/infrastructure/docker/build/Dockerfile-grovetccfg
@@ -23,7 +23,9 @@ MAINTAINER John Rushford
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNyum -y update ca-certificates &&\
+ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y install \
epel-release && \
yum -y clean all
 RUNyum -y install \
diff --git a/infrastructure/docker/build/Dockerfile-source 
b/infrastructure/docker/build/Dockerfile-source
index 5eb2c89f7..68915096e 100644
--- a/infrastructure/docker/build/Dockerfile-source
+++ b/infrastructure/docker/build/Dockerfile-source
@@ -23,7 +23,9 @@ MAINTAINER Dan Kirkwood
 # docker run --volume /trafficcontrol:$(pwd) ...
 VOLUME /trafficcontrol
 
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
git && \
yum -y clean all
 
diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor 
b/infrastructure/docker/build/Dockerfile-traffic_monitor
index d63639162..1e92265c2 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_monitor
+++ b/infrastructure/docker/build/Dockerfile-traffic_monitor
@@ -23,7 +23,9 @@ MAINTAINER Dan Kirkwood
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
epel-release \
git \
rpm-build && \
diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops 
b/infrastructure/docker/build/Dockerfile-traffic_ops
index ac5cb7251..8c84e176b 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_ops
+++ b/infrastructure/docker/build/Dockerfile-traffic_ops
@@ -23,7 +23,9 @@ MAINTAINER Dan Kirkwood
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
epel-release \
git \
rpm-build && \
diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal 
b/infrastructure/docker/build/Dockerfile-traffic_portal
index 19e35f9bf..1380ca8a8 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_portal
+++ b/infrastructure/docker/build/Dockerfile-traffic_portal
@@ -16,22 +16,23 @@
 # under the License.
 FROM centos:7
 
-MAINTAINER Dan Kirkwood
+MAINTAINER d...@trafficcontrol.apache.org
 
 # top level of trafficcontrol directory must be mounted as a volume:
 # docker run --volume /trafficcontrol:$(pwd) ...
 VOLUME /trafficcontrol
 
 ### Common for all sub-component builds
-RUNyum -y install \
+RUNrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
+   yum -y update ca-certificates && \
+   yum -y install \
epel-release \
git \
rpm-build && \
yum -y clean all
 
 # traffic_portal specific
-RUNrpm -ivh 
https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.

[GitHub] dangogh closed pull request #3173: Fix Traffic Ops API Tests to delete on t.Fatal or panic

2019-01-04 Thread GitBox
dangogh closed pull request #3173: Fix Traffic Ops API Tests to delete on 
t.Fatal or panic
URL: https://github.com/apache/trafficcontrol/pull/3173
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/testing/api/v14/cachegroups_test.go 
b/traffic_ops/testing/api/v14/cachegroups_test.go
index 8a300bb38..626d3529e 100644
--- a/traffic_ops/testing/api/v14/cachegroups_test.go
+++ b/traffic_ops/testing/api/v14/cachegroups_test.go
@@ -25,13 +25,11 @@ import (
 )
 
 func TestCacheGroups(t *testing.T) {
-   CreateTestTypes(t)
-   CreateTestCacheGroups(t)
-   GetTestCacheGroups(t)
-   CheckCacheGroupsAuthentication(t)
-   UpdateTestCacheGroups(t)
-   DeleteTestCacheGroups(t)
-   DeleteTestTypes(t)
+   WithObjs(t, []TCObj{Types, CacheGroups}, func() {
+   GetTestCacheGroups(t)
+   CheckCacheGroupsAuthentication(t)
+   UpdateTestCacheGroups(t)
+   })
 }
 
 func CreateTestCacheGroups(t *testing.T) {
diff --git a/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go 
b/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
index 4fdc570c9..dd91730f6 100644
--- a/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
+++ b/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
@@ -21,32 +21,10 @@ import (
 )
 
 func TestDeliveryServicesCachegroups(t *testing.T) {
-   CreateTestCDNs(t)
-   CreateTestTypes(t)
-   CreateTestTenants(t)
-   CreateTestProfiles(t)
-   CreateTestStatuses(t)
-   CreateTestDivisions(t)
-   CreateTestRegions(t)
-   CreateTestPhysLocations(t)
-   CreateTestCacheGroups(t)
-   CreateTestServers(t)
-   CreateTestDeliveryServices(t)
-
-   CreateTestCachegroupsDeliveryServices(t)
-   DeleteTestCachegroupsDeliveryServices(t)
-
-   DeleteTestDeliveryServices(t)
-   DeleteTestServers(t)
-   DeleteTestCacheGroups(t)
-   DeleteTestPhysLocations(t)
-   DeleteTestRegions(t)
-   DeleteTestDivisions(t)
-   DeleteTestStatuses(t)
-   DeleteTestProfiles(t)
-   DeleteTestTenants(t)
-   DeleteTestTypes(t)
-   DeleteTestCDNs(t)
+   WithObjs(t, []TCObj{CDNs, Types, Tenants, Profiles, Statuses, 
Divisions, Regions, PhysLocations, CacheGroups, Servers, DeliveryServices}, 
func() {
+   CreateTestCachegroupsDeliveryServices(t)
+   DeleteTestCachegroupsDeliveryServices(t)
+   })
 }
 
 const TestEdgeServerCacheGroupName = "cachegroup1" // TODO this is the name 
hard-coded in the create servers test; change to be dynamic
diff --git a/traffic_ops/testing/api/v14/cdn_domains_test.go 
b/traffic_ops/testing/api/v14/cdn_domains_test.go
index adae5c96f..6206c1fb4 100644
--- a/traffic_ops/testing/api/v14/cdn_domains_test.go
+++ b/traffic_ops/testing/api/v14/cdn_domains_test.go
@@ -30,13 +30,7 @@ func GetTestDomains(t *testing.T) {
 }
 
 func TestDomains(t *testing.T) {
-   CreateTestCDNs(t)
-   CreateTestTypes(t)
-   CreateTestProfiles(t)
-   CreateTestStatuses(t)
-   GetTestDomains(t)
-   DeleteTestStatuses(t)
-   DeleteTestProfiles(t)
-   DeleteTestTypes(t)
-   DeleteTestCDNs(t)
+   WithObjs(t, []TCObj{CDNs, Types, Profiles, Statuses}, func() {
+   GetTestDomains(t)
+   })
 }
diff --git a/traffic_ops/testing/api/v14/cdnfederations_test.go 
b/traffic_ops/testing/api/v14/cdnfederations_test.go
index a326fad8d..11718bdc9 100644
--- a/traffic_ops/testing/api/v14/cdnfederations_test.go
+++ b/traffic_ops/testing/api/v14/cdnfederations_test.go
@@ -25,18 +25,10 @@ import (
 var fedIDs []int
 
 func TestCDNFederations(t *testing.T) {
-   CreateTestCDNs(t)
-   CreateTestTypes(t)
-   CreateTestTenants(t)
-   CreateTestDeliveryServices(t)
-   CreateTestCDNFederations(t)
-   UpdateTestCDNFederations(t)
-   GetTestCDNFederations(t)
-   DeleteTestCDNFederations(t)
-   DeleteTestDeliveryServices(t)
-   DeleteTestTenants(t)
-   DeleteTestTypes(t)
-   DeleteTestCDNs(t)
+   WithObjs(t, []TCObj{CDNs, Types, Tenants, DeliveryServices, 
CDNFederations}, func() {
+   UpdateTestCDNFederations(t)
+   GetTestCDNFederations(t)
+   })
 }
 
 func CreateTestCDNFederations(t *testing.T) {
diff --git a/traffic_ops/testing/api/v14/cdns_test.go 
b/traffic_ops/testing/api/v14/cdns_test.go
index ffab6c715..8271deb22 100644
--- a/traffic_ops/testing/api/v14/cdns_test.go
+++ b/traffic_ops/testing/api/v14/cdns_test.go
@@ -23,12 +23,10 @@ import (
 )
 
 func TestCDNs(t *testing.T) {
-
-   CreateTestCDNs(t)
-   UpdateTestCDNs(t)
-   GetTestCDNs(t)
-   DeleteTestCDNs(t)
-
+   WithObjs(t, []TCObj{CDNs}, func() {
+   UpdateTestCDNs

[GitHub] ocket8888 commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
ocket commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245365736
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   The only reason is stubbornness. People will continue to use the Perl script 
until it's actually removed, totally ignoring the deprecation warning. They 
still need to be served a deprecation notice for their database state or 
they'll be taken by surprise when a non-backwards-compatible upgrade fails.
   I didn't think of just calling the binary, though - that's a good idea.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
asfgit commented on issue #3177: Added warning SQL query for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#issuecomment-451515932
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3007/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
rawlinp commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245378793
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   If we want to take this even further I was just thinking of having the 
admin.pl script shell out all of its individual commands to the binary. So the 
admin.pl script would just be a tiny perl script that basically only does 
something like this:
   ```
   my $new_admin = dirname(__FILE__) + "/admin";
   shift @ARGV;
   my $args = join " ", @ARGV;
   system("$new_admin $args");
   ```
   We could probably even just convert it into a bash script still named 
admin.pl, but I'd be concerned about the possible confusion with that.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
asfgit commented on issue #3177: Added warning SQL query for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#issuecomment-451526571
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3008/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
rob05c commented on a change in pull request #3177: Added warning SQL query for 
duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245385316
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   > having the admin.pl script shell out all of its individual commands to the 
binary
   
   +1
   
   >We could probably even just convert it into a bash script still named 
admin.pl
   
   -1. Perl is required by the Linux Standard Base (LSB), so there's not really 
any downside of a basic Perl script that doesn't require any dependencies or 
external modules (i.e. the absurd install time of TO/CPAN).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
ocket commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245394893
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   Took me a few tries, but I think I got it right now.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
ocket commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245397998
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   I agree, no reason to cause such confusion.
   I like the idea of using the binary for everything, but I don't think it 
belongs in the same commit as added functionality.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
rawlinp commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245413648
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   > I like the idea of using the binary for everything, but I don't think it 
belongs in the same commit as added functionality.
   +1, would be better to review and merge the PR that makes admin.pl shell 
everything out to the binary first. Then the new functionality can just be 
reviewed in admin.go.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on a change in pull request #3177: Added warning SQL query for duplicated origins

2019-01-04 Thread GitBox
rawlinp commented on a change in pull request #3177: Added warning SQL query 
for duplicated origins
URL: https://github.com/apache/trafficcontrol/pull/3177#discussion_r245413648
 
 

 ##
 File path: traffic_ops/app/db/admin.pl
 ##
 @@ -64,7 +64,7 @@
. "dropdb  - Execute db 'dropdb' on the database for the current 
environment.\n"
 
 Review comment:
   > I like the idea of using the binary for everything, but I don't think it 
belongs in the same commit as added functionality.
   
   +1, would be better to review and merge the PR that makes admin.pl shell 
everything out to the binary first. Then the new functionality can just be 
reviewed in admin.go.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jindov opened a new issue #3183: Traffic Stats can not get metric of deliveryservice

2019-01-07 Thread GitBox
jindov opened a new issue #3183: Traffic Stats can not get metric of 
deliveryservice
URL: https://github.com/apache/trafficcontrol/issues/3183
 
 
   Hi,
   
   I got this issue when deploy Traffic Stats, TS can get the metric of 
`cache_stats` and `daily_stats`, but it can not get the metric of 
`deliveryservice_stats`.  TS's log report as follow:
   ```
   [ERROR] 2019-01-07 08:10:50 could not unmarshall deliveryservice stats JSON 
- json: cannot unmarshal array into Go struct field .value of type string
   ```
   
   Thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c opened a new pull request #3184: WIP Add CDN-in-a-Box Dynamic IPs

2019-01-07 Thread GitBox
rob05c opened a new pull request #3184: WIP Add CDN-in-a-Box Dynamic IPs
URL: https://github.com/apache/trafficcontrol/pull/3184
 
 
   This is an experiment to add dynamic IPs to the CDN-in-a-Box.
   
   I'm not sure it works, I was having trouble bringing up the CiaB with it, 
but I'm not sure if it was just my environment, because it's setting all the 
`/etc/resolv.conf` and `/data/bind/etc` zone data, identical to the hardcoding.
   
   It's also not complete. In order to remove the hard-coded IPs from the 
`docker-compose.yml`, the `traffic_ops_data/profiles` and 
`traffic_ops_data/servers` will also need dynamically populated (I think that 
should be straightforward, using the same pattern as the rest of this).
   
   The big motivation for this is to be able to run multiple CiaB on the same 
machine. This is especially useful for build systems.
   
    What does this PR do?
   
   Fixes #(issue_number)
   
    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?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rob05c commented on issue #3184: WIP Add CDN-in-a-Box Dynamic IPs

2019-01-07 Thread GitBox
rob05c commented on issue #3184: WIP Add CDN-in-a-Box Dynamic IPs
URL: https://github.com/apache/trafficcontrol/pull/3184#issuecomment-451977436
 
 
   @dangogh @JBevillC Thoughts?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] asfgit commented on issue #3184: WIP Add CDN-in-a-Box Dynamic IPs

2019-01-07 Thread GitBox
asfgit commented on issue #3184: WIP Add CDN-in-a-Box Dynamic IPs
URL: https://github.com/apache/trafficcontrol/pull/3184#issuecomment-451984273
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/3009/
   Test FAILed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp commented on issue #3170: handles error scenario for dbdump in TP

2019-01-07 Thread GitBox
rawlinp commented on issue #3170: handles error scenario for dbdump in TP
URL: https://github.com/apache/trafficcontrol/pull/3170#issuecomment-452006460
 
 
   Verified by attempting to do a dbdump as a non-admin user and saw the red 
error box at the top saying `403 Forbidden` as expected.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rawlinp closed pull request #3170: handles error scenario for dbdump in TP

2019-01-07 Thread GitBox
rawlinp closed pull request #3170: handles error scenario for dbdump in TP
URL: https://github.com/apache/trafficcontrol/pull/3170
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/common/api/TrafficPortalService.js 
b/traffic_portal/app/src/common/api/TrafficPortalService.js
index aa91d5d21..e32723b37 100644
--- a/traffic_portal/app/src/common/api/TrafficPortalService.js
+++ b/traffic_portal/app/src/common/api/TrafficPortalService.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var TrafficPortalService = function($http, $q, ENV) {
+var TrafficPortalService = function($http, $q, messageModel, ENV) {
 
 this.getReleaseVersionInfo = function() {
 var deferred = $q.defer();
@@ -55,11 +55,18 @@ var TrafficPortalService = function($http, $q, ENV) {
 .then(
 function(result) {
 download(result.data, moment().format() + '.pg_dump');
+},
+function(fault) {
+if (fault && fault.alerts && fault.alerts.length > 0) {
+messageModel.setMessages(fault.alerts, false);
+} else {
+messageModel.setMessages([ { level: 'error', text: 
fault.status.toString() + ': ' + fault.statusText } ], false);
+}
 }
 );
 };
 
 };
 
-TrafficPortalService.$inject = ['$http', '$q', 'ENV'];
+TrafficPortalService.$inject = ['$http', '$q', 'messageModel', 'ENV'];
 module.exports = TrafficPortalService;


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] PeterRyder opened a new pull request #3185: Fix stale delivery services being served in /publish/CrStates

2019-01-07 Thread GitBox
PeterRyder opened a new pull request #3185: Fix stale delivery services being 
served in /publish/CrStates
URL: https://github.com/apache/trafficcontrol/pull/3185
 
 
    What does this PR do?
   
   Fixes #(issue_number)
   
    Which TC components are affected by this PR?
   
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Analytics
   - [x] 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?
   
   
    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](http://www.apache.org/security/)
   
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ocket8888 opened a new pull request #3186: All functionality for the admin program is now located in admin.go

2019-01-07 Thread GitBox
ocket opened a new pull request #3186: All functionality for the admin 
program is now located in admin.go
URL: https://github.com/apache/trafficcontrol/pull/3186
 
 
   ## What does this PR do?
   Makes the deprecated `admin.pl` a small wrapper around the `admin` binary, 
so that new functionality need only be added in one place.
   
   ## 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
   - [x] Other: admin.pl
   
   ## What is the best way to verify this PR?
   Run any and all tests for the `admin.pl` script
   
   ## 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](http://www.apache.org/security/)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


<    1   2   3   4   5   6   7   8   9   10   >