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

Unified Diff: ui/webui/resources/PRESUBMIT.py

Issue 1923783002: Include Closure Compiler in CQ bots for various resource directories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asdf Created 4 years, 8 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
« no previous file with comments | « chrome/browser/resources/PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/PRESUBMIT.py
diff --git a/ui/webui/resources/PRESUBMIT.py b/ui/webui/resources/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..2ac87faf2b09787c19200dad102e395811d7661e
--- /dev/null
+++ b/ui/webui/resources/PRESUBMIT.py
@@ -0,0 +1,28 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import re
+
+
+def PostUploadHook(cl, change, output_api):
+ rietveld_obj = cl.RpcServer()
+ description = rietveld_obj.get_description(cl.issue)
+
+ existing_bots = (change.CQ_INCLUDE_TRYBOTS or '').split(';')
+ clean_bots = set(filter(None, map(lambda s: s.strip(), existing_bots)))
+ new_bots = clean_bots | set(['tryserver.chromium.linux:closure_compilation'])
+ new_tag = 'CQ_INCLUDE_TRYBOTS=%s' % ';'.join(new_bots)
+
+ if clean_bots:
+ tag_reg = '^CQ_INCLUDE_TRYBOTS=.*$'
+ new_description = re.sub(tag_reg, new_tag, description, flags=re.M | re.I)
+ else:
+ new_description = description + '\n' + new_tag
+
+ if new_description == description:
+ return []
+
+ rietveld_obj.update_description(cl.issue, new_description)
+ return [output_api.PresubmitNotifyResult(
+ 'Automatically added optional Closure bots to run on CQ.')]
« 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