[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 14:48:10 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2e7c75d57f79ed6753ae5ea7e1b6c068996cb903
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 20 20:44:56 2010 +0000

    2010-10-20  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            webkit-patch doesn't get along with git rm
            https://bugs.webkit.org/show_bug.cgi?id=47940
    
            Turns out we need to pass "--" to tell git this is a path.
    
            * Scripts/webkitpy/common/checkout/scm.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70171 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1adeebf..a57e1e4 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -78,6 +78,19 @@
 
         Reviewed by Adam Barth.
 
+        EWS should test patches with r+
+        https://bugs.webkit.org/show_bug.cgi?id=35460
+
+        * QueueStatusServer/handlers/submittoews.py:
+        * QueueStatusServer/model/queues.py:
+        * Scripts/webkitpy/tool/bot/patchcollection.py: Removed.
+        * Scripts/webkitpy/tool/bot/patchcollection_unittest.py: Removed.
+        * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-10-19  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
         Teach feeder-queue how to feed the EWS bots
         https://bugs.webkit.org/show_bug.cgi?id=47943
 
diff --git a/WebKitTools/QueueStatusServer/handlers/submittoews.py b/WebKitTools/QueueStatusServer/handlers/submittoews.py
index 115987c..3ba4373 100644
--- a/WebKitTools/QueueStatusServer/handlers/submittoews.py
+++ b/WebKitTools/QueueStatusServer/handlers/submittoews.py
@@ -39,6 +39,9 @@ class SubmitToEWS(UpdateBase):
         self.response.out.write(template.render("templates/submittoews.html", None))
 
     def _should_add_to_ews_queue(self, queue, attachment):
+        # This assert() is here to make sure we're not submitting to the commit-queue.
+        # The commit-queue clients check each patch anyway, but there is not sense
+        # in adding things to the commit-queue when they won't be processed by it.
         assert(queue.is_ews())
         latest_status = attachment.status_for_queue(queue)
         if not latest_status:
@@ -51,7 +54,7 @@ class SubmitToEWS(UpdateBase):
         return latest_status.is_retry_request()
 
     def _add_attachment_to_ews_queues(self, attachment):
-        for queue in Queue.all_ews():
+        for queue in Queue.all_ews():  # all_ews() currently includes the style-queue
             if self._should_add_to_ews_queue(queue, attachment):
                 queue.work_items().add_work_item(attachment.id)
 
diff --git a/WebKitTools/QueueStatusServer/model/queues.py b/WebKitTools/QueueStatusServer/model/queues.py
index 2fa57b4..1d46f89 100644
--- a/WebKitTools/QueueStatusServer/model/queues.py
+++ b/WebKitTools/QueueStatusServer/model/queues.py
@@ -105,4 +105,9 @@ class Queue(object):
         return self._dash_regexp.sub("_", self._name)
 
     def is_ews(self):
-        return self._name.endswith("-ews")
+        # Note: The style-queue is just like an EWS in that it has an EWS
+        # bubble, and it works off of the r? patches.  If at some later
+        # point code wants to not treat the style-queue as an EWS
+        # (e.g. expecting is_ews() queues to have build results?)
+        # then we should fix all callers and change this check.
+        return self._name.endswith("-ews") or self._name == "style-queue"
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
index 2b8368e..dc892a4 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
@@ -47,6 +47,8 @@ class CommitQueueFeeder(AbstractFeeder):
         self.committer_validator = CommitterValidator(self._tool.bugs)
 
     def _update_work_items(self, item_ids):
+        # FIXME: This is the last use of update_work_items, the commit-queue
+        # should move to feeding patches one at a time like the EWS does.
         self._tool.status_server.update_work_items(self.queue_name, item_ids)
         log("Feeding %s items %s" % (self.queue_name, item_ids))
 
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
deleted file mode 100644
index 6100cf8..0000000
--- a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-class PersistentPatchCollectionDelegate:
-    def collection_name(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def fetch_potential_patch_ids(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def status_server(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def is_terminal_status(self, status):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class PersistentPatchCollection:
-    def __init__(self, delegate):
-        self._delegate = delegate
-        self._name = self._delegate.collection_name()
-        self._status = self._delegate.status_server()
-        self._status_cache = {}
-
-    def _cached_status(self, patch_id):
-        cached = self._status_cache.get(patch_id)
-        if cached:
-            return cached
-        status = self._status.patch_status(self._name, patch_id)
-        if status and self._delegate.is_terminal_status(status):
-            self._status_cache[patch_id] = status
-        return status
-
-    def _is_active_patch_id(self, patch_id):
-        """Active patches are patches waiting to be processed from this collection."""
-        status = self._cached_status(patch_id)
-        return not status or not self._delegate.is_terminal_status(status)
-
-    def _fetch_active_patch_ids(self):
-        patch_ids = self._delegate.fetch_potential_patch_ids()
-        return filter(lambda patch_id: self._is_active_patch_id(patch_id), patch_ids)
-
-    def next(self):
-        # Note: We only fetch all the ids so we can post them back to the server.
-        # This will go away once we have a feeder queue and all other queues are
-        # just pulling their next work item from the server.
-        patch_ids = self._fetch_active_patch_ids()
-        # FIXME: We're assuming self._name is a valid queue-name.
-        self._status.update_work_items(self._name, patch_ids)
-        if not patch_ids:
-            return None
-        return patch_ids[0]
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py
deleted file mode 100644
index 4ec6e25..0000000
--- a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest
-
-from webkitpy.tool.bot.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
-from webkitpy.thirdparty.mock import Mock
-
-
-class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate):
-    def collection_name(self):
-        return "test-collection"
-
-    def fetch_potential_patch_ids(self):
-        return [42, 192, 87]
-
-    def status_server(self):
-        return Mock()
-
-    def is_terminal_status(self, status):
-        return False
-
-
-class PersistentPatchCollectionTest(unittest.TestCase):
-    def test_next(self):
-        collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate())
-        collection.next()
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
index bc09e32..c400f81 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -48,8 +48,8 @@ class EarlyWarningSytemTest(QueuesTest):
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr(ews.name, os.getcwd()),  # FIXME: Use of os.getcwd() is wrong, should be scm.checkout_root
             "handle_unexpected_error": "Mock error message\n",
-            "next_work_item": "MOCK: update_work_items: %(name)s [103]\n" % string_replacemnts,
-            "process_work_item": "MOCK: update_status: %(name)s Pass\n" % string_replacemnts,
+            "next_work_item": "",
+            "process_work_item": "MOCK: update_status: %(name)s Pass\nMOCK: release_work_item: %(name)s 197\n" % string_replacemnts,
             "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=142, cc=%(watchers)s\n--- Begin comment ---\nAttachment 197 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
         }
         return expected_stderr
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index ca3066b..7b3002a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -46,11 +46,11 @@ from webkitpy.common.system.deprecated_logging import error, log
 from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
 from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate
 from webkitpy.tool.bot.feeders import CommitQueueFeeder, EWSFeeder
-from webkitpy.tool.bot.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
 from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
 from webkitpy.tool.grammar import pluralize
 from webkitpy.tool.multicommandtool import Command, TryAgain
 
+
 class AbstractQueue(Command, QueueEngineDelegate):
     watchers = [
     ]
@@ -327,6 +327,7 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
         raise TryAgain()
 
 
+# FIXME: All the Rietveld code is no longer used and should be deleted.
 class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
     name = "rietveld-upload-queue"
 
@@ -372,41 +373,27 @@ class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
         cls._reject_patch(tool, state["patch"].id())
 
 
-class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate, StepSequenceErrorHandler):
+class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
     """This is the base-class for the EWS queues and the style-queue."""
     def __init__(self, options=None):
         AbstractPatchQueue.__init__(self, options)
 
     def review_patch(self, patch):
-        raise NotImplementedError, "subclasses must implement"
-
-    # PersistentPatchCollectionDelegate methods
-
-    def collection_name(self):
-        return self.name
-
-    def fetch_potential_patch_ids(self):
-        return self._tool.bugs.queries.fetch_attachment_ids_from_review_queue()
-
-    def status_server(self):
-        return self._tool.status_server
-
-    def is_terminal_status(self, status):
-        return status == "Pass" or status == "Fail" or status.startswith("Error:")
+        raise NotImplementedError("subclasses must implement")
 
     # AbstractPatchQueue methods
 
     def begin_work_queue(self):
         AbstractPatchQueue.begin_work_queue(self)
-        self._patches = PersistentPatchCollection(self)
 
     def next_work_item(self):
-        patch_id = self._patches.next()
-        if patch_id:
-            return self._tool.bugs.fetch_attachment(patch_id)
+        patch_id = self._fetch_next_work_item()
+        if not patch_id:
+            return None
+        return self._tool.bugs.fetch_attachment(patch_id)
 
     def should_proceed_with_work_item(self, patch):
-        raise NotImplementedError, "subclasses must implement"
+        raise NotImplementedError("subclasses must implement")
 
     def process_work_item(self, patch):
         try:
@@ -418,6 +405,8 @@ class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate,
             if e.exit_code != QueueEngine.handled_error_code:
                 self._did_fail(patch)
             raise e
+        finally:
+            self._release_work_item(patch)
 
     def handle_unexpected_error(self, patch, message):
         log(message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 22f1298..b37b5dc 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -155,22 +155,6 @@ class AbstractPatchQueueTest(CommandsTest):
         self.assertEquals(queue._fetch_next_work_item(), 2)
 
 
-class AbstractReviewQueueTest(CommandsTest):
-    def test_patch_collection_delegate_methods(self):
-        queue = TestReviewQueue()
-        tool = MockTool()
-        queue.bind_to_tool(tool)
-        queue._options = Mock()
-        queue._options.port = None
-        self.assertEquals(queue.collection_name(), "test-review-queue")
-        self.assertEquals(queue.fetch_potential_patch_ids(), [103])
-        queue.status_server()
-        self.assertTrue(queue.is_terminal_status("Pass"))
-        self.assertTrue(queue.is_terminal_status("Fail"))
-        self.assertTrue(queue.is_terminal_status("Error: Your patch exploded"))
-        self.assertFalse(queue.is_terminal_status("Foo"))
-
-
 class NeedsUpdateSequence(StepSequence):
     def _run(self, tool, options, state):
         raise CheckoutNeedsUpdate([], 1, "", None)
@@ -365,9 +349,9 @@ class StyleQueueTest(QueuesTest):
     def test_style_queue(self):
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr("style-queue", MockSCM.fake_checkout_root),
-            "next_work_item": "MOCK: update_work_items: style-queue [103]\n",
+            "next_work_item": "",
             "should_proceed_with_work_item": "MOCK: update_status: style-queue Checking style\n",
-            "process_work_item": "MOCK: update_status: style-queue Pass\n",
+            "process_work_item": "MOCK: update_status: style-queue Pass\nMOCK: release_work_item: style-queue 197\n",
             "handle_unexpected_error": "Mock error message\n",
             "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=142, cc=[]\n--- Begin comment ---\nAttachment 197 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
         }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list