Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 import re | 6 import re |
| 7 | 7 |
| 8 from twisted.internet import defer | 8 from twisted.internet import defer |
| 9 from twisted.python import log | 9 from twisted.python import log |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 | 48 |
| 49 class _TryJobGerritPoller(GerritPoller): | 49 class _TryJobGerritPoller(GerritPoller): |
| 50 """Polls issues, creates changes and calls scheduler.submitJob. | 50 """Polls issues, creates changes and calls scheduler.submitJob. |
| 51 | 51 |
| 52 This class is a part of TryJobGerritScheduler implementation and not designed | 52 This class is a part of TryJobGerritScheduler implementation and not designed |
| 53 to be used otherwise. | 53 to be used otherwise. |
| 54 """ | 54 """ |
| 55 | 55 |
| 56 change_category = 'tryjob' | 56 change_category = 'tryjob' |
| 57 | 57 |
| 58 MESSAGE_REGEX_TRYJOB = re.compile('Patch set \d+:\s+\!tryjob(.*)', re.I) | 58 MESSAGE_REGEX_TRYJOB = re.compile('Patch set \d+:( Tryjob\+1)?\s+!tryjob(.*)', |
|
Vadim Sh.
2014/04/29 21:36:49
Take care of Code-Review and Verified labels too t
nodir
2014/04/29 21:49:46
They shouldn't.
| |
| 59 re.I) | |
| 59 | 60 |
| 60 def __init__(self, scheduler, gerrit_host, gerrit_projects=None, | 61 def __init__(self, scheduler, gerrit_host, gerrit_projects=None, |
| 61 pollInterval=None): | 62 pollInterval=None): |
| 62 assert scheduler | 63 assert scheduler |
| 63 GerritPoller.__init__(self, gerrit_host, gerrit_projects, pollInterval) | 64 GerritPoller.__init__(self, gerrit_host, gerrit_projects, pollInterval) |
| 64 self.scheduler = scheduler | 65 self.scheduler = scheduler |
| 65 | 66 |
| 66 def _is_interesting_message(self, message): | 67 def _is_interesting_message(self, message): |
| 67 return self.MESSAGE_REGEX_TRYJOB.match(message['message']) | 68 return self.MESSAGE_REGEX_TRYJOB.match(message['message']) |
| 68 | 69 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 @defer.inlineCallbacks | 123 @defer.inlineCallbacks |
| 123 def submitJob(self, change, job): | 124 def submitJob(self, change, job): |
| 124 bsid = yield self.addBuildsetForChanges( | 125 bsid = yield self.addBuildsetForChanges( |
| 125 reason='tryjob', | 126 reason='tryjob', |
| 126 changeids=[change.number], | 127 changeids=[change.number], |
| 127 builderNames=job.builder_names, | 128 builderNames=job.builder_names, |
| 128 properties=change.properties) | 129 properties=change.properties) |
| 129 log.msg('Successfully submitted a Gerrit try job for %s: %s.' % | 130 log.msg('Successfully submitted a Gerrit try job for %s: %s.' % |
| 130 (change.who, job)) | 131 (change.who, job)) |
| 131 defer.returnValue(bsid) | 132 defer.returnValue(bsid) |
| OLD | NEW |