Title: [97530] trunk/Tools
Revision
97530
Author
[email protected]
Date
2011-10-14 16:13:28 -0700 (Fri, 14 Oct 2011)

Log Message

watchlist: Add a validation check for the email names in the list.
https://bugs.webkit.org/show_bug.cgi?id=70154

Reviewed by Adam Barth.

If an email is listed which doesn't have a bugzilla log in, then any emails
added to the bug along with that email will fail to happen, so try to prevent this
from happening by validating that emails added to the watchlist are known to be
contributors.

* Scripts/webkitpy/common/config/committers.py: Add my other email aliases for bugzilla.
* Scripts/webkitpy/common/watchlist/watchlistparser.py: Add the check.
* Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py: A unit test for the check.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (97529 => 97530)


--- trunk/Tools/ChangeLog	2011-10-14 23:04:54 UTC (rev 97529)
+++ trunk/Tools/ChangeLog	2011-10-14 23:13:28 UTC (rev 97530)
@@ -22,6 +22,22 @@
 
 2011-10-14  David Levin  <[email protected]>
 
+        watchlist: Add a validation check for the email names in the list.
+        https://bugs.webkit.org/show_bug.cgi?id=70154
+
+        Reviewed by Adam Barth.
+
+        If an email is listed which doesn't have a bugzilla log in, then any emails
+        added to the bug along with that email will fail to happen, so try to prevent this
+        from happening by validating that emails added to the watchlist are known to be
+        contributors.
+
+        * Scripts/webkitpy/common/config/committers.py: Add my other email aliases for bugzilla.
+        * Scripts/webkitpy/common/watchlist/watchlistparser.py: Add the check.
+        * Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py: A unit test for the check.
+
+2011-10-14  David Levin  <[email protected]>
+
         watchlist: If the style check fails, then the watchlist will not be run.
         https://bugs.webkit.org/show_bug.cgi?id=69484
 

Modified: trunk/Tools/Scripts/webkitpy/common/config/committers.py (97529 => 97530)


--- trunk/Tools/Scripts/webkitpy/common/config/committers.py	2011-10-14 23:04:54 UTC (rev 97529)
+++ trunk/Tools/Scripts/webkitpy/common/config/committers.py	2011-10-14 23:13:28 UTC (rev 97530)
@@ -357,7 +357,7 @@
     Reviewer("David Harrison", "[email protected]", "harrison"),
     Reviewer("David Hyatt", "[email protected]", ["dhyatt", "hyatt"]),
     Reviewer("David Kilzer", ["[email protected]", "[email protected]"], "ddkilzer"),
-    Reviewer("David Levin", "[email protected]", "dave_levin"),
+    Reviewer("David Levin", ["[email protected]", "[email protected]", "[email protected]"], "dave_levin"),
     Reviewer("Dean Jackson", "[email protected]", "dino"),
     Reviewer("Dimitri Glazkov", "[email protected]", "dglazkov"),
     Reviewer("Dirk Pranke", "[email protected]", "dpranke"),

Modified: trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py (97529 => 97530)


--- trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py	2011-10-14 23:04:54 UTC (rev 97529)
+++ trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py	2011-10-14 23:13:28 UTC (rev 97530)
@@ -35,6 +35,7 @@
 from webkitpy.common.watchlist.filenamepattern import FilenamePattern
 from webkitpy.common.watchlist.watchlist import WatchList
 from webkitpy.common.watchlist.watchlistrule import WatchListRule
+from webkitpy.common.config.committers import CommitterList
 
 
 class WatchListParser(object):
@@ -129,6 +130,12 @@
         self._validate_definitions(cc_definitions_set, self._CC_RULES, watch_list)
         self._validate_definitions(messages_definitions_set, self._MESSAGE_RULES, watch_list)
 
+        contributors = CommitterList()
+        for cc_rule in watch_list.cc_rules:
+            for email in cc_rule.instructions():
+                if not contributors.contributor_by_email(email):
+                    raise Exception("The email alias %s which is in the watchlist is not listed as a contributor in committers.py" % email)
+
     def _verify_all_definitions_are_used(self, watch_list, used_definitions):
         definitions_not_used = set(watch_list.definitions.keys())
         definitions_not_used.difference_update(used_definitions)

Modified: trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py (97529 => 97530)


--- trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py	2011-10-14 23:04:54 UTC (rev 97529)
+++ trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py	2011-10-14 23:13:28 UTC (rev 97530)
@@ -117,6 +117,22 @@
         self.assertRaisesRegexp(Exception, r'A rule for definition "WatchList1" is empty, so it should be deleted.',
                                 self._watch_list_parser.parse, watch_list)
 
+    def test_cc_rule_with_invalid_email(self):
+        watch_list = (
+            '{'
+            '    "DEFINITIONS": {'
+            '        "WatchList1": {'
+            '            "filename": r".*\\MyFileName\\.cpp",'
+            '        },'
+            '     },'
+            '    "CC_RULES": {'
+            '        "WatchList1": ["[email protected]"],'
+            '     },'
+            '}')
+
+        self.assertRaisesRegexp(Exception, r'The email alias levin\+bad\[email protected] which is in the watchlist is not listed as a contributor in committers\.py',
+                                self._watch_list_parser.parse, watch_list)
+
     def test_empty_message_rule(self):
         watch_list = (
             '{'
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to