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

Unified Diff: third_party/WebKit/LayoutTests/imported/PRESUBMIT.py

Issue 2512563002: Add WPTEXPORT footer automatically in DepsUpdater and imported/PRESUBMIT (Closed)
Patch Set: Created 4 years, 1 month 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
Index: third_party/WebKit/LayoutTests/imported/PRESUBMIT.py
diff --git a/third_party/WebKit/LayoutTests/imported/PRESUBMIT.py b/third_party/WebKit/LayoutTests/imported/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..953e74b69193cb0ac4f35a70ab31cd17fcf7179f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/PRESUBMIT.py
@@ -0,0 +1,25 @@
+# Copyright (c) 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): # pylint: disable=C0103
qyearsley 2016/11/17 00:23:27 For pylint disable pragma, you can use the symboli
+ """git cl upload will call this hook after the issue is created/modified.
foolip 2016/11/17 09:59:14 What about things in LT/imported/csswg-tests and w
jeffcarp 2016/11/17 20:49:58 Yeah it sounds possible to filter those out (in th
+
+ This hook adds WPTEXPORT=true to a CL if it doesn't already exist. This is
foolip 2016/11/17 09:59:14 Whether this is useful depends on what you intend
qyearsley 2016/11/17 17:44:50 I think I'd expect that the default would be for t
jeffcarp 2016/11/17 20:49:58 That sounds like a cleaner way of implementing thi
foolip 2016/11/17 20:52:34 Yeah, that sounds good. I was thinking WPTEXPORT=f
+ to better help the WPT export script identify exportable commits.
qyearsley 2016/11/17 00:23:27 The second sentence could be changed to note what
+ """
+ rietveld_obj = cl.RpcServer()
+ description = rietveld_obj.get_description(cl.issue)
+ if re.search(r'^WPTEXPORT=.+', description, re.M | re.I):
+ return []
+
+ new_description = description
+ new_description += '\nWPTEXPORT=true'
+ rietveld_obj.update_description(cl.issue, new_description)
+
+ return [output_api.PresubmitNotifyResult((
+ 'Automatically added WPTEXPORT=true flag due to files being modified '
+ 'in LayoutTests/imported and no existing WPTEXPORT flag found.'))]

Powered by Google App Engine
This is Rietveld 408576698