Title: [123865] trunk/Tools
Revision
123865
Author
[email protected]
Date
2012-07-27 04:42:32 -0700 (Fri, 27 Jul 2012)

Log Message

webkit.review.bot should run clean-review-queue and clean-pending-commit periodically
https://bugs.webkit.org/show_bug.cgi?id=92472

Reviewed by Eric Seidel.

We need to run these command periodically to keep cruft from
accumulating in bugs.webkit.org. Rather than running them manually, we
should just have a bot run them. This patch has the style-queue run the
commands, which admittedly is a bit odd but it doesn't seem worthwhile
to create another bot specifically for this purposes.

* Scripts/webkitpy/tool/commands/queues.py:
(AbstractReviewQueue):
(StyleQueue.begin_work_queue):
(StyleQueue):
(StyleQueue.clean_bugzilla):
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(StyleQueueTest.test_style_queue_with_style_exception):
(test_style_queue_with_watch_list_exception):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (123864 => 123865)


--- trunk/Tools/ChangeLog	2012-07-27 11:32:44 UTC (rev 123864)
+++ trunk/Tools/ChangeLog	2012-07-27 11:42:32 UTC (rev 123865)
@@ -1,3 +1,25 @@
+2012-07-27  Adam Barth  <[email protected]>
+
+        webkit.review.bot should run clean-review-queue and clean-pending-commit periodically
+        https://bugs.webkit.org/show_bug.cgi?id=92472
+
+        Reviewed by Eric Seidel.
+
+        We need to run these command periodically to keep cruft from
+        accumulating in bugs.webkit.org. Rather than running them manually, we
+        should just have a bot run them. This patch has the style-queue run the
+        commands, which admittedly is a bit odd but it doesn't seem worthwhile
+        to create another bot specifically for this purposes.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        (AbstractReviewQueue):
+        (StyleQueue.begin_work_queue):
+        (StyleQueue):
+        (StyleQueue.clean_bugzilla):
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        (StyleQueueTest.test_style_queue_with_style_exception):
+        (test_style_queue_with_watch_list_exception):
+
 2012-07-27  Dominik Röttsches  <[email protected]>
 
         [Cairo] Add complex font drawing using HarfbuzzNG

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (123864 => 123865)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2012-07-27 11:32:44 UTC (rev 123864)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2012-07-27 11:42:32 UTC (rev 123865)
@@ -379,9 +379,6 @@
 
     # AbstractPatchQueue methods
 
-    def begin_work_queue(self):
-        AbstractPatchQueue.begin_work_queue(self)
-
     def next_work_item(self):
         return self._next_patch()
 
@@ -416,6 +413,23 @@
     def __init__(self):
         AbstractReviewQueue.__init__(self)
 
+    def begin_work_queue(self):
+        AbstractReviewQueue.begin_work_queue(self)
+        self.clean_bugzilla()
+
+    def clean_bugzilla(self):
+        try:
+            self._update_status("Cleaning review queue")
+            self.run_webkit_patch(["clean-review-queue"])
+        except ScriptError, e:
+            self._update_status(e)
+
+        try:
+            self._update_status("Cleaning pending commit")
+            self.run_webkit_patch(["clean-pending-commit"])
+        except ScriptError, e:
+            self._update_status(e)
+
     def review_patch(self, patch):
         task = StyleQueueTask(self, patch)
         if not task.validate():

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


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2012-07-27 11:32:44 UTC (rev 123864)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2012-07-27 11:42:32 UTC (rev 123865)
@@ -449,7 +449,11 @@
 class StyleQueueTest(QueuesTest):
     def test_style_queue_with_style_exception(self):
         expected_stderr = {
-            "begin_work_queue": self._default_begin_work_queue_stderr("style-queue"),
+            "begin_work_queue": self._default_begin_work_queue_stderr("style-queue") + """MOCK: update_status: style-queue Cleaning review queue
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean-review-queue'], cwd=/mock-checkout
+MOCK: update_status: style-queue Cleaning pending commit
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean-pending-commit'], cwd=/mock-checkout
+""",
             "next_work_item": "",
             "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean'], cwd=/mock-checkout
 MOCK: update_status: style-queue Cleaned working directory
@@ -472,7 +476,11 @@
 
     def test_style_queue_with_watch_list_exception(self):
         expected_stderr = {
-            "begin_work_queue": self._default_begin_work_queue_stderr("style-queue"),
+            "begin_work_queue": self._default_begin_work_queue_stderr("style-queue") + """MOCK: update_status: style-queue Cleaning review queue
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean-review-queue'], cwd=/mock-checkout
+MOCK: update_status: style-queue Cleaning pending commit
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean-pending-commit'], cwd=/mock-checkout
+""",
             "next_work_item": "",
             "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean'], cwd=/mock-checkout
 MOCK: update_status: style-queue Cleaned working directory
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to