+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue shouldn't reject patches from the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31944
+
+ Currently the style-queue subprocess gets confused and thinks its the
+ commit-queue. If the patch has an error, it rejects it from the
+ commit-queue. Instead, we should have style-queue specific logic.
+ This patch doesn't add that logic, but it gives us a callback we can
+ use to add that logic.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/landingsequence.py:
+
2009-11-27 Adam Barth <abarth@webkit.org>
Rubber stamped by Eric Seidel.
make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
+ make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance."),
] + WebKitPort.port_options()
@staticmethod
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
-from modules.landingsequence import LandingSequence, ConditionalLandingSequence
+from modules.landingsequence import LandingSequence, ConditionalLandingSequence, LandingSequenceErrorHandler
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
work_queue.run()
-class CommitQueue(AbstractQueue):
+class CommitQueue(AbstractQueue, LandingSequenceErrorHandler):
name = "commit-queue"
show_in_main_help = False
def __init__(self):
AbstractQueue.__init__(self)
+ # AbstractQueue methods
+
def begin_work_queue(self):
AbstractQueue.begin_work_queue(self)
return (True, "Landing patch %s from bug %s." % (patch["id"], patch["bug_id"]), patch)
def process_work_item(self, patch):
- self.run_bugzilla_tool(["land-attachment", "--force-clean", "--non-interactive", "--quiet", patch["id"]])
+ self.run_bugzilla_tool(["land-attachment", "--force-clean", "--non-interactive", "--parent-command=commit-queue", "--quiet", patch["id"]])
def handle_unexpected_error(self, patch, message):
self.tool.bugs.reject_patch_from_commit_queue(patch["id"], message)
+ # LandingSequenceErrorHandler methods
+
+ @classmethod
+ def handle_script_error(cls, tool, patch, script_error):
+ tool.bugs.reject_patch_from_commit_queue(patch["id"], script_error.message_with_output())
-class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate):
+
+class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate, LandingSequenceErrorHandler):
def __init__(self, options=[]):
AbstractQueue.__init__(self, options)
log(message)
self._patches.done(patch)
+ # LandingSequenceErrorHandler methods
+
+ @classmethod
+ def handle_script_error(cls, tool, patch, script_error):
+ log(script_error.message_with_output())
+
class StyleQueue(AbstractTryQueue):
name = "style-queue"
return (True, "Checking style for patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch)
def process_work_item(self, patch):
- self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", patch["id"]])
+ self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch["id"]])
self._patches.done(patch)
return (True, "Building patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch)
def process_work_item(self, patch):
- self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--no-update", patch["id"]])
+ self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--non-interactive", "--parent-command=build-queue", "--no-update", patch["id"]])
self._patches.done(patch)
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue
+class LandingSequenceErrorHandler():
+ @classmethod
+ def handle_script_error(cls, tool, patch, script_error):
+ raise NotImplementedError, "subclasses must implement"
+
+
class LandingSequence:
def __init__(self, patch, options, tool):
self._patch = patch
except ScriptError, e:
if not self._options.quiet:
log(e.message_with_output())
- if self._options.non_interactive:
- # Mark the patch as commit-queue- and comment in the bug.
- self._tool.bugs.reject_patch_from_commit_queue(self._patch["id"], e.message_with_output())
+ if self._options.parent_command:
+ command = self._tool.command_by_name(self._options.parent_command)
+ command.handle_script_error(self._tool, self._patch, e)
WorkQueue.exit_after_handled_error(e)
def clean(self):