webkitbot refers to sheriffbot in help
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 21:25:20 +0000 (21:25 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 21:25:20 +0000 (21:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114307

Reviewed by Benjamin Poulain.

Fixed the bug by proxying the IRC nickname of "sheriffbot" via Sheriff object.

* Scripts/webkitpy/tool/bot/irc_command.py:
(Help):
(Help.execute):
(RollChromiumDEPS.execute):
* Scripts/webkitpy/tool/bot/ircbot_unittest.py:
(IRCBotTest.test_help):
* Scripts/webkitpy/tool/bot/sheriff.py:
(Sheriff.name):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/tool/bot/irc_command.py
Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
Tools/Scripts/webkitpy/tool/bot/sheriff.py

index 119c7e8187e201adf6d7444171f3cdbca218f971..f594a13331c59c486274eb384d49a5d71435b89a 100644 (file)
@@ -1,3 +1,21 @@
+2013-04-09  Ryosuke Niwa  <rniwa@webkit.org>
+
+        webkitbot refers to sheriffbot in help
+        https://bugs.webkit.org/show_bug.cgi?id=114307
+
+        Reviewed by Benjamin Poulain.
+
+        Fixed the bug by proxying the IRC nickname of "sheriffbot" via Sheriff object.
+
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        (Help):
+        (Help.execute):
+        (RollChromiumDEPS.execute):
+        * Scripts/webkitpy/tool/bot/ircbot_unittest.py:
+        (IRCBotTest.test_help):
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+        (Sheriff.name):
+
 2013-04-06  Roger Fong  <roger_fong@apple.com>
 
         Kill old processes between runs on WinEWS bots.
index 473eb16d6bf1b049d1cbfa57b934dbedd7352e82..064f5299640d0a9e77ce5e9607e5ddccd56f4da7 100644 (file)
@@ -90,7 +90,7 @@ class CreateBug(IRCCommand):
 
 class Help(IRCCommand):
     usage_string = "help [COMMAND]"
-    help_string = "Provides help on individual sheriffbot commands."
+    help_string = "Provides help on my individual commands."
 
     def execute(self, nick, args, tool, sheriff):
         if args:
@@ -99,7 +99,7 @@ class Help(IRCCommand):
                     self._post_command_help(nick, tool, commands[command_name])
         else:
             tool.irc().post("%s: Available commands: %s" % (nick, ", ".join(sorted(visible_commands.keys()))))
-            tool.irc().post('%s: Type "sheriffbot: help COMMAND" for help on individual commands.' % nick)
+            tool.irc().post('%s: Type "%s: help COMMAND" for help on my individual commands.' % (nick, sheriff.name()))
 
     def _post_command_help(self, nick, tool, command):
         tool.irc().post(command.usage(nick))
@@ -153,7 +153,7 @@ class RollChromiumDEPS(IRCCommand):
 
         roll_target = "r%s" % revision if revision.isdigit() else "last-known good revision"
         tool.irc().post("%s: Rolling Chromium DEPS to %s" % (nick, roll_target))
-        changelog_message = "Unreviewed.  Rolled Chromium DEPS to %s.  Requested by %s via sheriffbot.\n\n" % (roll_target, self._expand_irc_nickname(nick))
+        changelog_message = "Unreviewed.  Rolled Chromium DEPS to %s.  Requested by %s via %s.\n\n" % (roll_target, self._expand_irc_nickname(nick), sheriff.name())
 
         try:
             bug_id = sheriff.post_chromium_deps_roll(revision, roll_target, changelog_message)
index c83569bc76b5ecb89776271bd4beeee0f02b019f..d0062c9614b15b971a6d6dc500e2632e07d76d6f 100644 (file)
@@ -88,7 +88,7 @@ class IRCBotTest(unittest.TestCase):
         OutputCapture().assert_outputs(self, run, args=["hi"], expected_logs=expected_logs)
 
     def test_help(self):
-        expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, sheriffs, whois\nMOCK: irc.post: mock_nick: Type "sheriffbot: help COMMAND" for help on individual commands.\n'
+        expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, sheriffs, whois\nMOCK: irc.post: mock_nick: Type "mock-sheriff-bot: help COMMAND" for help on my individual commands.\n'
         OutputCapture().assert_outputs(self, run, args=["help"], expected_logs=expected_logs)
         expected_logs = 'MOCK: irc.post: mock_nick: Usage: hi\nMOCK: irc.post: mock_nick: Retrieves a random quip from Bugzilla.\nMOCK: irc.post: mock_nick: Aliases: hello\n'
         OutputCapture().assert_outputs(self, run, args=["help hi"], expected_logs=expected_logs)
index 38e4bf2b51959e0eeb66222d02e58cc9383b86d6..f80f5b51fb665e4b88750110f82697073268aa87 100644 (file)
@@ -36,6 +36,9 @@ class Sheriff(object):
         self._tool = tool
         self._sheriffbot = sheriffbot
 
+    def name(self):
+        return self._sheriffbot.name
+
     def responsible_nicknames_from_commit_info(self, commit_info):
         nestedList = [party.irc_nicknames for party in commit_info.responsible_parties() if party.irc_nicknames]
         return reduce(lambda list, childList: list + childList, nestedList)