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

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

Issue 2181533002: Refactoring: Merge TryJob and Build class and move Build class to buildbot module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 9cb59ef3a19af5d497886dfa4ef5c536c7513675..9d276cc98237bfa746e0f423ca0bc006a851abf7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
@@ -9,15 +9,16 @@ import json
import logging
import urllib2
+from webkitpy.common.net.buildbot import Build
+
_log = logging.getLogger(__name__)
BASE_CODEREVIEW_URL = 'https://codereview.chromium.org/api'
-TryJob = collections.namedtuple('TryJob', ('builder_name', 'build_number'))
def latest_try_jobs(issue_number, builder_names, web, patchset_number=None):
- """Returns a list of TryJob objects for jobs on the latest patchset.
+ """Returns a list of Build objects for jobs on the latest patchset.
Args:
issue_number: A Rietveld issue number.
@@ -27,7 +28,7 @@ def latest_try_jobs(issue_number, builder_names, web, patchset_number=None):
patchset_number: Use a specific patchset instead of the latest one.
Returns:
- A list of TryJob objects for the latest job for each builder, on the
+ A list of Build objects for the latest job for each builder, on the
latest patchset. If none were found, an empty list is returned.
"""
try:
@@ -42,7 +43,7 @@ def latest_try_jobs(issue_number, builder_names, web, patchset_number=None):
for job in patchset_data['try_job_results']:
if job['builder'] not in builder_names:
continue
- jobs.append(TryJob(
+ jobs.append(Build(
builder_name=job['builder'],
build_number=job['buildnumber']))
return filter_latest_jobs(jobs)
@@ -85,10 +86,10 @@ def filter_latest_jobs(jobs):
"""Filters out the list of jobs to include only the latest for each builder.
Args:
- jobs: A list of TryJob objects.
+ jobs: A list of Build objects.
Returns:
- A list of TryJob objects such that only the latest job for each builder
+ A list of Build objects such that only the latest job for each builder
is kept.
"""
builder_to_highest_number = {}

Powered by Google App Engine
This is Rietveld 408576698