Bug 1279534 - Update wpt log fetching script for treeherder changes, r=wlach draft
authorJames Graham <james@hoppipolla.co.uk>
Fri, 10 Jun 2016 13:16:56 +0100
changeset 377529 9618722194beceabccac6ec6e73919764cee04c9
parent 377528 a97309267ea3b71bff94787326a048c94822cdf7
child 523370 ad62aa8086f19942af0537c7acf2c0d0f30581e7
push id20813
push userbmo:james@hoppipolla.co.uk
push dateFri, 10 Jun 2016 15:26:35 +0000
reviewerswlach
bugs1279534
milestone50.0a1
Bug 1279534 - Update wpt log fetching script for treeherder changes, r=wlach MozReview-Commit-ID: J52eCZJUp6Q
testing/web-platform/update/fetchlogs.py
--- a/testing/web-platform/update/fetchlogs.py
+++ b/testing/web-platform/update/fetchlogs.py
@@ -57,30 +57,26 @@ def fetch_json(url, params=None):
         'User-Agent': 'wpt-fetchlogs',
     }
     response = requests.get(url=url, params=params, headers=headers, timeout=30)
     response.raise_for_status()
     return response.json()
 
 
 def get_blobber_url(branch, job):
-    job_id = job["id"]
-    artifact_url = urlparse.urljoin(treeherder_base, "/api/project/%s/artifact/" % branch)
+    job_guid = job["job_guid"]
+    artifact_url = urlparse.urljoin(treeherder_base, "/api/jobdetail/")
     artifact_params = {
-        'job_id': job_id,
-        'name': 'Job Info',
+        'job__guid': job_guid,
     }
     job_data = fetch_json(artifact_url, params=artifact_params)
 
     if job_data:
-        assert len(job_data) == 1
-        job_data = job_data[0]
         try:
-            details = job_data["blob"]["job_details"]
-            for item in details:
+            for item in job_data["results"]:
                 if item["value"] == "wpt_raw.log":
                     return item["url"]
         except:
             return None
 
 
 def get_structured_logs(branch, commit, dest=None):
     resultset_url = urlparse.urljoin(treeherder_base, "/api/project/%s/resultset/" % branch)