From: abarth@webkit.org Date: Sun, 29 Nov 2009 00:17:33 +0000 (+0000) Subject: 2009-11-28 Adam Barth X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=247929fbd9a266fa152cc08dcc77f942212599cb 2009-11-28 Adam Barth Reviewed by Eric Seidel. [bzt] style-queue should report style errors to bugzilla https://bugs.webkit.org/show_bug.cgi?id=31945 Currently, we're just logging the style errors locally. With this patch we'll actually log the errors to bugzilla. Note: I plan to run with the "local-only" logging during development. * Scripts/modules/commands/queues.py: * Scripts/modules/scm.py: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51462 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 3552a897e286..55d7d2383650 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,17 @@ +2009-11-28 Adam Barth + + Reviewed by Eric Seidel. + + [bzt] style-queue should report style errors to bugzilla + https://bugs.webkit.org/show_bug.cgi?id=31945 + + Currently, we're just logging the style errors locally. With this + patch we'll actually log the errors to bugzilla. Note: I plan to run + with the "local-only" logging during development. + + * Scripts/modules/commands/queues.py: + * Scripts/modules/scm.py: + 2009-11-28 Adam Barth Reviewed by Eric Seidel. diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py index f0540917640c..014cd08113be 100644 --- a/WebKitTools/Scripts/modules/commands/queues.py +++ b/WebKitTools/Scripts/modules/commands/queues.py @@ -202,6 +202,19 @@ class StyleQueue(AbstractTryQueue): self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch["id"]]) self._patches.done(patch) + @classmethod + def handle_script_error(cls, tool, patch, script_error): + command = script_error.script_args + if type(command) is list: + command = command[0] + # FIXME: We shouldn't need to use a regexp here. ScriptError should + # have a better API. + if re.search("check-webkit-style", command): + message = "Attachment %s did not pass %s:\n\n%s" % (patch["id"], cls.name, script_error.message_with_output(output_limit=None)) + # Local-only logging helpful for development: + # log("** BEGIN BUG POST **\n%s** END BUG POST **" % message) + tool.bugs.post_comment_to_bug(patch["bug_id"], message) + class BuildQueue(AbstractTryQueue): name = "build-queue" diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py index d322762c7a76..beb32dfc94d5 100644 --- a/WebKitTools/Scripts/modules/scm.py +++ b/WebKitTools/Scripts/modules/scm.py @@ -95,7 +95,7 @@ class ScriptError(Exception): def message_with_output(self, output_limit=500): if self.output: - if len(self.output) > output_limit: + if output_limit and len(self.output) > output_limit: return "%s\nLast %s characters of output:\n%s" % (self, output_limit, self.output[-output_limit:]) return "%s\n%s" % (self, self.output) return str(self)