[GitHub] Vijay-1 commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup

2018-05-07 Thread GitBox
Vijay-1 commented on a change in pull request #2029: [Issue 1907] TO API for 
backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r186620663
 
 

 ##
 File path: traffic_ops/app/lib/API/CachegroupFallback.pm
 ##
 @@ -0,0 +1,283 @@
+package API::CachegroupFallback;
+#
+#
+# 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.
+#
+#
+#
+# a note about locations and cachegroups. This used to be "Location", before 
we had physical locations in 12M. Very confusing.
+# What used to be called a location is now called a "cache group" and location 
is now a physical address, not a group of caches working together.
+#
+
+# JvD Note: you always want to put Utils as the first use. Sh*t don't work if 
it's after the Mojo lines.
+use UI::Utils;
+use Mojo::Base 'Mojolicious::Controller';
+use Data::Dumper;
+use JSON;
+use MojoPlugins::Response;
+use Validate::Tiny ':all';
+
+sub delete {
+   my $self = shift;
+   my $cache_id = $self->param('cacheGroupId');
+   my $fallback_id = $self->param('fallbackId');
+   my $params = $self->req->json;
+   my $rs_backups = undef; 
+
+   if ( !_oper($self) ) {
+   return $self->forbidden();
+   }
+
+   if ( defined ($cache_id) && defined($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , 
backup_cg => $fallback_id} );
+   } elsif (defined ($cache_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} 
);
+   } elsif (defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { backup_cg => 
$fallback_id} );
+   }
+
+   if ( ($rs_backups->count > 0) ) {
+   my $del_records = $rs_backups->delete();
+   if ($del_records) {
+   ( $self, "Backup configuration DELETED", 
"APICHANGE");
+   return $self->success_message("Backup configuration 
DELETED");
+   } else {
+   return $self->alert( "Backup configuration DELETED." );
+   }
+   } else {
+   ( $self, "No backup Cachegroups found");
+   return $self->not_found();
+   }
+}
+
+sub show {
+   my $self = shift;
+   my $cache_id = $self->param("cacheGroupId");
+   my $fallback_id = $self->param("fallbackId");
+   my $id = $cache_id ? $cache_id : $fallback_id;
+
+   #only integers
+   if ( $id !~ /^\d+?$/ ) {
+   ( $self, "No such Cachegroup id $id");
+   return $self->not_found();
+   }
+
+   my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => 
$id } )->single();
+   if ( !defined($cachegroup) ) {
+   ( $self, "No such Cachegroup $id");
+   return $self->not_found();
+   }
+
+   if ( ($cachegroup->type->name ne "EDGE_LOC") ) {
+   return $self->alert("cachegroup should be type EDGE_LOC.");
+   }
+
+   my $rs_backups = undef;
+
+   if ( defined ($cache_id) && defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, 
backup_cg => $fallback_id}, {order_by => 'set_order'});
+   } elsif ( defined ($cache_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, 
{order_by => 'set_order'});
+   } elsif ( defined ($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ backup_cg => 
$fallback_id}, {order_by => 'set_order'});
+   }
+
+   if ( defined ($rs_backups) && ($rs_backups->count > 0) ) {
 
 Review comment:
   I am not sure on why we shouldn't return 404. To me it looks like a valid 
behavior since we cant find records for such a query.


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] Vijay-1 commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup

2018-05-07 Thread GitBox
Vijay-1 commented on a change in pull request #2029: [Issue 1907] TO API for 
backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r186620311
 
 

 ##
 File path: traffic_ops/app/lib/API/CachegroupFallback.pm
 ##
 @@ -0,0 +1,283 @@
+package API::CachegroupFallback;
+#
+#
+# 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.
+#
+#
+#
+# a note about locations and cachegroups. This used to be "Location", before 
we had physical locations in 12M. Very confusing.
+# What used to be called a location is now called a "cache group" and location 
is now a physical address, not a group of caches working together.
+#
+
+# JvD Note: you always want to put Utils as the first use. Sh*t don't work if 
it's after the Mojo lines.
+use UI::Utils;
+use Mojo::Base 'Mojolicious::Controller';
+use Data::Dumper;
+use JSON;
+use MojoPlugins::Response;
+use Validate::Tiny ':all';
+
+sub delete {
+   my $self = shift;
+   my $cache_id = $self->param('cacheGroupId');
+   my $fallback_id = $self->param('fallbackId');
+   my $params = $self->req->json;
+   my $rs_backups = undef; 
+
+   if ( !_oper($self) ) {
+   return $self->forbidden();
+   }
+
+   if ( defined ($cache_id) && defined($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , 
backup_cg => $fallback_id} );
+   } elsif (defined ($cache_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} 
);
+   } elsif (defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { backup_cg => 
$fallback_id} );
+   }
+
+   if ( ($rs_backups->count > 0) ) {
+   my $del_records = $rs_backups->delete();
+   if ($del_records) {
+   ( $self, "Backup configuration DELETED", 
"APICHANGE");
+   return $self->success_message("Backup configuration 
DELETED");
+   } else {
+   return $self->alert( "Backup configuration DELETED." );
+   }
+   } else {
+   ( $self, "No backup Cachegroups found");
+   return $self->not_found();
+   }
+}
+
+sub show {
+   my $self = shift;
+   my $cache_id = $self->param("cacheGroupId");
+   my $fallback_id = $self->param("fallbackId");
+   my $id = $cache_id ? $cache_id : $fallback_id;
+
+   #only integers
+   if ( $id !~ /^\d+?$/ ) {
+   ( $self, "No such Cachegroup id $id");
+   return $self->not_found();
+   }
+
+   my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => 
$id } )->single();
+   if ( !defined($cachegroup) ) {
+   ( $self, "No such Cachegroup $id");
+   return $self->not_found();
+   }
+
+   if ( ($cachegroup->type->name ne "EDGE_LOC") ) {
+   return $self->alert("cachegroup should be type EDGE_LOC.");
+   }
+
+   my $rs_backups = undef;
+
+   if ( defined ($cache_id) && defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, 
backup_cg => $fallback_id}, {order_by => 'set_order'});
+   } elsif ( defined ($cache_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, 
{order_by => 'set_order'});
+   } elsif ( defined ($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ backup_cg => 
$fallback_id}, {order_by => 'set_order'});
+   }
+
+   if ( defined ($rs_backups) && ($rs_backups->count > 0) ) {
+   my $response;
+   my $backup_cnt = 0;
+   while ( my $row = $rs_backups->next ) {
+   $response->[$backup_cnt]{"cacheGroupId"} = 
$row->primary_cg->id;
+   $response->[$backup_cnt]{"cacheGroupName"} = 
$row->primary_cg->name;
+   $response->[$backup_cnt]{"fallbackName"} = 
$row->backup_cg->name;
+   $response->[$backup_cnt]{"fallbackId"} = 
$row->backup_cg->id;
+   $response->[$backup_cnt]{"fallbackOrder"} = 
$row->set_order;
+   $backup_cnt++;
+   }
+   return $self->success( $response );
+   } else {
+

[GitHub] rawlinp commented on a change in pull request #2124: Add TO Go deliveryservices routes

2018-05-07 Thread GitBox
rawlinp commented on a change in pull request #2124: Add TO Go deliveryservices 
routes
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2124#discussion_r186584997
 
 

 ##
 File path: 
traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv12.go
 ##
 @@ -0,0 +1,326 @@
+package deliveryservice
+
+/*
+ * 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.
+ */
+
+import (
+   "database/sql"
+   "errors"
+   "fmt"
+   "regexp"
+   "strings"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/config"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tenant"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+
+   "github.com/asaskevich/govalidator"
+   "github.com/go-ozzo/ozzo-validation"
+   "github.com/jmoiron/sqlx"
+)
+
+type TODeliveryServiceV12 struct {
+   DS  *tc.DeliveryServiceNullableV12
+   Cfg config.Config
+   DB  *sqlx.DB
+}
+
+func GetRefTypeV12(cfg config.Config, db *sqlx.DB) *TODeliveryServiceV12 {
+   return {Cfg: cfg, DB: db, DS: 
{}}
+}
+
+func (ds TODeliveryServiceV12) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"id", api.GetIntKey}}
+}
+
+func (tods TODeliveryServiceV12) GetKeys() (map[string]interface{}, bool) {
+   if tods.DS.ID == nil {
+   return map[string]interface{}{"id": 0}, false
+   }
+   return map[string]interface{}{"id": *tods.DS.ID}, true
+}
+
+func (tods *TODeliveryServiceV12) SetKeys(keys map[string]interface{}) {
+   i, _ := keys["id"].(int) //this utilizes the non panicking type 
assertion, if the thrown away ok variable is false i will be the zero of the 
type, 0 here.
+   tods.DS.ID = 
+}
+
+func (tods *TODeliveryServiceV12) GetAuditName() string {
+   if tods.DS != nil && tods.DS.XMLID != nil {
+   return *tods.DS.XMLID
+   }
+   return ""
+}
+
+func (tods *TODeliveryServiceV12) GetType() string {
+   return "ds"
+}
+
+func ValidateV12(db *sqlx.DB, ds *tc.DeliveryServiceNullableV12) []error {
+   if ds == nil {
+   return []error{}
+   }
+   tods := TODeliveryServiceV12{DS: ds, DB: db} // TODO pass config?
+   return tods.Validate(db)
+}
+
+func (tods *TODeliveryServiceV12) Sanitize(db *sqlx.DB) {
+   ds := tods.DS
+   if ds.GeoLimitCountries != nil {
+   *ds.GeoLimitCountries = 
strings.ToUpper(strings.Replace(*ds.GeoLimitCountries, " ", "", -1))
+   }
+   if ds.ProfileID != nil && *ds.ProfileID == -1 {
+   ds.ProfileID = nil
+   }
+   if ds.EdgeHeaderRewrite != nil && 
strings.TrimSpace(*ds.EdgeHeaderRewrite) == "" {
+   ds.EdgeHeaderRewrite = nil
+   }
+   if ds.MidHeaderRewrite != nil && 
strings.TrimSpace(*ds.MidHeaderRewrite) == "" {
+   ds.MidHeaderRewrite = nil
+   }
+}
+
+// LoadTenantID loads the DeliveryService's tenant ID from the database, using 
the DS ID or XMLID if either exists. Sets tods.DS.TenantID on success, and 
returns whether the delivery service was found, and any error.
+func (tods *TODeliveryServiceV12) LoadTenantID(db *sqlx.DB) (bool, error) {
+   if tods.DS.ID != nil {
+   tenantID := 0
 
 Review comment:
   I think this needs to be a pointer to an int so that `Scan()` 
doesn't error out when tenantID is null in the DB. I just ran into this while 
working on the Origin API and initially had it the same as you have it here.


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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #815

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1532
originally caused by:
 GitHub pull request #2236 of commit 80fa3ed7e2a1c8c0be3fa883d0ee182d3cee6c39, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H23 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins1318235820894355403.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins2694429495107889814.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ sort -r
++ head -n 1
++ awk -F '"' '{print $2}'
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.756irYr4St
+ ratjar=/tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0 
23 1587k   23  369k0 0   389k  0  0:00:04 --:--:--  0:00:04  
389k100 1587k  100 1587k0 0  1364k  0  0:00:01  0:00:01 --:--:-- 
1364k
+ curl -L -o /tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
010040  100400 0 69  0 --:--:-- --:--:-- --:--:--69
++ sha1sum /tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.756irYr4St/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.756irYr4St
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  

[GitHub] asfgit commented on issue #2236: update portal info bubbles

2018-05-07 Thread GitBox
asfgit commented on issue #2236: update portal info bubbles
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2236#issuecomment-387225250
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1532/
   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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #814

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1531
originally caused by:
 GitHub pull request #2234 of commit 9fc7a7e2865e1429501e9353ef23511f5c261445, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H34 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins3214764596938509277.sh
+ rm -rf 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins8004751260977980926.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ sort -r
++ head -n 1
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.dWuE6nfOr8
+ ratjar=/tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
2 1587k2 409600 0  51223  0  0:00:31 --:--:--  0:00:31 51200100 
1587k  100 1587k0 0  1383k  0  0:00:01  0:00:01 --:--:-- 1385k
+ curl -L -o /tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0400 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 63  0 --:--:-- --:--:-- --:--:--63
++ sha1sum /tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.dWuE6nfOr8/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.dWuE6nfOr8
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  

[GitHub] rob05c commented on issue #1236: Delivery Service APIs: CRUD

2018-05-07 Thread GitBox
rob05c commented on issue #1236: Delivery Service APIs: CRUD
URL: 
https://github.com/apache/incubator-trafficcontrol/issues/1236#issuecomment-387223244
 
 
   https://github.com/apache/incubator-trafficcontrol/pull/2124


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] ashish-timilsina commented on issue #2236: update portal info bubbles

2018-05-07 Thread GitBox
ashish-timilsina commented on issue #2236: update portal info bubbles
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2236#issuecomment-387221380
 
 
   @mitchell852 


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] ashish-timilsina opened a new pull request #2236: update portal info bubbles

2018-05-07 Thread GitBox
ashish-timilsina opened a new pull request #2236: update portal info bubbles
URL: https://github.com/apache/incubator-trafficcontrol/pull/2236
 
 
   update portal info bubbles from Traffic control site
   ipv6 should be true  by default


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 #2234: Add TO Go staticdnsentries endpoint

2018-05-07 Thread GitBox
asfgit commented on issue #2234: Add TO Go staticdnsentries endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2234#issuecomment-387215917
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1531/
   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] dneuman64 opened a new issue #2235: Ability to blacklist IPs

2018-05-07 Thread GitBox
dneuman64 opened a new issue #2235: Ability to blacklist IPs
URL: https://github.com/apache/incubator-trafficcontrol/issues/2235
 
 
   Traffic Control should support the ability to blacklist individual IPs.  
Currently we can limit by country codes and by using our CZF, but there isn't a 
good mechanism for blacklisting or limiting an individual IP.  It would be 
ideal if this could be done by Delivery service as well, instead of globally.
   
   This came up when trying to do some failover testing.  There are many ways 
to do failover testing, but one way would be to blacklist a client from hitting 
one DS and making sure it fails over to a different DS.


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 #2234: Add TO Go staticdnsentries endpoint

2018-05-07 Thread GitBox
rob05c opened a new pull request #2234: Add TO Go staticdnsentries endpoint
URL: https://github.com/apache/incubator-trafficcontrol/pull/2234
 
 
   Looks like it isn't possible to write API Tests for this, because it's only 
a GET. Might have to wait until the API/Portal supports creating static DNS 
entries.


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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #813

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1530
originally caused by:
 GitHub pull request #2010 of commit a93d2598e8f0ff11e50df6fd30fad3da3fd64fdb, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H20 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins3903749589788314132.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins2731566036320714916.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ sort -r
++ head -n 1
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.PCx1LqpRed
+ ratjar=/tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0 
13 1587k   13  213k0 0   213k  0  0:00:07  0:00:01  0:00:06  
213k100 1587k  100 1587k0 0  1344k  0  0:00:01  0:00:01 --:--:-- 
1345k
+ curl -L -o /tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
010040  100400 0 65  0 --:--:-- --:--:-- --:--:--65
++ sha1sum /tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.PCx1LqpRed/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.PCx1LqpRed
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  

[GitHub] asfgit commented on issue #2010: Go login

2018-05-07 Thread GitBox
asfgit commented on issue #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#issuecomment-387206309
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1530/
   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] DylanVolz commented on a change in pull request #2010: Go login

2018-05-07 Thread GitBox
DylanVolz commented on a change in pull request #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#discussion_r186549373
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/auth/login.go
 ##
 @@ -0,0 +1,156 @@
+package auth
+
+/*
+ * 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.
+ */
+
+import (
+   "crypto/sha1"
+   "encoding/hex"
+   "encoding/json"
+   "errors"
+   "fmt"
+   "net/http"
+   "time"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/config"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tocookie"
+
+   "github.com/jmoiron/sqlx"
+)
+
+const disallowed = "disallowed"
+
+type passwordForm struct {
+   Username string `json:"u"`
+   Password string `json:"p"`
+}
+
+func LoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc {
+   return func(w http.ResponseWriter, r *http.Request) {
+   handleErrs := tc.GetHandleErrorsFunc(w, r)
+   defer r.Body.Close()
+   form := passwordForm{}
+   if err := json.NewDecoder(r.Body).Decode(); err != nil {
+   handleErrs(http.StatusBadRequest, err)
+   return
+   }
+   resp := struct {
+   tc.Alerts
+   }{}
+   userAllowed, err := CheckLocalUserIsAllowed(form, db)
+   if err != nil {
+   log.Errorf("error checking local user: %s\n", 
err.Error())
+   }
+   if userAllowed {
+   authenticated, err := checkLocalUserPassword(form, db)
+   if err != nil {
+   log.Errorf("error checking local user password: 
%s\n", err.Error())
+   }
+   var ldapErr error
+   if !authenticated {
+   if cfg.LDAPEnabled {
+   authenticated, ldapErr = 
checkLDAPUser(form, cfg.ConfigLDAP)
+   if ldapErr != nil {
+   log.Errorf("error checking ldap 
user: %s\n", ldapErr.Error())
+   }
+   }
+   }
+   if authenticated {
+   expiry := time.Now().Add(time.Hour * 6)
+   cookie := tocookie.New(form.Username, expiry, 
cfg.Secrets[0])
+   httpCookie := http.Cookie{Name: "mojolicious", 
Value: cookie, Path: "/", Expires: expiry, HttpOnly: true}
+   http.SetCookie(w, )
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.SuccessLevel, 
"Successfully logged in.")}
+
+   } else {
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.ErrorLevel, "Invalid 
username or password.")}
+   }
+   } else {
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.ErrorLevel, "Invalid username or 
password.")}
+   }
+   respBts, err := json.Marshal(resp)
+   if err != nil {
+   handleErrs(http.StatusInternalServerError, err)
+   return
+   }
+
+   w.Header().Set(tc.ContentType, tc.ApplicationJson)
+   fmt.Fprintf(w, "%s", respBts)
+   }
+}
+
+func CheckLocalUserIsAllowed(form passwordForm, db *sqlx.DB) (bool, error) {
+   var roleName string
+   err := db.Get(, "SELECT role.name FROM role INNER JOIN tm_user 
ON tm_user.role = role.id where username=$1",form.Username)
+   if err != nil {
+   return false, err
+   }
+   if 

[GitHub] DylanVolz commented on a change in pull request #2010: Go login

2018-05-07 Thread GitBox
DylanVolz commented on a change in pull request #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#discussion_r186548894
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/config/config.go
 ##
 @@ -142,6 +156,16 @@ func LoadConfig(cdnConfPath string, dbConfPath string, 
riakConfPath string, appV
}
}
 
+   if cfg.LDAPConfPath != "" {
+   cfg.LDAPEnabled, cfg.ConfigLDAP, err = 
GetLDAPConfig(cfg.LDAPConfPath)
+   if err != nil {
+   cfg.LDAPEnabled = false // probably unnecessary
 
 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] mitchell852 commented on issue #1338: Role APIs: CRUD

2018-05-07 Thread GitBox
mitchell852 commented on issue #1338: Role APIs: CRUD
URL: 
https://github.com/apache/incubator-trafficcontrol/issues/1338#issuecomment-387192948
 
 
   duplicate of #2033 


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 #1338: Role APIs: CRUD

2018-05-07 Thread GitBox
mitchell852 closed issue #1338: Role APIs: CRUD
URL: https://github.com/apache/incubator-trafficcontrol/issues/1338
 
 
   


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] dewrich closed issue #1214: Profile APIs: CRUD

2018-05-07 Thread GitBox
dewrich closed issue #1214: Profile APIs: CRUD
URL: https://github.com/apache/incubator-trafficcontrol/issues/1214
 
 
   


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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #812

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1529
originally caused by:
 GitHub pull request #2233 of commit 8f0fb032816041fdef4001395f0f475ff7cdb527, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H20 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins3272031692767892689.sh
+ rm -rf 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins1941479370365543806.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ head -n 1
++ sort -r
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.r522uocxHF
+ ratjar=/tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
1587k  100 1587k0 0  1381k  0  0:00:01  0:00:01 --:--:-- 1382k
+ curl -L -o /tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 60  0 --:--:-- --:--:-- --:--:--60
++ sha1sum /tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.r522uocxHF/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.r522uocxHF
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  

[GitHub] asfgit commented on issue #2233: Fixed the Go import package alignment because the github project moved

2018-05-07 Thread GitBox
asfgit commented on issue #2233: Fixed the Go import package alignment because 
the github project moved
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2233#issuecomment-387188635
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1529/
   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] dewrich opened a new pull request #2233: Fixed the Go import package alignment because the github project moved

2018-05-07 Thread GitBox
dewrich opened a new pull request #2233: Fixed the Go import package alignment 
because the github project moved
URL: https://github.com/apache/incubator-trafficcontrol/pull/2233
 
 
   Fixed the Go to point to `github.com/lestrrat-go/jwx` which prevents
   `go get -v` from working in the Docker builds


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


Build failed in Jenkins: incubator-trafficcontrol-traffic_ops-test #611

2018-05-07 Thread Apache Jenkins Server
See 


Changes:

[rob05c] fixed missing 'lastUpdate' field in Types and removed Types handler in

[rob05c] reverted changes removing PERL api

--
[...truncated 1.30 MB...]
unit_1 | Use of uninitialized value in string eq at 
/opt/traffic_ops/app/lib/API/Federation.pm line 148.
unit_1 | /opt/traffic_ops/app/t/api/1.2/federation_internal.t 
. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Use of uninitialized value in string eq at 
/opt/traffic_ops/app/lib/API/Iso.pm line 264.
unit_1 | Use of uninitialized value in string eq at 
/opt/traffic_ops/app/lib/API/Iso.pm line 271.
unit_1 | Use of uninitialized value in string eq at 
/opt/traffic_ops/app/lib/API/Iso.pm line 278.
unit_1 | /opt/traffic_ops/app/t/api/1.2/iso.t 
. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/job.t 
. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/log.t 
. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/parameter.t 
... ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/physlocation.t 
 ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | DBIx::Class::ResultSet::search_rs(): search( %condition ) is 
deprecated, use search( \%condition ) instead at 
/opt/traffic_ops/app/lib/API/Parameter.pm line 137
unit_1 | /opt/traffic_ops/app/t/api/1.2/profile.t 
. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/profile_parameter.t 
... ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/region.t 
.. ok
unit_1 | "my" variable $server_id masks earlier declaration in same 
scope at /opt/traffic_ops/app/t/api/1.2/server.t line 656.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | DBIx::Class::Storage::DBI::select_single(): Query returned 
more than one row.  SQL that returns multiple rows is DEPRECATED for ->find and 
->single at /opt/traffic_ops/app/lib/API/Deliveryservice.pm line 933
unit_1 | Use of uninitialized value $offline_reason in concatenation 
(.) or string at /opt/traffic_ops/app/lib/API/Server.pm line 877.
unit_1 | /opt/traffic_ops/app/t/api/1.2/server.t 
.. ok
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | Subroutine TrafficOps::has redefined at 
/opt/traffic_ops/app/local/lib/perl5/Mojo/Base.pm line 38.
unit_1 | /opt/traffic_ops/app/t/api/1.2/stats_summary.t 
... ok
unit_1 | Useless use of a constant ("Is the steering target returned?") 
in void context at /opt/traffic_ops/app/t/api/1.2/steering_target.t line 78.
unit_1 | Subroutine TrafficOps::has 

[GitHub] mitchell852 commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup

2018-05-07 Thread GitBox
mitchell852 commented on a change in pull request #2029: [Issue 1907] TO API 
for backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r186530252
 
 

 ##
 File path: traffic_ops/app/lib/API/CachegroupFallback.pm
 ##
 @@ -0,0 +1,283 @@
+package API::CachegroupFallback;
+#
+#
+# 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.
+#
+#
+#
+# a note about locations and cachegroups. This used to be "Location", before 
we had physical locations in 12M. Very confusing.
+# What used to be called a location is now called a "cache group" and location 
is now a physical address, not a group of caches working together.
+#
+
+# JvD Note: you always want to put Utils as the first use. Sh*t don't work if 
it's after the Mojo lines.
+use UI::Utils;
+use Mojo::Base 'Mojolicious::Controller';
+use Data::Dumper;
+use JSON;
+use MojoPlugins::Response;
+use Validate::Tiny ':all';
+
+sub delete {
+   my $self = shift;
+   my $cache_id = $self->param('cacheGroupId');
+   my $fallback_id = $self->param('fallbackId');
+   my $params = $self->req->json;
+   my $rs_backups = undef; 
+
+   if ( !_oper($self) ) {
+   return $self->forbidden();
+   }
+
+   if ( defined ($cache_id) && defined($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , 
backup_cg => $fallback_id} );
+   } elsif (defined ($cache_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} 
);
+   } elsif (defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { backup_cg => 
$fallback_id} );
+   }
+
+   if ( ($rs_backups->count > 0) ) {
+   my $del_records = $rs_backups->delete();
+   if ($del_records) {
+   ( $self, "Backup configuration DELETED", 
"APICHANGE");
+   return $self->success_message("Backup configuration 
DELETED");
+   } else {
+   return $self->alert( "Backup configuration DELETED." );
+   }
+   } else {
+   ( $self, "No backup Cachegroups found");
+   return $self->not_found();
+   }
+}
+
+sub show {
+   my $self = shift;
+   my $cache_id = $self->param("cacheGroupId");
+   my $fallback_id = $self->param("fallbackId");
+   my $id = $cache_id ? $cache_id : $fallback_id;
+
+   #only integers
+   if ( $id !~ /^\d+?$/ ) {
+   ( $self, "No such Cachegroup id $id");
+   return $self->not_found();
+   }
+
+   my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => 
$id } )->single();
+   if ( !defined($cachegroup) ) {
+   ( $self, "No such Cachegroup $id");
+   return $self->not_found();
+   }
+
+   if ( ($cachegroup->type->name ne "EDGE_LOC") ) {
+   return $self->alert("cachegroup should be type EDGE_LOC.");
+   }
+
+   my $rs_backups = undef;
+
+   if ( defined ($cache_id) && defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, 
backup_cg => $fallback_id}, {order_by => 'set_order'});
+   } elsif ( defined ($cache_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, 
{order_by => 'set_order'});
+   } elsif ( defined ($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ backup_cg => 
$fallback_id}, {order_by => 'set_order'});
+   }
+
+   if ( defined ($rs_backups) && ($rs_backups->count > 0) ) {
 
 Review comment:
   just return an empty array if count=0. don't return a 404 
($self->not_found())


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 a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup

2018-05-07 Thread GitBox
mitchell852 commented on a change in pull request #2029: [Issue 1907] TO API 
for backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r186530205
 
 

 ##
 File path: traffic_ops/app/lib/API/CachegroupFallback.pm
 ##
 @@ -0,0 +1,283 @@
+package API::CachegroupFallback;
+#
+#
+# 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.
+#
+#
+#
+# a note about locations and cachegroups. This used to be "Location", before 
we had physical locations in 12M. Very confusing.
+# What used to be called a location is now called a "cache group" and location 
is now a physical address, not a group of caches working together.
+#
+
+# JvD Note: you always want to put Utils as the first use. Sh*t don't work if 
it's after the Mojo lines.
+use UI::Utils;
+use Mojo::Base 'Mojolicious::Controller';
+use Data::Dumper;
+use JSON;
+use MojoPlugins::Response;
+use Validate::Tiny ':all';
+
+sub delete {
+   my $self = shift;
+   my $cache_id = $self->param('cacheGroupId');
+   my $fallback_id = $self->param('fallbackId');
+   my $params = $self->req->json;
+   my $rs_backups = undef; 
+
+   if ( !_oper($self) ) {
+   return $self->forbidden();
+   }
+
+   if ( defined ($cache_id) && defined($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , 
backup_cg => $fallback_id} );
+   } elsif (defined ($cache_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} 
);
+   } elsif (defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search( { backup_cg => 
$fallback_id} );
+   }
+
+   if ( ($rs_backups->count > 0) ) {
+   my $del_records = $rs_backups->delete();
+   if ($del_records) {
+   ( $self, "Backup configuration DELETED", 
"APICHANGE");
+   return $self->success_message("Backup configuration 
DELETED");
+   } else {
+   return $self->alert( "Backup configuration DELETED." );
+   }
+   } else {
+   ( $self, "No backup Cachegroups found");
+   return $self->not_found();
+   }
+}
+
+sub show {
+   my $self = shift;
+   my $cache_id = $self->param("cacheGroupId");
+   my $fallback_id = $self->param("fallbackId");
+   my $id = $cache_id ? $cache_id : $fallback_id;
+
+   #only integers
+   if ( $id !~ /^\d+?$/ ) {
+   ( $self, "No such Cachegroup id $id");
+   return $self->not_found();
+   }
+
+   my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => 
$id } )->single();
+   if ( !defined($cachegroup) ) {
+   ( $self, "No such Cachegroup $id");
+   return $self->not_found();
+   }
+
+   if ( ($cachegroup->type->name ne "EDGE_LOC") ) {
+   return $self->alert("cachegroup should be type EDGE_LOC.");
+   }
+
+   my $rs_backups = undef;
+
+   if ( defined ($cache_id) && defined ($fallback_id)) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, 
backup_cg => $fallback_id}, {order_by => 'set_order'});
+   } elsif ( defined ($cache_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, 
{order_by => 'set_order'});
+   } elsif ( defined ($fallback_id) ) {
+   $rs_backups = 
$self->db->resultset('CachegroupFallback')->search({ backup_cg => 
$fallback_id}, {order_by => 'set_order'});
+   }
+
+   if ( defined ($rs_backups) && ($rs_backups->count > 0) ) {
+   my $response;
+   my $backup_cnt = 0;
+   while ( my $row = $rs_backups->next ) {
+   $response->[$backup_cnt]{"cacheGroupId"} = 
$row->primary_cg->id;
+   $response->[$backup_cnt]{"cacheGroupName"} = 
$row->primary_cg->name;
+   $response->[$backup_cnt]{"fallbackName"} = 
$row->backup_cg->name;
+   $response->[$backup_cnt]{"fallbackId"} = 
$row->backup_cg->id;
+   $response->[$backup_cnt]{"fallbackOrder"} = 
$row->set_order;
+   $backup_cnt++;
+   }
+   return $self->success( $response );
+   } else {
+

[GitHub] rob05c commented on a change in pull request #2010: Go login

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#discussion_r186523821
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/auth/login.go
 ##
 @@ -0,0 +1,156 @@
+package auth
+
+/*
+ * 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.
+ */
+
+import (
+   "crypto/sha1"
+   "encoding/hex"
+   "encoding/json"
+   "errors"
+   "fmt"
+   "net/http"
+   "time"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/config"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tocookie"
+
+   "github.com/jmoiron/sqlx"
+)
+
+const disallowed = "disallowed"
+
+type passwordForm struct {
+   Username string `json:"u"`
+   Password string `json:"p"`
+}
+
+func LoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc {
+   return func(w http.ResponseWriter, r *http.Request) {
+   handleErrs := tc.GetHandleErrorsFunc(w, r)
+   defer r.Body.Close()
+   form := passwordForm{}
+   if err := json.NewDecoder(r.Body).Decode(); err != nil {
+   handleErrs(http.StatusBadRequest, err)
+   return
+   }
+   resp := struct {
+   tc.Alerts
+   }{}
+   userAllowed, err := CheckLocalUserIsAllowed(form, db)
+   if err != nil {
+   log.Errorf("error checking local user: %s\n", 
err.Error())
+   }
+   if userAllowed {
+   authenticated, err := checkLocalUserPassword(form, db)
+   if err != nil {
+   log.Errorf("error checking local user password: 
%s\n", err.Error())
+   }
+   var ldapErr error
+   if !authenticated {
+   if cfg.LDAPEnabled {
+   authenticated, ldapErr = 
checkLDAPUser(form, cfg.ConfigLDAP)
+   if ldapErr != nil {
+   log.Errorf("error checking ldap 
user: %s\n", ldapErr.Error())
+   }
+   }
+   }
+   if authenticated {
+   expiry := time.Now().Add(time.Hour * 6)
+   cookie := tocookie.New(form.Username, expiry, 
cfg.Secrets[0])
+   httpCookie := http.Cookie{Name: "mojolicious", 
Value: cookie, Path: "/", Expires: expiry, HttpOnly: true}
+   http.SetCookie(w, )
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.SuccessLevel, 
"Successfully logged in.")}
+
+   } else {
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.ErrorLevel, "Invalid 
username or password.")}
+   }
+   } else {
+   resp = struct {
+   tc.Alerts
+   }{tc.CreateAlerts(tc.ErrorLevel, "Invalid username or 
password.")}
+   }
+   respBts, err := json.Marshal(resp)
+   if err != nil {
+   handleErrs(http.StatusInternalServerError, err)
+   return
+   }
+
+   w.Header().Set(tc.ContentType, tc.ApplicationJson)
+   fmt.Fprintf(w, "%s", respBts)
+   }
+}
+
+func CheckLocalUserIsAllowed(form passwordForm, db *sqlx.DB) (bool, error) {
+   var roleName string
+   err := db.Get(, "SELECT role.name FROM role INNER JOIN tm_user 
ON tm_user.role = role.id where username=$1",form.Username)
+   if err != nil {
+   return false, err
+   }
+   if 

[GitHub] rob05c commented on a change in pull request #2010: Go login

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#discussion_r186522372
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/config/config.go
 ##
 @@ -142,6 +156,16 @@ func LoadConfig(cdnConfPath string, dbConfPath string, 
riakConfPath string, appV
}
}
 
+   if cfg.LDAPConfPath != "" {
+   cfg.LDAPEnabled, cfg.ConfigLDAP, err = 
GetLDAPConfig(cfg.LDAPConfPath)
+   if err != nil {
+   cfg.LDAPEnabled = false // probably unnecessary
 
 Review comment:
   I'd support removing this comment. All return values should be treated as 
undefined, if a returned error is not nil.
   
   I'd rather omit the comment, than have someone remove the line because of 
the comment in the future.


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


Build failed in Jenkins: incubator-trafficcontrol-rat #709

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-master-build" build 
number 753
originally caused by:
 Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H29 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-rat] $ /bin/bash -xe 
/tmp/jenkins4920364981994137302.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-rat] $ /bin/bash -xe 
/tmp/jenkins4863949703524072715.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ awk -F '"' '{print $2}'
++ sort -r
++ cut -d / -f 12
++ head -n 1
++ grep -ve md5 -e sha1
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.Zpebdgg3js
+ ratjar=/tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
1587k  100 1587k0 0  1350k  0  0:00:01  0:00:01 --:--:-- 1350k
+ curl -L -o /tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 60  0 --:--:-- --:--:-- --:--:--60
++ sha1sum /tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.Zpebdgg3js/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.Zpebdgg3js
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  

[GitHub] rob05c closed issue #2153: Read method on api/1.3/types does not return 'lastUpdated'

2018-05-07 Thread GitBox
rob05c closed issue #2153: Read method on api/1.3/types does not return 
'lastUpdated'
URL: https://github.com/apache/incubator-trafficcontrol/issues/2153
 
 
   


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 #2153: Read method on api/1.3/types does not return 'lastUpdated'

2018-05-07 Thread GitBox
rob05c commented on issue #2153: Read method on api/1.3/types does not return 
'lastUpdated'
URL: 
https://github.com/apache/incubator-trafficcontrol/issues/2153#issuecomment-387171514
 
 
   Fixed by #2155 in 58ab7c2aeb6e7c7a97a5afbdaf463562ea00e20d


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 closed pull request #2155: Fixed missing 'lastUpdate' field in Types Go API

2018-05-07 Thread GitBox
rob05c closed pull request #2155: Fixed missing 'lastUpdate' field in Types Go 
API
URL: https://github.com/apache/incubator-trafficcontrol/pull/2155
 
 
   

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/types/types.go 
b/traffic_ops/traffic_ops_golang/types/types.go
index 74c10eb8f..ca5b70f93 100644
--- a/traffic_ops/traffic_ops_golang/types/types.go
+++ b/traffic_ops/traffic_ops_golang/types/types.go
@@ -132,7 +132,8 @@ func selectQuery() string {
 id,
 name,
 description,
-use_in_table
+use_in_table,
+last_updated
 FROM type typ`
 
return query


 


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


Build failed in Jenkins: incubator-trafficcontrol-rat #708

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-master-build" build 
number 752
originally caused by:
 Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H27 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-rat] $ /bin/bash -xe 
/tmp/jenkins6381614195368327509.sh
+ rm -rf ' 
'
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-rat] $ /bin/bash -xe /tmp/jenkins579618830881439295.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ sort -r
++ head -n 1
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.zvWRmFAnbp
+ ratjar=/tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0 44 
1587k   44  704k0 0   599k  0  0:00:02  0:00:01  0:00:01  599k100 
1587k  100 1587k0 0  1254k  0  0:00:01  0:00:01 --:--:-- 1253k
+ curl -L -o /tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
010040  100400 0 60  0 --:--:-- --:--:-- --:--:--60
++ sha1sum /tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.zvWRmFAnbp/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.zvWRmFAnbp
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/formatters_suite_test.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/package.go
  

[GitHub] rob05c commented on issue #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on issue #2228: Added the Get API in Go for the 
DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#issuecomment-387167737
 
 
   Looks good. Tested against a prod database, produces the same output as 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] rob05c closed pull request #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c closed pull request #2228: Added the Get API in Go for the 
DeliveryserviceServers endpoint
URL: https://github.com/apache/incubator-trafficcontrol/pull/2228
 
 
   

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/lib/go-tc/deliveryservice_servers.go 
b/lib/go-tc/deliveryservice_servers.go
new file mode 100644
index 0..aa0ec99cc
--- /dev/null
+++ b/lib/go-tc/deliveryservice_servers.go
@@ -0,0 +1,80 @@
+package tc
+
+import "time"
+
+/*
+
+   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.
+*/
+
+// DeliveryServiceServerResponse ...
+type DeliveryServiceServerResponse struct {
+   Response []DeliveryServiceServer `json:"response"`
+   Size int `json:"size"`
+   OrderBy  string  `json:"orderby"`
+   Limitint `json:"limit"`
+}
+
+// DeliveryServiceServer ...
+type DeliveryServiceServer struct {
+   Server  *int `json:"server"`
+   DeliveryService *int `json:"deliveryService"`
+   LastUpdated *TimeNoMod   `json:"lastUpdated" db:"last_updated"`
+}
+
+
+type DssServer struct {
+   Cachegroup   *string  `json:"cachegroup" 
db:"cachegroup"`
+   CachegroupID *int `json:"cachegroupId" 
db:"cachegroup_id"`
+   CDNID*int `json:"cdnId" db:"cdn_id"`
+   CDNName  *string  `json:"cdnName" db:"cdn_name"`
+   DeliveryServices *map[string][]string 
`json:"deliveryServices,omitempty"`
+   DomainName   *string  `json:"domainName" 
db:"domain_name"`
+   FQDN *string  `json:"fqdn,omitempty"`
+   FqdnTime time.Time`json:"-"`
+   GUID *string  `json:"guid" db:"guid"`
+   HostName *string  `json:"hostName" db:"host_name"`
+   HTTPSPort*int `json:"httpsPort" db:"https_port"`
+   ID   *int `json:"id" db:"id"`
+   ILOIPAddress *string  `json:"iloIpAddress" 
db:"ilo_ip_address"`
+   ILOIPGateway *string  `json:"iloIpGateway" 
db:"ilo_ip_gateway"`
+   ILOIPNetmask *string  `json:"iloIpNetmask" 
db:"ilo_ip_netmask"`
+   ILOPassword  *string  `json:"iloPassword" 
db:"ilo_password"`
+   ILOUsername  *string  `json:"iloUsername" 
db:"ilo_username"`
+   InterfaceMtu *int `json:"interfaceMtu" 
db:"interface_mtu"`
+   InterfaceName*string  `json:"interfaceName" 
db:"interface_name"`
+   IP6Address   *string  `json:"ip6Address" 
db:"ip6_address"`
+   IP6Gateway   *string  `json:"ip6Gateway" 
db:"ip6_gateway"`
+   IPAddress*string  `json:"ipAddress" db:"ip_address"`
+   IPGateway*string  `json:"ipGateway" db:"ip_gateway"`
+   IPNetmask*string  `json:"ipNetmask" db:"ip_netmask"`
+   LastUpdated  *TimeNoMod   `json:"lastUpdated" 
db:"last_updated"`
+   MgmtIPAddress*string  `json:"mgmtIpAddress" 
db:"mgmt_ip_address"`
+   MgmtIPGateway*string  `json:"mgmtIpGateway" 
db:"mgmt_ip_gateway"`
+   MgmtIPNetmask*string  `json:"mgmtIpNetmask" 
db:"mgmt_ip_netmask"`
+   OfflineReason*string  `json:"offlineReason" 
db:"offline_reason"`
+   PhysLocation *string  `json:"physLocation" 
db:"phys_location"`
+   PhysLocationID   *int `json:"physLocationId" 
db:"phys_location_id"`
+   Profile  *string  `json:"profile" db:"profile"`
+   ProfileDesc  *string  `json:"profileDesc" 
db:"profile_desc"`
+   ProfileID*int `json:"profileId" db:"profile_id"`
+   Rack *string  `json:"rack" db:"rack"`
+   RouterHostName   *string  `json:"routerHostName" 
db:"router_host_name"`
+   RouterPortName   *string  `json:"routerPortName" 
db:"router_port_name"`
+   Status   *string  

[GitHub] rob05c commented on a change in pull request #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186515615
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
+   dss.DeliveryService = _id
+
+   server_id, _ := keys["server"].(int) //this utilizes the non panicking 
type assertion, if the thrown away ok variable is false i will be the zero of 
the type, 0 here.
+   dss.Server = _id
+}
+
+// Validate fulfills the api.Validator interface
+func (dss *TODeliveryServiceServer) Validate(db *sqlx.DB) []error {
+
+   errs := validation.Errors{
+   "deliveryservice": validation.Validate(dss.DeliveryService, 
validation.Required),
+   "server":  validation.Validate(dss.Server, 
validation.Required),
+   }
+
+   return tovalidate.ToErrors(errs)
+}
+
+//The TODeliveryServiceServer implementation of the Creator interface
+//all implementations of Creator should use transactions and return the proper 
errorType
+//ParsePQUniqueConstraintError is used to determine if a profileparameter with 
conflicting values exists
+//if so, it will return an errorType of DataConflict and the type should be 
appended to the
+//generic error message returned
+//The insert sql returns the profile and lastUpdated values of the newly 
inserted profileparameter and have
+//to be added to the struct
+func (dss *TODeliveryServiceServer) Create(db *sqlx.DB, user auth.CurrentUser) 
(error, tc.ApiErrorType) {
+   rollbackTransaction := true
+   tx, err := db.Beginx()
+   defer func() {
+   if tx == nil 

[GitHub] rob05c commented on a change in pull request #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186515364
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
+   dss.DeliveryService = _id
+
+   server_id, _ := keys["server"].(int) //this utilizes the non panicking 
type assertion, if the thrown away ok variable is false i will be the zero of 
the type, 0 here.
+   dss.Server = _id
+}
+
+// Validate fulfills the api.Validator interface
+func (dss *TODeliveryServiceServer) Validate(db *sqlx.DB) []error {
+
+   errs := validation.Errors{
+   "deliveryservice": validation.Validate(dss.DeliveryService, 
validation.Required),
+   "server":  validation.Validate(dss.Server, 
validation.Required),
+   }
+
+   return tovalidate.ToErrors(errs)
+}
+
+//The TODeliveryServiceServer implementation of the Creator interface
+//all implementations of Creator should use transactions and return the proper 
errorType
+//ParsePQUniqueConstraintError is used to determine if a profileparameter with 
conflicting values exists
+//if so, it will return an errorType of DataConflict and the type should be 
appended to the
+//generic error message returned
+//The insert sql returns the profile and lastUpdated values of the newly 
inserted profileparameter and have
+//to be added to the struct
+func (dss *TODeliveryServiceServer) Create(db *sqlx.DB, user auth.CurrentUser) 
(error, tc.ApiErrorType) {
+   rollbackTransaction := true
+   tx, err := db.Beginx()
+   defer func() {
+   if tx == nil 

[GitHub] rob05c commented on a change in pull request #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186515275
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
+   dss.DeliveryService = _id
+
+   server_id, _ := keys["server"].(int) //this utilizes the non panicking 
type assertion, if the thrown away ok variable is false i will be the zero of 
the type, 0 here.
+   dss.Server = _id
+}
+
+// Validate fulfills the api.Validator interface
+func (dss *TODeliveryServiceServer) Validate(db *sqlx.DB) []error {
+
+   errs := validation.Errors{
+   "deliveryservice": validation.Validate(dss.DeliveryService, 
validation.Required),
+   "server":  validation.Validate(dss.Server, 
validation.Required),
+   }
+
+   return tovalidate.ToErrors(errs)
+}
+
+//The TODeliveryServiceServer implementation of the Creator interface
 
 Review comment:
   The first word of a function comment should begin with the name of the 
function, `Create`. Not doing so breaks Godoc.


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186515078
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
+   dss.DeliveryService = _id
+
+   server_id, _ := keys["server"].(int) //this utilizes the non panicking 
type assertion, if the thrown away ok variable is false i will be the zero of 
the type, 0 here.
 
 Review comment:
   Should be `serverID`


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186514602
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
 
 Review comment:
   Should be `dsID`


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186514365
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
 
 Review comment:
   Should be `dsID`


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186514365
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
+
+   keys["deliveryservice"] = ds_id
+   keys["server"] = server_id
+   return keys, true
+}
+
+func (dss *TODeliveryServiceServer) GetAuditName() string {
+   if dss.DeliveryService != nil {
+   return strconv.Itoa(*dss.DeliveryService) + "-" + 
strconv.Itoa(*dss.Server)
+   }
+   return "unknown"
+}
+
+func (dss *TODeliveryServiceServer) GetType() string {
+   return "deliveryserviceServers"
+}
+
+func (dss *TODeliveryServiceServer) SetKeys(keys map[string]interface{}) {
+   ds_id, _ := keys["deliveryservice"].(int) //this utilizes the non 
panicking type assertion, if the thrown away ok variable is false i will be the 
zero of the type, 0 here.
 
 Review comment:
   Should be `dsID`


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186514290
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##
 @@ -0,0 +1,340 @@
+package servers
+
+/*
+ * 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.
+ */
+
+import (
+   "errors"
+   "fmt"
+   "strconv"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate"
+   "github.com/go-ozzo/ozzo-validation"
+
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+// TODeliveryServiceRequest provides a type alias to define functions on
+type TODeliveryServiceServer tc.DeliveryServiceServer
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TODeliveryServiceServer(tc.DeliveryServiceServer{})
+
+func GetRefType() *TODeliveryServiceServer {
+   return 
+}
+
+func (dss TODeliveryServiceServer) GetKeyFieldsInfo() []api.KeyFieldInfo {
+   return []api.KeyFieldInfo{{"deliveryservice", api.GetIntKey}, 
{"server", api.GetIntKey}}
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (dss TODeliveryServiceServer) GetKeys() (map[string]interface{}, bool) {
+   if dss.DeliveryService == nil {
+   return map[string]interface{}{"deliveryservice": 0}, false
+   }
+   if dss.Server == nil {
+   return map[string]interface{}{"server": 0}, false
+   }
+   keys := make(map[string]interface{})
+   ds_id := *dss.DeliveryService
+   server_id := *dss.Server
 
 Review comment:
   Go names shouldn't have underscores, should be `dsID`, `serverID`


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 #2228: Added the Get API in Go for the DeliveryserviceServers endpoint

2018-05-07 Thread GitBox
rob05c commented on a change in pull request #2228: Added the Get API in Go for 
the DeliveryserviceServers endpoint
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2228#discussion_r186514141
 
 

 ##
 File path: lib/go-tc/deliveryservice_servers.go
 ##
 @@ -0,0 +1,80 @@
+package tc
+
+import "time"
+
+/*
+
+   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.
+*/
+
+// DeliveryServiceServerResponse ...
+type DeliveryServiceServerResponse struct {
+   Response []DeliveryServiceServer `json:"response"`
+   Size int `json:"size"`
+   OrderBy  string  `json:"orderby"`
+   Limitint `json:"limit"`
+}
+
+// DeliveryServiceServer ...
+type DeliveryServiceServer struct {
+   Server  *int `json:"server"`
+   DeliveryService *int `json:"deliveryService"`
+   LastUpdated *TimeNoMod   `json:"lastUpdated" db:"last_updated"`
+}
+
+
+type DssServer struct {
 
 Review comment:
   Go names should have abbreviations consistently cased (all caps, or all 
lower). This should be `DSSServer`


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


Jenkins build is back to normal : incubator-trafficcontrol-traffic_ops-test #609

2018-05-07 Thread Apache Jenkins Server
See 




Build failed in Jenkins: incubator-trafficcontrol-rat #707

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-master-build" build 
number 751
originally caused by:
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H20 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-rat] $ /bin/bash -xe /tmp/jenkins928020602848665678.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-master-build:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-rat] $ /bin/bash -xe 
/tmp/jenkins8895459586897567516.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ cut -d / -f 12
++ sort -r
++ head -n 1
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.elW8S4YAQT
+ ratjar=/tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0 27 
1587k   27  437k0 0   402k  0  0:00:03  0:00:01  0:00:02  402k100 
1587k  100 1587k0 0  1345k  0  0:00:01  0:00:01 --:--:-- 1345k
+ curl -L -o /tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
010040  100400 0 65  0 --:--:-- --:--:-- --:--:--65
++ sha1sum /tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.elW8S4YAQT/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.elW8S4YAQT
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  

Build failed in Jenkins: incubator-trafficcontrol-PR-rat #811

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1528
originally caused by:
 GitHub pull request #2231 of commit 48b54cd9cbdb001030972922692524a0266f3c73, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H29 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins371032039951844845.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins2981525477145941748.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ awk -F '"' '{print $2}'
++ head -n 1
++ grep -ve md5 -e sha1
++ sort -r
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.PBJCNB4SLq
+ ratjar=/tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
1587k  100 1587k0 0  1311k  0  0:00:01  0:00:01 --:--:-- 1311k
+ curl -L -o /tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 59  0 --:--:-- --:--:-- --:--:--59
++ sha1sum /tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.PBJCNB4SLq/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.PBJCNB4SLq
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  

[GitHub] asfgit commented on issue #2231: Fix TO Go ASNs unit tests for renamed symbols

2018-05-07 Thread GitBox
asfgit commented on issue #2231: Fix TO Go ASNs unit tests for renamed symbols
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2231#issuecomment-387153848
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1528/
   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 issue #2232: Rewrite Traffic Ops CRConfig Table Endpoints in Go

2018-05-07 Thread GitBox
rob05c opened a new issue #2232: Rewrite Traffic Ops CRConfig Table Endpoints 
in Go
URL: https://github.com/apache/incubator-trafficcontrol/issues/2232
 
 
   One of the first steps to Self Service Change Integrity is to change the 
CRConfig to select the latest timestamps for each delivery service, which 
requires all tables queried for the CRConfig `deliveryservices` key 
insert-not-update, which requires those endpoints be written in Go.
   
   The following tables are queried in the CRConfig:
   ```
   cachegroup
   cdn
   deliveryservice
   deliveryservice_regex
   deliveryservice_server
   parameter
   profile
   profile_parameter
   regex
   server
   staticdnsentry
   type
   status
   snapshot
   ```
   
   This case is part of Self Service, and represents the overarching task of 
rewriting those tables in Go; but individual issues and PRs for each table 
should be in https://github.com/apache/incubator-trafficcontrol/projects/5 


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] dewrich closed pull request #2231: Fix TO Go ASNs unit tests for renamed symbols

2018-05-07 Thread GitBox
dewrich closed pull request #2231: Fix TO Go ASNs unit tests for renamed symbols
URL: https://github.com/apache/incubator-trafficcontrol/pull/2231
 
 
   

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/asn/asns_test.go 
b/traffic_ops/traffic_ops_golang/asn/asns_test.go
index 6c500ff1e..ac13975ce 100644
--- a/traffic_ops/traffic_ops_golang/asn/asns_test.go
+++ b/traffic_ops/traffic_ops_golang/asn/asns_test.go
@@ -34,11 +34,11 @@ import (
sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"
 )
 
-func getTestASNs() []TOASN {
-   ASNs := []TOASN{}
+func getTestASNs() []TOASNV11 {
+   ASNs := []TOASNV11{}
i := 1
c := "Yukon"
-   testCase := TOASN{
+   testCase := TOASNV11{
ASN:  ,
Cachegroup:   ,
CachegroupID: ,
@@ -65,7 +65,7 @@ func TestGetASNs(t *testing.T) {
defer db.Close()
 
testCase := getTestASNs()
-   cols := test.ColsFromStructByTag("db", TOASN{})
+   cols := test.ColsFromStructByTag("db", TOASNV11{})
rows := sqlmock.NewRows(cols)
 
for _, ts := range testCase {
@@ -79,7 +79,7 @@ func TestGetASNs(t *testing.T) {
mock.ExpectQuery("SELECT").WillReturnRows(rows)
v := map[string]string{"dsId": "1"}
 
-   asns, errs, _ := refType.Read(db, v, auth.CurrentUser{})
+   asns, errs, _ := GetRefTypeV11().Read(db, v, auth.CurrentUser{})
 
if len(errs) > 0 {
t.Errorf("asn.Read expected: no errors, actual: %v", errs)
@@ -93,7 +93,7 @@ func TestGetASNs(t *testing.T) {
 
 func TestInterfaces(t *testing.T) {
var i interface{}
-   i = {}
+   i = {}
 
if _, ok := i.(api.Creator); !ok {
t.Errorf("asn must be creator")
@@ -114,7 +114,7 @@ func TestInterfaces(t *testing.T) {
 
 func TestValidate(t *testing.T) {
i := -99
-   asn := TOASN{ASN: , CachegroupID: }
+   asn := TOASNV11{ASN: , CachegroupID: }
 
errs := test.SortErrors(asn.Validate(nil))
expected := []error{


 


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 #2231: Fix TO Go ASNs unit tests for renamed symbols

2018-05-07 Thread GitBox
rob05c opened a new pull request #2231: Fix TO Go ASNs unit tests for renamed 
symbols
URL: https://github.com/apache/incubator-trafficcontrol/pull/2231
 
 
   


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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #810

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1527
originally caused by:
 GitHub pull request #2010 of commit a38bf0eeb7880553b9cd4c4ca1d9bbe1add1f3f2, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H27 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins4159323534360833353.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins1248377592823565595.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ awk -F '"' '{print $2}'
++ grep -ve md5 -e sha1
++ sort -r
++ cut -d / -f 12
++ head -n 1
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.S8hdeImtKW
+ ratjar=/tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
3 1587k3 487680 0  65110  0  0:00:24 --:--:--  0:00:24 65110100 
1587k  100 1587k0 0  1348k  0  0:00:01  0:00:01 --:--:-- 1349k
+ curl -L -o /tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 64  0 --:--:-- --:--:-- --:--:--64
++ sha1sum /tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.S8hdeImtKW/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.S8hdeImtKW
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  

[GitHub] asfgit commented on issue #2010: Go login

2018-05-07 Thread GitBox
asfgit commented on issue #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#issuecomment-387114915
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1527/
   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


Build failed in Jenkins: incubator-trafficcontrol-PR-rat #809

2018-05-07 Thread Apache Jenkins Server
See 


--
Started by upstream project "incubator-trafficcontrol-PR" build number 1526
originally caused by:
 GitHub pull request #2010 of commit 36e211819fd2fe4a2a610f24e213e736234eef20, 
no merge conflicts.
[EnvInject] - Loading node environment variables.
Building remotely on H27 (ubuntu xenial) in workspace 

[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins1229619107659564916.sh
+ rm -rf 

 

 '
[operations-center-context] Requesting copy of artifacts matching '**/*.tar.gz' 
from 'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR
[operations-center-context] Copied 1 artifacts matching '**/*.tar.gz' from 
'Last successful build (either stable or unstable)' of 
incubator-trafficcontrol-PR:
[operations-center-context]   apache-trafficcontrol-2.3.0-incubating.tar.gz
[incubator-trafficcontrol-PR-rat] $ /bin/bash -xe 
/tmp/jenkins1842618990933972028.sh
+ set -exu
++ ls apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tarball=apache-trafficcontrol-2.3.0-incubating.tar.gz
+ tar xzf apache-trafficcontrol-2.3.0-incubating.tar.gz
++ pwd
++ basename apache-trafficcontrol-2.3.0-incubating.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2018 The Apache Software Foundation' NOTICE
Copyright 2016-2018 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ sort -r
++ head -n 1
++ cut -d / -f 12
+ ratver=apache-rat-0.13-20180329.151017-101.jar
++ mktemp -d
+ ratdir=/tmp/tmp.UI73NSLTa7
+ ratjar=/tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar
+ curl -L -o /tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
1587k  100 1587k0 0  1354k  0  0:00:01  0:00:01 --:--:-- 1355k
+ curl -L -o /tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.13-SNAPSHOT/apache-rat-0.13-20180329.151017-101.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0100 
   40  100400 0 60  0 --:--:-- --:--:-- --:--:--60
++ sha1sum /tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar.sha1
+ [[ 635c5eccad31cff1d713c12144eaae7fc9f10cf4 == 
635c5eccad31cff1d713c12144eaae7fc9f10cf4 ]]
++ pwd
++ pwd
+ java -jar /tmp/tmp.UI73NSLTa7/apache-rat-0.13.SNAPSHOT.jar -E 

 -d 

+ rm -rf /tmp/tmp.UI73NSLTa7
++ perl -lne 'print $1 if /(\d+) Unknown Licenses/' ratreport.txt
+ unknown=56
+ [[ 56 != 0 ]]
+ echo '56 Unknown Licenses'
56 Unknown Licenses
+ perl -lne 'print if /Files with unapproved licenses:/ .. /^\*\*\*/' 
ratreport.txt
+ sed s:::
Files with unapproved licenses:

  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes.go
  
apache-trafficcontrol-2.3.0-incubating/grove/vendor/code.cloudfoundry.org/bytefmt/bytes_test.go
  

[GitHub] asfgit commented on issue #2010: Go login

2018-05-07 Thread GitBox
asfgit commented on issue #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#issuecomment-387112785
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1526/
   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 issue #2230: Portal Servers page is missing Traffic Monitor link

2018-05-07 Thread GitBox
rob05c opened a new issue #2230: Portal Servers page is missing Traffic Monitor 
link
URL: https://github.com/apache/incubator-trafficcontrol/issues/2230
 
 
   The old UI has a button on Traffic Monitor Server rows, that links to that 
monitor's FQDN (web GUI).
   
   The Portal has no easy way to navigate to the monitor's webpage. I have to 
copy the host name, paste it somewhere, copy the domain, paste it in the same 
place, copy the entire FQDN, and paste it in the browser.
   
   IMO it would be a good feature if the Portal had a link to the FQDN of every 
server. Or at the very least, displayed the full text that could be copied, 
which is two steps instead of like five. I frequently do the same with caches 
to see astats in the browser. And even if a server doesn't have a web UI (like 
Riak), you still need to copy the FQDN to paste into the command line, to hit 
the API.
   
   Labelling bug, because it's in the old UI and not the new.


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] Vijay-1 commented on issue #2029: [Issue 1907] TO API for backup edge cachegroup

2018-05-07 Thread GitBox
Vijay-1 commented on issue #2029: [Issue 1907] TO API for backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#issuecomment-386972753
 
 
   @mitchell852 @elsloo 
   Will upload the changes in couple of days. Caught up in some thing else. 


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