Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: tools/gn/bin/roll_gn.py

Issue 2819853003: Update GN roller for new JSON endpoints. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/bin/roll_gn.py
diff --git a/tools/gn/bin/roll_gn.py b/tools/gn/bin/roll_gn.py
index 91dad7e6acb75ae8001c10b90988c1b4fab5f439..318c9d881e7d6e2cc570eaf75a5d0d03c36619a4 100755
--- a/tools/gn/bin/roll_gn.py
+++ b/tools/gn/bin/roll_gn.py
@@ -186,8 +186,7 @@ class GNRoller(object):
print('Checking build')
results = self.CheckBuild()
- while (len(results) < 3 or
- any(r['state'] in ('pending', 'started')
+ while (any(r['state'] in ('pending', 'started')
for r in results.values())):
print()
print('Sleeping for 30 seconds')
@@ -229,7 +228,8 @@ class GNRoller(object):
try:
props = json.loads(rpc_server.Send('/api/%d' % issue))
except Exception as _e:
hinoka 2017/04/18 19:04:43 s/_e/e/
Dirk Pranke 2017/04/18 19:21:33 Er, right. Will fix.
- raise
+ print('Failed to load patch data: %s' % e)
+ return {}
patchset = int(props['patchsets'][-1])
@@ -237,7 +237,8 @@ class GNRoller(object):
try_job_results = json.loads(rpc_server.Send(
'/api/%d/%d/try_job_results' % (issue, patchset)))
except Exception as _e:
hinoka 2017/04/18 19:04:43 s/_e/e/
Dirk Pranke 2017/04/18 19:21:33 Ditto.
- raise
+ print('Failed to load try job results: %s' % e)
+ return {}
if not try_job_results:
print('No try jobs found on most recent patchset')
@@ -266,8 +267,15 @@ class GNRoller(object):
results.setdefault(platform, {'build': -1, 'sha1': '', 'url': url_str})
if state == 'success':
- jsurl = url_str.replace('/builders/', '/json/builders/')
- fp = urllib2.urlopen(jsurl)
+ jsurl = url_str.replace('http://build.chromium.org/',
+ 'http://chrome-build-extract.appspot.com/')
hinoka 2017/04/18 19:04:43 This is for querying a build right? This endpoint
Dirk Pranke 2017/04/18 19:21:33 Yes, this is for querying individual builds. You c
+ jsurl = jsurl + '?json=1'
+ try:
+ fp = urllib2.urlopen(jsurl)
+ except urllib2.HTTPError as e:
+ print('Failed to open %s: %s' % (jsurl, e))
+ return {}
+
js = json.loads(fp.read())
fp.close()
sha1_step_name = 'gn sha1'
@@ -460,7 +468,7 @@ class GNRoller(object):
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
cwd=(cwd or self.chromium_src_dir))
out, err = proc.communicate()
- return proc.returncode, out, err
+ return proc.returncode, out or '', err or ''
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698