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

Side by Side Diff: scripts/master/try_job_gerrit.py

Issue 259323003: Gerrit tryjob: !tryjob can be anywhere (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Any message may have !tryjob Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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('!tryjob(.*)$', re.I)
59 59
60 def __init__(self, scheduler, gerrit_host, gerrit_projects=None, 60 def __init__(self, scheduler, gerrit_host, gerrit_projects=None,
61 pollInterval=None): 61 pollInterval=None):
62 assert scheduler 62 assert scheduler
63 GerritPoller.__init__(self, gerrit_host, gerrit_projects, pollInterval) 63 GerritPoller.__init__(self, gerrit_host, gerrit_projects, pollInterval)
64 self.scheduler = scheduler 64 self.scheduler = scheduler
65 65
66 def _is_interesting_message(self, message): 66 def _is_interesting_message(self, message):
67 return self.MESSAGE_REGEX_TRYJOB.match(message['message']) 67 return self.MESSAGE_REGEX_TRYJOB.match(message['message'])
68 68
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 @defer.inlineCallbacks 122 @defer.inlineCallbacks
123 def submitJob(self, change, job): 123 def submitJob(self, change, job):
124 bsid = yield self.addBuildsetForChanges( 124 bsid = yield self.addBuildsetForChanges(
125 reason='tryjob', 125 reason='tryjob',
126 changeids=[change.number], 126 changeids=[change.number],
127 builderNames=job.builder_names, 127 builderNames=job.builder_names,
128 properties=change.properties) 128 properties=change.properties)
129 log.msg('Successfully submitted a Gerrit try job for %s: %s.' % 129 log.msg('Successfully submitted a Gerrit try job for %s: %s.' %
130 (change.who, job)) 130 (change.who, job))
131 defer.returnValue(bsid) 131 defer.returnValue(bsid)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698