2009-11-28 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Nov 2009 00:20:45 +0000 (00:20 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Nov 2009 00:20:45 +0000 (00:20 +0000)
        Reviewed by Eric Seidel.

        [bzt] CC webkit-bot-watchers whenever the bots touch bugs
        https://bugs.webkit.org/show_bug.cgi?id=31952

        The mailing list is open for anyone to subscribe.

        * Scripts/modules/bugzilla.py:
        * Scripts/modules/commands/queues.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

index 55d7d2383650d0b8ad8284b94424dd80e1df7cac..9995641f0d0e545f08022407d84f75dbf82d1228 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-28  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [bzt] CC webkit-bot-watchers whenever the bots touch bugs
+        https://bugs.webkit.org/show_bug.cgi?id=31952
+
+        The mailing list is open for anyone to subscribe.
+
+        * Scripts/modules/bugzilla.py:
+        * Scripts/modules/commands/queues.py:
+
 2009-11-28  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index b923cf88a2f85e48acfb395c53d6305f4f7918d6..937e1ec1387ccf1d0e594ae27b86491b3f7f8cc2 100644 (file)
@@ -507,8 +507,20 @@ class Bugzilla:
             # Bugzilla has two textareas named 'comment', one is somehow hidden.  We want the first.
             self.browser.set_value(comment_text, name='comment', nr=0)
         self.browser.submit()
-    
-    def post_comment_to_bug(self, bug_id, comment_text):
+
+    def add_cc_to_bug(self, bug_id, email_address):
+        self.authenticate()
+
+        log("Adding %s to the CC list for bug %s" % (email_address, bug_id))
+        if self.dryrun:
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        self.browser["newcc"] = email_address
+        self.browser.submit()
+
+    def post_comment_to_bug(self, bug_id, comment_text, cc=None):
         self.authenticate()
 
         log("Adding comment to bug %s" % bug_id)
@@ -518,7 +530,9 @@ class Bugzilla:
 
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
-        self.browser['comment'] = comment_text
+        self.browser["comment"] = comment_text
+        if cc:
+            self.browser["newcc"] = cc
         self.browser.submit()
 
     def close_bug_as_fixed(self, bug_id, comment_text=None):
index 014cd08113be98dde672a9e52ba1223cf6adefc4..f72dbac8ed415441079d6c1ad3e11677f818bd21 100644 (file)
@@ -55,6 +55,7 @@ from modules.webkitport import WebKitPort
 from modules.workqueue import WorkQueue, WorkQueueDelegate
 
 class AbstractQueue(Command, WorkQueueDelegate):
+    watchers = "webkit-bot-watchers@googlegroups.com"
     def __init__(self, options=[]):
         options += [
             make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
@@ -62,6 +63,12 @@ class AbstractQueue(Command, WorkQueueDelegate):
         ]
         Command.__init__(self, "Run the %s" % self.name, options=options)
 
+    def _cc_watchers(self, bug_id):
+        try:
+            self.tool.bugs.add_cc_to_bug(bug_id, self.watchers)
+        except Exception, e:
+            log("Failed to CC watchers: %s." % e)
+
     def queue_log_path(self):
         return "%s.log" % self.name
 
@@ -135,6 +142,7 @@ class CommitQueue(AbstractQueue, LandingSequenceErrorHandler):
         return (True, "Landing patch %s from bug %s." % (patch["id"], patch["bug_id"]), patch)
 
     def process_work_item(self, patch):
+        self._cc_watchers(patch["bug_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):
@@ -213,7 +221,7 @@ class StyleQueue(AbstractTryQueue):
             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)
+            tool.bugs.post_comment_to_bug(patch["bug_id"], message, cc=cls.watchers)
 
 
 class BuildQueue(AbstractTryQueue):