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

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

Issue 2692423005: rebaseline-cl: Get latest try jobs using git-cl when no --issue given. (Closed)
Patch Set: Rebased Created 3 years, 10 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 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py » ('j') | 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/buildbot.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
index bab2b1cb1ab3ccaa8096bdda13751c06f49c3701..b83c2f32b684686e2ce1e0a3e5fb315acc00699b 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
@@ -130,3 +130,23 @@ def current_build_link(host):
if not (master_name and builder_name and build_number):
return None
return 'https://build.chromium.org/p/%s/builders/%s/builds/%s' % (master_name, builder_name, build_number)
+
+
+def filter_latest_builds(builds):
+ """Filters Build objects to include only the latest for each builder.
+
+ Args:
+ builds: A collection of Build objects.
+
+ Returns:
+ A list of Build objects; only one Build object per builder name. If
+ there are only Builds with no build number, then one is kept; if there
+ are Builds with build numbers, then the one with the highest build
+ number is kept.
+ """
+ latest_builds = {}
+ for build in builds:
+ builder = build.builder_name
+ if builder not in latest_builds or build.build_number > latest_builds[builder].build_number:
+ latest_builds[builder] = build
+ return sorted(latest_builds.values())
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698