2009-11-28 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Nov 2009 00:17:33 +0000 (00:17 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Nov 2009 00:17:33 +0000 (00:17 +0000)
        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

WebKitTools/ChangeLog
WebKitTools/Scripts/modules/commands/queues.py
WebKitTools/Scripts/modules/scm.py

index 3552a897e2869540bc73ca66a9013378f68d16b1..55d7d2383650d0b8ad8284b94424dd80e1df7cac 100644 (file)
@@ -1,3 +1,17 @@
+2009-11-28  Adam Barth  <abarth@webkit.org>
+
+        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  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index f0540917640cda151a07b5b9b6127b573177cdf2..014cd08113be98dde672a9e52ba1223cf6adefc4 100644 (file)
@@ -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"
index d322762c7a76941525c66ac7aa0601da35910882..beb32dfc94d55b9a4a973a8f3f86146f138c66d9 100644 (file)
@@ -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)