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

Unified Diff: appengine/findit/waterfall/swarming_util.py

Issue 2394013002: [Findit] Hacky solution to map a CQ trybot step to a Waterfall buildbot step. (Closed)
Patch Set: fix nit. Created 4 years, 2 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: appengine/findit/waterfall/swarming_util.py
diff --git a/appengine/findit/waterfall/swarming_util.py b/appengine/findit/waterfall/swarming_util.py
index 57766f3b0cd231620e7bf105e94bf6eecfbb2e95..14c37739c1a52f409782d84bb12515b665de20b3 100644
--- a/appengine/findit/waterfall/swarming_util.py
+++ b/appengine/findit/waterfall/swarming_util.py
@@ -87,16 +87,22 @@ def TriggerSwarmingTask(request, http_client):
def ListSwarmingTasksDataByTags(
- master_name, builder_name, build_number, http_client, step_name=None):
- """Downloads tasks data from swarming server."""
+ master_name, builder_name, build_number, http_client,
+ additional_tag_filters=None):
+ """Downloads tasks data from swarming server.
+
+ Args:
+ additional_tag_filters(dict): More tag filters to be added.
chanli 2016/10/07 01:04:52 Nit: add other args as well?
stgao 2016/10/07 01:19:33 Done.
+ """
base_url = ('https://%s/_ah/api/swarming/v1/tasks/'
'list?tags=%s&tags=%s&tags=%s') % (
waterfall_config.GetSwarmingSettings().get('server_host'),
urllib.quote('master:%s' % master_name),
urllib.quote('buildername:%s' % builder_name),
urllib.quote('buildnumber:%d' % build_number))
- if step_name:
- base_url += '&tags=%s' % urllib.quote('stepname:%s' % step_name)
+ additional_tag_filters = additional_tag_filters or {}
+ for tag_name, tag_value in additional_tag_filters.iteritems():
+ base_url += '&tags=%s' % urllib.quote('%s:%s' % (tag_name, tag_value))
items = []
cursor = None
@@ -202,7 +208,7 @@ def GetIsolatedDataForStep(
"""Returns the isolated data for a specific step."""
step_isolated_data = []
data = ListSwarmingTasksDataByTags(master_name, builder_name, build_number,
- http_client, step_name)
+ http_client, {'stepname': step_name})
if not data:
return step_isolated_data

Powered by Google App Engine
This is Rietveld 408576698