Chromium Code Reviews| Index: rietveld.py |
| diff --git a/rietveld.py b/rietveld.py |
| index 9dfe8892b610dfca7c1707c47605e1f841da15e8..a87dbbd0fcde6f557f1fb8e989df29cf234111c7 100644 |
| --- a/rietveld.py |
| +++ b/rietveld.py |
| @@ -331,22 +331,28 @@ 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, masters): |
|
Paweł Hajdan Jr.
2014/02/27 02:20:24
CQ relies on trigger_try_jobs working the way it w
Michael Achenbach
2014/02/27 18:35:23
Done. As soon as CQ is going to call the new metho
|
| """Requests new try jobs. |
| - |builders_and_tests| is a map of builders: [tests] to run. |
| + |masters| is a map of masters: map of builders: [tests] to run. |
| Returns the keys of the new TryJobResult entites. |
| """ |
| - params = [ |
| - ('reason', reason), |
| - ('clobber', 'True' if clobber else 'False'), |
| - ('builders', json.dumps(builders_and_tests)), |
| - ('xsrf_token', self.xsrf_token()), |
| - ] |
| - if revision: |
| - params.append(('revision', revision)) |
| - return self.post('/%d/try/%d' % (issue, patchset), params) |
| + for (master, builders_and_tests) in masters.iteritems(): |
| + params = [ |
| + ('reason', reason), |
| + ('clobber', 'True' if clobber else 'False'), |
| + ('builders', json.dumps(builders_and_tests)), |
| + ('xsrf_token', self.xsrf_token()), |
| + ] |
| + 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)) |
| + self.post('/%d/try/%d' % (issue, patchset), params) |
| def get_pending_try_jobs(self, cursor=None, limit=100): |
| """Retrieves the try job requests in pending state. |
| @@ -539,6 +545,6 @@ 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, masters): |
| logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| - (builders_and_tests, issue)) |
| + (masters, issue)) |