Diff
Modified: trunk/Tools/ChangeLog (275671 => 275672)
--- trunk/Tools/ChangeLog 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/ChangeLog 2021-04-08 20:02:54 UTC (rev 275672)
@@ -1,5 +1,20 @@
2021-04-08 Aakash Jain <[email protected]>
+ Add webkit-patch support for fast-cq mode
+ https://bugs.webkit.org/show_bug.cgi?id=224286
+
+ Reviewed by Jonathan Bedard.
+
+ * Scripts/webkitpy/tool/steps/options.py:
+ (Options): Added --fast-cq parameter.
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ (PostDiff.options):
+ (PostDiff.run): Set the patch name appropriately for fast-cq mode.
+ * Scripts/webkitpy/common/net/bugzilla/attachment.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py: Added unit test.
+
+2021-04-08 Aakash Jain <[email protected]>
+
EWS should keep working when Bugzilla is down
https://bugs.webkit.org/show_bug.cgi?id=224336
Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/attachment.py (275671 => 275672)
--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/attachment.py 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/attachment.py 2021-04-08 20:02:54 UTC (rev 275672)
@@ -1,5 +1,5 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
-# Copyright (c) 2009, 2018 Apple Inc. All rights reserved.
+# Copyright (c) 2009-2021 Apple Inc. All rights reserved.
# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
class Attachment(object):
+ fast_cq_preamble = "[fast-cq] "
revert_preamble = "REVERT of r"
rollout_preamble = "ROLLOUT of r"
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (275671 => 275672)
--- trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2021-04-08 20:02:54 UTC (rev 275672)
@@ -67,6 +67,7 @@
options.check_style_filter = None
options.comment = None
options.description = "MOCK description"
+ options.fast_cq = False
options.non_interactive = False
options.request_commit = False
options.review = True
@@ -149,6 +150,7 @@
options.check_style_filter = None
options.comment = None
options.description = "MOCK description"
+ options.fast_cq = False
options.non_interactive = False
options.request_commit = False
options.review = True
@@ -164,6 +166,29 @@
"""
self.assert_execute_outputs(Upload(), [50000], options=options, expected_logs=expected_logs)
+ def test_upload_fast_cq(self):
+ options = MockOptions()
+ options.cc = None
+ options.check_style = True
+ options.check_style_filter = None
+ options.comment = None
+ options.description = "MOCK description"
+ options.fast_cq = True
+ options.non_interactive = False
+ options.request_commit = False
+ options.review = True
+ options.submit_to_ews = False
+ options.sort_xcode_project = False
+ options.suggest_reviewers = False
+ expected_logs = """MOCK: user.open_url: file://...
+Was that diff correct?
+Obsoleting 2 old patches on bug 50000
+MOCK reassign_bug: bug_id=50000, assignee=None
+MOCK add_patch_to_bug: bug_id=50000, description=[fast-cq] MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
+MOCK: user.open_url: http://example.com/50000
+"""
+ self.assert_execute_outputs(Upload(), [50000], options=options, expected_logs=expected_logs)
+
def test_upload_with_no_review_and_ews(self):
options = MockOptions()
options.cc = None
@@ -171,6 +196,7 @@
options.check_style_filter = None
options.comment = None
options.description = 'MOCK description'
+ options.fast_cq = False
options.non_interactive = False
options.request_commit = False
options.review = False
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/options.py (275671 => 275672)
--- trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2021-04-08 20:02:54 UTC (rev 275672)
@@ -1,5 +1,5 @@
# Copyright (C) 2010 Google Inc. All rights reserved.
-# Copyright (C) 2017 Apple Inc. All rights reserved.
+# Copyright (C) 2017-2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -48,6 +48,7 @@
description = make_option("-m", "--description", action="" type="string", dest="description", help="Description string for the attachment")
email = make_option("--email", action="" type="string", dest="email", help="Email address to use in ChangeLogs.")
ews = make_option('--no-ews', action='', dest='ews', default=True, help='Do not submit the patch to EWS for analysis (only applies when using --no-review).')
+ fast_cq = make_option("--fast-cq", "--fast-commit-queue", "--fastcq", action='', dest='fast_cq', default=False, help='Enable fast-commit-queue mode for this patch, that skips building and testing.')
force_clean = make_option("--force-clean", action="" dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
git_commit = make_option("-g", "--git-commit", action="" dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. <ref>.... includes the working copy changes. UPSTREAM can be used for the upstream/tracking branch.")
group = make_option("--group", action="" dest="group", default=None, help="")
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/postdiff.py (275671 => 275672)
--- trunk/Tools/Scripts/webkitpy/tool/steps/postdiff.py 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/postdiff.py 2021-04-08 20:02:54 UTC (rev 275672)
@@ -1,4 +1,5 @@
# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -26,6 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from webkitpy.common.net.bugzilla import Attachment
from webkitpy.tool.steps.abstractstep import AbstractStep
from webkitpy.tool.steps.options import Options
@@ -40,6 +42,7 @@
Options.request_commit,
Options.open_bug,
Options.ews,
+ Options.fast_cq,
]
def run(self, state):
@@ -47,6 +50,8 @@
description = self._options.description or "Patch"
comment_text = self._options.comment
bug_id = state["bug_id"]
+ if self._options.fast_cq:
+ description = '{}{}'.format(Attachment.fast_cq_preamble, description)
attachment_id = self._tool.bugs.add_patch_to_bug(bug_id, diff, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
if self._options.open_bug:
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py (275671 => 275672)
--- trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py 2021-04-08 20:02:01 UTC (rev 275671)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py 2021-04-08 20:02:54 UTC (rev 275672)
@@ -84,6 +84,7 @@
options = self._step_options()
options.git_commit = None
options.description = None
+ options.fast_cq = False
options.comment = None
options.review = True
options.request_commit = False