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

Side by Side Diff: ui/webui/resources/PRESUBMIT.py

Issue 2129793002: Add closure_compilation to `git cl try` for CLs that touch resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slaves -> masters Created 4 years, 5 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
« no previous file with comments | « chrome/browser/resources/PRESUBMIT.py ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 re 5 import re
6 6
7 7
8 def PostUploadHook(cl, change, output_api): 8 def PostUploadHook(cl, change, output_api):
9 rietveld_obj = cl.RpcServer() 9 rietveld_obj = cl.RpcServer()
10 description = rietveld_obj.get_description(cl.issue) 10 description = rietveld_obj.get_description(cl.issue)
11 11
12 existing_bots = (change.CQ_INCLUDE_TRYBOTS or '').split(';') 12 existing_bots = (change.CQ_INCLUDE_TRYBOTS or '').split(';')
13 clean_bots = set(filter(None, map(lambda s: s.strip(), existing_bots))) 13 clean_bots = set(filter(None, map(lambda s: s.strip(), existing_bots)))
14 new_bots = clean_bots | set(['tryserver.chromium.linux:closure_compilation']) 14 new_bots = clean_bots | set(['tryserver.chromium.linux:closure_compilation'])
15 new_tag = 'CQ_INCLUDE_TRYBOTS=%s' % ';'.join(new_bots) 15 new_tag = 'CQ_INCLUDE_TRYBOTS=%s' % ';'.join(new_bots)
16 16
17 if clean_bots: 17 if clean_bots:
18 tag_reg = '^CQ_INCLUDE_TRYBOTS=.*$' 18 tag_reg = '^CQ_INCLUDE_TRYBOTS=.*$'
19 new_description = re.sub(tag_reg, new_tag, description, flags=re.M | re.I) 19 new_description = re.sub(tag_reg, new_tag, description, flags=re.M | re.I)
20 else: 20 else:
21 new_description = description + '\n' + new_tag 21 new_description = description + '\n' + new_tag
22 22
23 if new_description == description: 23 if new_description == description:
24 return [] 24 return []
25 25
26 rietveld_obj.update_description(cl.issue, new_description) 26 rietveld_obj.update_description(cl.issue, new_description)
27 return [output_api.PresubmitNotifyResult( 27 return [output_api.PresubmitNotifyResult(
28 'Automatically added optional Closure bots to run on CQ.')] 28 'Automatically added optional Closure bots to run on CQ.')]
29
30
31 def GetPreferredTryMasters(project, change):
32 return {
33 'tryserver.chromium.linux': {
34 'closure_compilation': set(['defaulttests']),
35 },
36 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698