Title: [139224] trunk/Tools
Revision
139224
Author
[email protected]
Date
2013-01-09 12:33:51 -0800 (Wed, 09 Jan 2013)

Log Message

webkitpy cleanup: Merge additional_comment_text into comment_text
https://bugs.webkit.org/show_bug.cgi?id=106421

Reviewed by Adam Barth.

* Scripts/webkitpy/common/config/committervalidator.py:
(CommitterValidator.reject_patch_from_commit_queue):
(CommitterValidator.reject_patch_from_review_queue):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.set_flag_on_attachment):
* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzilla.set_flag_on_attachment):
* Scripts/webkitpy/tool/bot/feeders_unittest.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem._post_reject_message_on_bug):
* Scripts/webkitpy/tool/commands/queues_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (139223 => 139224)


--- trunk/Tools/ChangeLog	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/ChangeLog	2013-01-09 20:33:51 UTC (rev 139224)
@@ -1,3 +1,22 @@
+2013-01-09  Csaba Osztrogonác  <[email protected]>
+
+        webkitpy cleanup: Merge additional_comment_text into comment_text
+        https://bugs.webkit.org/show_bug.cgi?id=106421
+
+        Reviewed by Adam Barth.
+
+        * Scripts/webkitpy/common/config/committervalidator.py:
+        (CommitterValidator.reject_patch_from_commit_queue):
+        (CommitterValidator.reject_patch_from_review_queue):
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+        (Bugzilla.set_flag_on_attachment):
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
+        (MockBugzilla.set_flag_on_attachment):
+        * Scripts/webkitpy/tool/bot/feeders_unittest.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        (AbstractEarlyWarningSystem._post_reject_message_on_bug):
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
 2013-01-09  Mario Sanchez Prada  <[email protected]>
 
         [GTK] Raise version of gdk-pixbuf in jhbuild up to 2.26.5

Modified: trunk/Tools/Scripts/webkitpy/common/config/committervalidator.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/common/config/committervalidator.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/common/config/committervalidator.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -78,18 +78,20 @@
                                        attachment_id,
                                        additional_comment_text=None):
         comment_text = "Rejecting attachment %s from commit-queue." % attachment_id
+        if additional_comment_text:
+            comment_text += "\n\n%s" % additional_comment_text
         self.host.bugs.set_flag_on_attachment(attachment_id,
                                               "commit-queue",
                                               "-",
-                                              comment_text,
-                                              additional_comment_text)
+                                              comment_text)
 
     def reject_patch_from_review_queue(self,
                                        attachment_id,
                                        additional_comment_text=None):
         comment_text = "Rejecting attachment %s from review queue." % attachment_id
+        if additional_comment_text:
+            comment_text += "\n\n%s" % additional_comment_text
         self.host.bugs.set_flag_on_attachment(attachment_id,
                                               'review',
                                               '-',
-                                              comment_text,
-                                              additional_comment_text)
+                                              comment_text)

Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -729,18 +729,12 @@
                                attachment_id,
                                flag_name,
                                flag_value,
-                               comment_text=None,
-                               additional_comment_text=None):
+                               comment_text=None):
         # FIXME: We need a way to test this function on a live bugzilla
         # instance.
 
         self.authenticate()
-
-        # FIXME: additional_comment_text seems useless and should be merged into comment-text.
-        if additional_comment_text:
-            comment_text += "\n\n%s" % additional_comment_text
         _log.info(comment_text)
-
         self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
         self.browser.select_form(nr=1)
 

Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -385,10 +385,9 @@
                                attachment_id,
                                flag_name,
                                flag_value,
-                               comment_text=None,
-                               additional_comment_text=None):
-        _log.info("MOCK setting flag '%s' to '%s' on attachment '%s' with comment '%s' and additional comment '%s'" % (
-                  flag_name, flag_value, attachment_id, comment_text, additional_comment_text))
+                               comment_text=None):
+        _log.info("MOCK setting flag '%s' to '%s' on attachment '%s' with comment '%s'" % (
+                  flag_name, flag_value, attachment_id, comment_text))
 
     def post_comment_to_bug(self, bug_id, comment_text, cc=None):
         _log.info("MOCK bug comment: bug_id=%s, cc=%s\n--- Begin comment ---\n%s\n--- End comment ---\n" % (

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/feeders_unittest.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/tool/bot/feeders_unittest.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/feeders_unittest.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -40,7 +40,7 @@
         feeder = CommitQueueFeeder(MockTool())
         expected_logs = """Warning, attachment 10001 on bug 50000 has invalid committer ([email protected])
 Warning, attachment 10001 on bug 50000 has invalid committer ([email protected])
-MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.' and additional comment '[email protected] does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
+MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\[email protected] does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
 
 - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
 

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -66,11 +66,13 @@
     def _post_reject_message_on_bug(self, tool, patch, status_id, extra_message_text=None):
         results_link = tool.status_server.results_url_for_status(status_id)
         message = "Attachment %s did not pass %s (%s):\nOutput: %s" % (patch.id(), self.name, self.port_name, results_link)
+        if extra_message_text:
+            message += "\n\n%s" % extra_message_text
         # FIXME: We might want to add some text about rejecting from the commit-queue in
         # the case where patch.commit_queue() isn't already set to '-'.
         if self.watchers:
             tool.bugs.add_cc_to_bug(patch.bug_id(), self.watchers)
-        tool.bugs.set_flag_on_attachment(patch.id(), "commit-queue", "-", message, extra_message_text)
+        tool.bugs.set_flag_on_attachment(patch.id(), "commit-queue", "-", message)
 
     def review_patch(self, patch):
         task = EarlyWarningSystemTask(self, patch, self._options.run_tests)

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (139223 => 139224)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2013-01-09 20:30:40 UTC (rev 139223)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2013-01-09 20:33:51 UTC (rev 139224)
@@ -134,7 +134,7 @@
             "begin_work_queue": self._default_begin_work_queue_logs("feeder-queue"),
             "process_work_item": """Warning, attachment 10001 on bug 50000 has invalid committer ([email protected])
 Warning, attachment 10001 on bug 50000 has invalid committer ([email protected])
-MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.' and additional comment '[email protected] does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
+MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\[email protected] does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
 
 - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
 
@@ -256,7 +256,7 @@
 MOCK: release_work_item: commit-queue 10000
 """,
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
-            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'Mock error message'\n",
+            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
         }
         self.assert_queue_outputs(CommitQueue(), tool=tool, expected_logs=expected_logs)
 
@@ -266,13 +266,13 @@
             "process_work_item": """MOCK: update_status: commit-queue Cleaned working directory
 MOCK: update_status: commit-queue Updated working directory
 MOCK: update_status: commit-queue Patch does not apply
-MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'MOCK script error
+MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMOCK script error
 Full output: http://dummy_url'
 MOCK: update_status: commit-queue Fail
 MOCK: release_work_item: commit-queue 10000
 """,
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
-            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'Mock error message'\n",
+            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
         }
         queue = CommitQueue()
 
@@ -292,7 +292,7 @@
             "process_work_item": """MOCK: update_status: commit-queue Cleaned working directory
 MOCK: update_status: commit-queue Updated working directory
 MOCK: update_status: commit-queue Patch does not apply
-MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'New failing tests:
+MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nNew failing tests:
 mock_test_name.html
 another_test_name.html
 Full output: http://dummy_url'
@@ -300,7 +300,7 @@
 MOCK: release_work_item: commit-queue 10000
 """,
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
-            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'Mock error message'\n",
+            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
         }
         queue = CommitQueue()
 
@@ -340,7 +340,7 @@
 MOCK: release_work_item: commit-queue 10000
 """ % {"port": CommitQueue.port_name},
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
-            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'Mock error message'\n",
+            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
         }
         self.assert_queue_outputs(CommitQueue(), tool=tool, expected_logs=expected_logs)
 
@@ -365,7 +365,7 @@
 MOCK: release_work_item: commit-queue 10005
 """ % {"port": CommitQueue.port_name},
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
-            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10005' with comment 'Rejecting attachment 10005 from commit-queue.' and additional comment 'Mock error message'\n",
+            "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10005' with comment 'Rejecting attachment 10005 from commit-queue.\n\nMock error message'\n",
         }
         self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_logs=expected_logs)
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to