chetanmeh commented on a change in pull request #3848: Adjust citool to work 
with Travis build matrix.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3848#discussion_r201222791
 
 

 ##########
 File path: tools/build/citool
 ##########
 @@ -130,14 +135,25 @@ def getTravisHeaders():
 def getJobUrl(args):
     if args.build.lower() == 'travis':
         # Get build information
-        buildUrl = '%s/builds/%s' % (args.url, args.job)
+        parts = args.job.split('.')
+        jobid = parts[0]
+        if len(parts) > 2:
+            print('Job is malformed')
+            exit(-1)
+        matrix = -1 if len(parts) == 1 else parts[1]
+        try:
+            matrix = int(matrix)
+        except Exception:
+            print('Matrix id is not an integer as expected')
+
+        buildUrl = '%s/builds/%s' % (args.url, jobid)
         buildRes = request('get', buildUrl, headers = getTravisHeaders(), 
verbose = args.verbose)
         body = validateResponse(buildRes)
         try:
             body = json.loads(body)
-            job = body['build']['job_ids'][-1]
+            job = body['build']['job_ids'][matrix]
 
 Review comment:
   It should be `matrix-1` as the matrix number start with 1 while job array is 
zero based.

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

Reply via email to