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

Unified Diff: rietveld.py

Issue 178223016: Support multiple try masters when sending tries to rietveld. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: More review. Created 6 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
Index: rietveld.py
diff --git a/rietveld.py b/rietveld.py
index aab8e501491f33cec7666704ea92ef469a10a935..aad998e9c3e49d922ca38317c0e9c1381d88885a 100644
--- a/rietveld.py
+++ b/rietveld.py
@@ -331,10 +331,12 @@ class Rietveld(object):
cursor = '&cursor=%s' % data['cursor']
def trigger_try_jobs(
- self, issue, patchset, reason, clobber, revision, builders_and_tests):
+ self, issue, patchset, reason, clobber, revision, builders_and_tests,
+ master=None):
"""Requests new try jobs.
|builders_and_tests| is a map of builders: [tests] to run.
+ |master| is the name of the try master the builders belong to.
Returns the keys of the new TryJobResult entites.
"""
@@ -346,8 +348,24 @@ class Rietveld(object):
]
if revision:
params.append(('revision', revision))
+ if master:
+ # Temporarily allow empty master names for old configurations. The try
+ # job will not be associated with a master name on rietveld. This is
+ # going to be deprecated.
+ params.append(('master', master))
return self.post('/%d/try/%d' % (issue, patchset), params)
+ def trigger_distributed_try_jobs(
+ self, issue, patchset, reason, clobber, revision, masters):
+ """Requests new try jobs.
+
+ |masters| is a map of masters: map of builders: [tests] to run.
+ """
+ for (master, builders_and_tests) in masters.iteritems():
+ self.trigger_try_jobs(
+ issue, patchset, reason, clobber, revision, builders_and_tests,
+ master)
+
def get_pending_try_jobs(self, cursor=None, limit=100):
"""Retrieves the try job requests in pending state.
@@ -539,6 +557,12 @@ class ReadOnlyRietveld(object):
ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value
def trigger_try_jobs( # pylint:disable=R0201
- self, issue, patchset, reason, clobber, revision, builders_and_tests):
+ self, issue, patchset, reason, clobber, revision, builders_and_tests,
+ master=None):
logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
(builders_and_tests, issue))
+
+ def trigger_distributed_try_jobs( # pylint:disable=R0201
+ self, issue, patchset, reason, clobber, revision, masters):
+ logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
+ (masters, issue))
« no previous file with comments | « presubmit_support.py ('k') | tests/presubmit_unittest.py » ('j') | tests/presubmit_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698