[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
abarth at webkit.org
abarth at webkit.org
Wed Apr 7 23:58:56 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 1fa4d8328f208458dac4448f1b8e165bbfca462a
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 27 23:34:44 2009 +0000
2009-11-27 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
style-queue should only process each patch once
https://bugs.webkit.org/show_bug.cgi?id=31939
Before processing a patch, the try-queues now ask the web service
whether they have already processed the patch. This is an initial cut
of this functionality. I expect we're make it richer over time.
* Scripts/bugzilla-tool:
* Scripts/modules/commands/queues.py:
* Scripts/modules/patchcollection.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 7edb6c6..76f3560 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,21 @@
Reviewed by Eric Seidel.
+ style-queue should only process each patch once
+ https://bugs.webkit.org/show_bug.cgi?id=31939
+
+ Before processing a patch, the try-queues now ask the web service
+ whether they have already processed the patch. This is an initial cut
+ of this functionality. I expect we're make it richer over time.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/patchcollection.py:
+
+2009-11-27 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
PatchStatus does not return status
https://bugs.webkit.org/show_bug.cgi?id=31938
diff --git a/WebKitTools/Scripts/bugzilla-tool b/WebKitTools/Scripts/bugzilla-tool
index 35a344a..ba32b3a 100755
--- a/WebKitTools/Scripts/bugzilla-tool
+++ b/WebKitTools/Scripts/bugzilla-tool
@@ -46,7 +46,8 @@ class BugzillaTool(MultiCommandTool):
self.bugs = Bugzilla()
self.buildbot = BuildBot()
- self.cached_scm = None
+ self._cached_scm = None
+ self._cached_status = None
self.steps = BuildSteps()
def dry_run_callback(self, option, opt, value, parser):
@@ -56,19 +57,24 @@ class BugzillaTool(MultiCommandTool):
def scm(self):
# Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
original_cwd = os.path.abspath(".")
- if not self.cached_scm:
- self.cached_scm = detect_scm_system(original_cwd)
+ if not self._cached_scm:
+ self._cached_scm = detect_scm_system(original_cwd)
- if not self.cached_scm:
+ if not self._cached_scm:
script_directory = os.path.abspath(sys.path[0])
webkit_directory = os.path.abspath(os.path.join(script_directory, "../.."))
- self.cached_scm = detect_scm_system(webkit_directory)
- if self.cached_scm:
+ self._cached_scm = detect_scm_system(webkit_directory)
+ if self._cached_scm:
log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, webkit_directory))
else:
error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, webkit_directory))
- return self.cached_scm
+ return self._cached_scm
+
+ def status(self):
+ if not self._cached_status:
+ self._cached_status = StatusBot()
+ return self._cached_status
def path(self):
return __file__
diff --git a/WebKitTools/Scripts/modules/bugzilla.py b/WebKitTools/Scripts/modules/bugzilla.py
index e663398..b923cf8 100644
--- a/WebKitTools/Scripts/modules/bugzilla.py
+++ b/WebKitTools/Scripts/modules/bugzilla.py
@@ -324,10 +324,10 @@ class Bugzilla:
patches_to_land += patches
return patches_to_land
- def fetch_patches_from_review_queue(self, limit):
+ def fetch_patches_from_review_queue(self, limit=None):
patches_to_review = []
for bug_id in self.fetch_bug_ids_from_review_queue():
- if len(patches_to_review) >= limit:
+ if limit and len(patches_to_review) >= limit:
break
patches = self.fetch_unreviewed_patches_from_bug(bug_id)
patches_to_review += patches
diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py
index 1f02e61..b7ff871 100644
--- a/WebKitTools/Scripts/modules/commands/queues.py
+++ b/WebKitTools/Scripts/modules/commands/queues.py
@@ -47,7 +47,7 @@ from modules.grammar import pluralize
from modules.landingsequence import LandingSequence, ConditionalLandingSequence
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
-from modules.patchcollection import PatchCollection
+from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
from modules.processutils import run_and_throw_if_fail
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
@@ -139,20 +139,31 @@ class CommitQueue(AbstractQueue):
self.tool.bugs.reject_patch_from_commit_queue(patch["id"], message)
-class AbstractTryQueue(AbstractQueue):
+class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate):
def __init__(self, options=[]):
AbstractQueue.__init__(self, options)
+ # PersistentPatchCollectionDelegate methods
+
+ def collection_name(self):
+ return self.name
+
+ def fetch_potential_patches(self):
+ return self.tool.bugs.fetch_patches_from_review_queue(limit=3)
+
+ def status_server(self):
+ return self.tool.status()
+
+ # AbstractQueue methods
+
def status_host(self):
return None # FIXME: A hack until we come up with a more generic status page.
def begin_work_queue(self):
AbstractQueue.begin_work_queue(self)
- self._patches = PatchCollection(self.tool.bugs)
- self._patches.add_patches(self.tool.bugs.fetch_patches_from_review_queue(limit=10))
+ self._patches = PersistentPatchCollection(self)
def next_work_item(self):
- self.log_progress(self._patches.patch_ids())
return self._patches.next()
def should_proceed_with_work_item(self, patch):
@@ -163,6 +174,7 @@ class AbstractTryQueue(AbstractQueue):
def handle_unexpected_error(self, patch, message):
log(message)
+ self._patches.done(patch)
class StyleQueue(AbstractTryQueue):
@@ -176,6 +188,7 @@ class StyleQueue(AbstractTryQueue):
def process_work_item(self, patch):
self.run_bugzilla_tool(["check-style", "--force-clean", patch["id"]])
+ self._patches.done(patch)
class BuildQueue(AbstractTryQueue):
@@ -198,3 +211,4 @@ class BuildQueue(AbstractTryQueue):
def process_work_item(self, patch):
self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--no-update", patch["id"]])
+ self._patches.done(patch)
diff --git a/WebKitTools/Scripts/modules/patchcollection.py b/WebKitTools/Scripts/modules/patchcollection.py
index 2ab9310..03fbea5 100644
--- a/WebKitTools/Scripts/modules/patchcollection.py
+++ b/WebKitTools/Scripts/modules/patchcollection.py
@@ -57,3 +57,34 @@ class PatchCollection:
def __len__(self):
return len(self._patches)
+
+
+class PersistentPatchCollectionDelegate:
+ def collection_name(self):
+ raise NotImplementedError, "subclasses must implement"
+
+ def fetch_potential_patches(self):
+ raise NotImplementedError, "subclasses must implement"
+
+ def status_server(self):
+ raise NotImplementedError, "subclasses must implement"
+
+
+class PersistentPatchCollection:
+ _initial_status = "Attempted"
+ _terminal_status = "Done"
+ def __init__(self, delegate):
+ self._delegate = delegate
+ self._name = self._delegate.collection_name()
+ self._status = self._delegate.status_server()
+
+ def next(self):
+ patches = self._delegate.fetch_potential_patches()
+ for patch in patches:
+ last_status = self._status.patch_status(self._name, patch["id"])
+ if not last_status: # FIXME: Add support for "Try again"
+ self._status.update_status(self._name, self._initial_status, patch)
+ return patch
+
+ def done(self, patch):
+ self._status.update_status(self._name, self._terminal_status, patch)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list