Update scripts to reference contributors.json instead of committers.py in messaging
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2013 19:26:22 +0000 (19:26 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2013 19:26:22 +0000 (19:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119342

Reviewed by Ryosuke Niwa.

Change the scripts to point people to contributors.json instead of
committers.py since the latter no longer contains the list of
contributors.

* Scripts/webkitpy/common/config/committervalidator.py:
(CommitterValidator._contributors_json_path):
(CommitterValidator._flag_permission_rejection_message):
* Scripts/webkitpy/common/config/committervalidator_unittest.py:
(CommitterValidatorTest.test_flag_permission_rejection_message):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla._commit_queue_flag):
* Scripts/webkitpy/common/watchlist/watchlistparser.py:
(WatchListParser._validate):
* Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py:
(WatchListParserTest.test_cc_rule_with_invalid_email):
* Scripts/webkitpy/tool/bot/feeders_unittest.py:
* Scripts/webkitpy/tool/commands/queues_unittest.py:
* Scripts/webkitpy/tool/steps/validatereviewer.py:
(ValidateReviewer.run):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/common/config/committervalidator.py
Tools/Scripts/webkitpy/common/config/committervalidator_unittest.py
Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py
Tools/Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py
Tools/Scripts/webkitpy/tool/bot/feeders_unittest.py
Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
Tools/Scripts/webkitpy/tool/steps/validatereviewer.py

index 2c8c676..2499190 100644 (file)
@@ -1,3 +1,30 @@
+2013-07-31  Bem Jones-Bey  <bjonesbe@adobe.com>
+
+        Update scripts to reference contributors.json instead of committers.py in messaging
+        https://bugs.webkit.org/show_bug.cgi?id=119342
+
+        Reviewed by Ryosuke Niwa.
+
+        Change the scripts to point people to contributors.json instead of
+        committers.py since the latter no longer contains the list of
+        contributors.
+
+        * Scripts/webkitpy/common/config/committervalidator.py:
+        (CommitterValidator._contributors_json_path):
+        (CommitterValidator._flag_permission_rejection_message):
+        * Scripts/webkitpy/common/config/committervalidator_unittest.py:
+        (CommitterValidatorTest.test_flag_permission_rejection_message):
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+        (Bugzilla._commit_queue_flag):
+        * Scripts/webkitpy/common/watchlist/watchlistparser.py:
+        (WatchListParser._validate):
+        * Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py:
+        (WatchListParserTest.test_cc_rule_with_invalid_email):
+        * Scripts/webkitpy/tool/bot/feeders_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+        (ValidateReviewer.run):
+
 2013-07-31  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. Re-enable WinEWS tests following r153527.
index 89a4866..c3b289b 100644 (file)
@@ -35,17 +35,16 @@ class CommitterValidator(object):
     def __init__(self, host):
         self.host = host
 
-    def _committers_py_path(self):
-        # extension can sometimes be .pyc, we always want .py
-        committers_path = self.host.filesystem.path_to_module(committers.__name__)
-        (path, extension) = self.host.filesystem.splitext(committers_path)
-        path = self.host.filesystem.relpath(path, self.host.scm().checkout_root)
-        return ".".join([path, "py"])
+    def _contributors_json_path(self):
+        # contributors.json resides in the same directory as committers.py
+        dirname = self.host.filesystem.dirname(self.host.filesystem.path_to_module(committers.__name__))
+        path = self.host.filesystem.join(dirname, 'contributors.json')
+        return self.host.filesystem.relpath(path, self.host.scm().checkout_root)
 
     def _flag_permission_rejection_message(self, setter_email, flag_name):
         # This could be queried from the tool.
         queue_name = "commit-queue"
-        committers_list = self._committers_py_path()
+        committers_list = self._contributors_json_path()
         message = "%s does not have %s permissions according to %s." % (
                         setter_email,
                         flag_name,
index e8aa887..9e684ac 100644 (file)
@@ -35,10 +35,10 @@ from .committervalidator import CommitterValidator
 class CommitterValidatorTest(unittest.TestCase):
     def test_flag_permission_rejection_message(self):
         validator = CommitterValidator(MockHost())
-        self.assertEqual(validator._committers_py_path(), "Tools/Scripts/webkitpy/common/config/committers.py")
-        expected_messsage = """foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
+        self.assertEqual(validator._contributors_json_path(), "Tools/Scripts/webkitpy/common/config/contributors.json")
+        expected_messsage = """foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.
 
 - If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
 
-- If you have review rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your review rights."""
+- If you have review rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your review rights."""
         self.assertMultiLineEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage)
index bcd41b7..b25d740 100644 (file)
@@ -534,10 +534,10 @@ class Bugzilla(object):
             user = self.committers.contributor_by_email(self.username)
             mark_for_commit_queue = True
             if not user:
-                _log.warning("Your Bugzilla login is not listed in committers.py. Uploading with cq? instead of cq+")
+                _log.warning("Your Bugzilla login is not listed in contributors.json. Uploading with cq? instead of cq+")
                 mark_for_landing = False
             elif not user.can_commit:
-                _log.warning("You're not a committer yet or haven't updated committers.py yet. Uploading with cq? instead of cq+")
+                _log.warning("You're not a committer yet or haven't updated contributors.json yet. Uploading with cq? instead of cq+")
                 mark_for_landing = False
 
         if mark_for_landing:
index 1d3f581..b6e305f 100644 (file)
@@ -154,7 +154,7 @@ class WatchListParser(object):
             for email in intructions_copy:
                 if not accounts.contributor_by_email(email):
                     cc_rule.remove_instruction(email)
-                    self._log_error("The email alias %s which is in the watchlist is not listed as a contributor in committers.py" % email)
+                    self._log_error("The email alias %s which is in the watchlist is not listed as a contributor in contributors.json" % email)
                     continue
 
     def _verify_all_definitions_are_used(self, watch_list, used_definitions):
index d06a72d..676395e 100644 (file)
@@ -183,7 +183,7 @@ class WatchListParserTest(webkitunittest.TestCase):
 
         OutputCapture().assert_outputs(self, self._watch_list_parser.parse, args=[watch_list],
                                        expected_logs='The email alias levin+bad+email@chromium.org which is'
-                                       + ' in the watchlist is not listed as a contributor in committers.py\n')
+                                       + ' in the watchlist is not listed as a contributor in contributors.json\n')
 
     def test_cc_rule_with_secondary_email(self):
         # FIXME: We should provide a mock of CommitterList so that we can test this on fake data.
index b70a637..352e3b1 100644 (file)
@@ -40,11 +40,11 @@ class FeedersTest(unittest.TestCase):
         feeder = CommitQueueFeeder(MockTool())
         expected_logs = """Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com)
 Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com)
-MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\nnon-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
+MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\nnon-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.
 
 - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
 
-- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.'
+- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.'
 MOCK: update_work_items: commit-queue [10005, 10000]
 Feeding commit-queue items [10005, 10000]
 """
index a09164d..5303c99 100644 (file)
@@ -134,11 +134,11 @@ class FeederQueueTest(QueuesTest):
             "begin_work_queue": self._default_begin_work_queue_logs("feeder-queue"),
             "process_work_item": """Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com)
 Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com)
-MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\nnon-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.
+MOCK setting flag 'commit-queue' to '-' on attachment '10001' with comment 'Rejecting attachment 10001 from commit-queue.\n\nnon-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.
 
 - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
 
-- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.'
+- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.'
 MOCK: update_work_items: commit-queue [10005, 10000]
 Feeding commit-queue items [10005, 10000]
 Feeding EWS (1 r? patch, 1 new)
index 90ddf5b..08eedfc 100644 (file)
@@ -55,6 +55,6 @@ class ValidateReviewer(AbstractStep):
                 continue
             reviewer_text = changelog_entry.reviewer_text()
             if reviewer_text:
-                _log.info("%s found in %s does not appear to be a valid reviewer according to committers.py." % (reviewer_text, changelog_path))
+                _log.info("%s found in %s does not appear to be a valid reviewer according to contributors.json." % (reviewer_text, changelog_path))
             _log.error('%s neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).' % changelog_path)
             sys.exit(1)