Title: [237037] trunk/Tools
Revision
237037
Author
[email protected]
Date
2018-10-11 10:32:31 -0700 (Thu, 11 Oct 2018)

Log Message

Add --cc-radar option to webkit-patch bug creation
https://bugs.webkit.org/show_bug.cgi?id=190451
<rdar://problem/45176671>

Reviewed by Antoine Quint.

Add a new command line option to automatically
CC radar to new or updated bugs.

* Scripts/webkitpy/tool/commands/commandtest.py:
(CommandsTest.assert_execute_outputs):
* Scripts/webkitpy/tool/commands/upload.py:
(CreateBug.__init__):
(CreateBug.execute):
* Scripts/webkitpy/tool/commands/upload_unittest.py:
(test_prepare_with_cc):
(test_prepare_with_radar):
(test_prepare_with_cc_and_radar):
* Scripts/webkitpy/tool/steps/createbug.py:
(CreateBug.options):
(CreateBug.run):
* Scripts/webkitpy/tool/steps/options.py:
(Options):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (237036 => 237037)


--- trunk/Tools/ChangeLog	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/ChangeLog	2018-10-11 17:32:31 UTC (rev 237037)
@@ -1,3 +1,29 @@
+2018-10-10  Dean Jackson  <[email protected]>
+
+        Add --cc-radar option to webkit-patch bug creation
+        https://bugs.webkit.org/show_bug.cgi?id=190451
+        <rdar://problem/45176671>
+
+        Reviewed by Antoine Quint.
+
+        Add a new command line option to automatically
+        CC radar to new or updated bugs.
+
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        (CommandsTest.assert_execute_outputs):
+        * Scripts/webkitpy/tool/commands/upload.py:
+        (CreateBug.__init__):
+        (CreateBug.execute):
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        (test_prepare_with_cc):
+        (test_prepare_with_radar):
+        (test_prepare_with_cc_and_radar):
+        * Scripts/webkitpy/tool/steps/createbug.py:
+        (CreateBug.options):
+        (CreateBug.run):
+        * Scripts/webkitpy/tool/steps/options.py:
+        (Options):
+
 2018-10-11  Claudio Saavedra  <[email protected]>
 
         [GStreamer] Do not build gstgtk plugins

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py (237036 => 237037)


--- trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py	2018-10-11 17:32:31 UTC (rev 237037)
@@ -34,7 +34,10 @@
 class CommandsTest(TestCase):
     def assert_execute_outputs(self, command, args=[], expected_stdout="", expected_stderr="", expected_exception=None, expected_logs=None, options=MockOptions(), tool=MockTool()):
         options.blocks = None
-        options.cc = 'MOCK cc'
+        if getattr(options, "cc", None) == None:
+            options.cc = 'MOCK cc'
+        if getattr(options, "cc_radar", None) == None:
+            options.cc_radar = False
         options.component = 'MOCK component'
         options.confirm = True
         options.email = 'MOCK email'

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload.py (237036 => 237037)


--- trunk/Tools/Scripts/webkitpy/tool/commands/upload.py	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload.py	2018-10-11 17:32:31 UTC (rev 237037)
@@ -461,6 +461,7 @@
     def __init__(self):
         options = [
             steps.Options.cc,
+            steps.Options.cc_radar,
             steps.Options.component,
             make_option("--no-prompt", action="" dest="prompt", default=True, help="Do not prompt for bug title and comment; use commit log instead."),
             make_option("--no-review", action="" dest="review", default=True, help="Do not mark the patch for review."),
@@ -526,6 +527,11 @@
         return (bug_title, comment_text)
 
     def execute(self, options, args, tool):
+        if options.cc_radar:
+            if options.cc:
+                options.cc = "[email protected],%s" % options.cc
+            else:
+                options.cc = "[email protected]"
         if len(args):
             if (not tool.scm().supports_local_commits()):
                 _log.error("Extra arguments not supported; patch is taken from working directory.")

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (237036 => 237037)


--- trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py	2018-10-11 17:32:31 UTC (rev 237037)
@@ -115,6 +115,31 @@
         expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: MOCK cc\n"
         self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs, options=options)
 
+    def test_prepare_with_cc(self):
+        options = MockOptions()
+        options.cc = "[email protected],[email protected]"
+        options.sort_xcode_project = False
+        options.non_interactive = True
+        expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: [email protected],[email protected]\n"
+        self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs, options=options)
+
+    def test_prepare_with_radar(self):
+        options = MockOptions()
+        options.cc_radar = True
+        options.sort_xcode_project = False
+        options.non_interactive = True
+        expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: [email protected],MOCK cc\n"
+        self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs, options=options)
+
+    def test_prepare_with_cc_and_radar(self):
+        options = MockOptions()
+        options.cc = "[email protected],[email protected]"
+        options.cc_radar = True
+        options.sort_xcode_project = False
+        options.non_interactive = True
+        expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: [email protected],[email protected],[email protected]\n"
+        self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs, options=options)
+
     def test_upload(self):
         options = MockOptions()
         options.cc = None

Modified: trunk/Tools/Scripts/webkitpy/tool/steps/createbug.py (237036 => 237037)


--- trunk/Tools/Scripts/webkitpy/tool/steps/createbug.py	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/createbug.py	2018-10-11 17:32:31 UTC (rev 237037)
@@ -35,6 +35,7 @@
     def options(cls):
         return AbstractStep.options() + [
             Options.cc,
+            Options.cc_radar,
             Options.component,
             Options.blocks,
         ]
@@ -46,6 +47,12 @@
         cc = self._options.cc
         if not cc:
             cc = state.get("bug_cc")
+        cc_radar = self._options.cc_radar
+        if cc_radar:
+            if cc:
+                cc = "[email protected],%s" % cc
+            else:
+                cc = "[email protected]"
         if self._options.blocks:
             blocked_bugs = [int(self._options.blocks)]
         else:

Modified: trunk/Tools/Scripts/webkitpy/tool/steps/options.py (237036 => 237037)


--- trunk/Tools/Scripts/webkitpy/tool/steps/options.py	2018-10-11 17:29:30 UTC (rev 237036)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/options.py	2018-10-11 17:32:31 UTC (rev 237037)
@@ -36,6 +36,7 @@
     build = make_option("--build", action="" dest="build", default=False, help="Build and run run-webkit-tests before committing.")
     build_style = make_option("--build-style", action="" dest="build_style", default=None, help="Whether to build debug, release, or both.")
     cc = make_option("--cc", action="" type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
+    cc_radar = make_option("--cc-radar", action="" dest="radar", default=False, help="Add webkit-bug-importer/Radar to the CC list.")
     check_style = make_option("--ignore-style", action="" dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
     check_style_filter = make_option("--check-style-filter", action="" type="string", dest="check_style_filter", default=None, help="Filter style-checker rules (see check-webkit-style --help).")
     clean = make_option("--no-clean", action="" dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to