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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py

Issue 2105043004: Add get_latest_try_jobs_results to rietveld.py to fetch results of try jobs from rietveld (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
index 9411f7c1feb82c1decd385ca5df2bb8e8ebdb147..1bea9e264d0b85248143f629579ee2c0ac25a7e5 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
@@ -15,7 +15,7 @@ _log = logging.getLogger(__name__)
BASE_CODEREVIEW_URL = 'https://codereview.chromium.org/api'
TryJob = collections.namedtuple('TryJob', ('builder_name', 'master_name', 'build_number'))
-
+TryJobResults = collections.namedtuple('TryJob', ('builder_name', 'result'))
qyearsley 2016/06/29 17:37:56 Since it represents one single job's result, TryJo
def latest_try_jobs(issue_number, builder_names, web, patchset_number=None):
"""Returns a list of TryJob objects for jobs on the latest patchset.
@@ -80,3 +80,14 @@ def _issue_url(issue_number):
def _patchset_url(issue_number, patchset_number):
return '%s/%s' % (_issue_url(issue_number), patchset_number)
+
+
+def get_latest_tryjob_results(issue_number, web):
qyearsley 2016/06/29 17:37:56 In the official documentation, "try job" is two wo
+ url = _latest_patchset_url(issue_number, web)
+ patchset_data = _get_json(url, web)
+ results = []
+ for job in patchset_data['try_job_results']:
+ results.append(TryJobResults(
+ builder_name=job['builder'],
+ result=job['result']))
+ return results
qyearsley 2016/06/29 17:37:56 Alternatively, if you are just having builders and
« 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