Currently sheriffbot's "help" command only spits out a list of commands. There is no formal way to query those commands individually.
Created attachment 182705 [details] Patch
Comment on attachment 182705 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182705&action=review > Tools/Scripts/webkitpy/tool/bot/irc_command.py:86 > + @staticmethod > + def usage(nick): > + return "%s: Usage: create-bug BUG_TITLE" % nick I wouldn't make these static. And I would instead just have a string which is used by a default impl. // on the baseclass: usage = None def usage(self, nick): return "%s: Usage: %s" % self.usage_string // on the subclass: usage = "create-bug BUG_TITLE"
Created attachment 182714 [details] Patch
(In reply to comment #2) > (From update of attachment 182705 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=182705&action=review > > > Tools/Scripts/webkitpy/tool/bot/irc_command.py:86 > > + @staticmethod > > + def usage(nick): > > + return "%s: Usage: create-bug BUG_TITLE" % nick > > I wouldn't make these static. And I would instead just have a string which is used by a default impl. > > // on the baseclass: > usage = None > > def usage(self, nick): > return "%s: Usage: %s" % self.usage_string > > // on the subclass: > usage = "create-bug BUG_TITLE" Removed staticmethod annotation. Good call, the subclasses look a ton nicer with two simple string members at the top.
Comment on attachment 182714 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182714&action=review This is fantastic! So much better than what we currently have. We could quibble about the exact help strings, but this is also OK to land as is. > Tools/Scripts/webkitpy/tool/bot/irc_command.py:58 > + @classmethod I think these are OK as classmethods (definitely more easily mocked than static methods!), but still better as instance methods unless you need them to be class methods for some usage. I used to be big on static/class methods in python, until I realized they were a huge pain to test/mock well. BUt maybe I'm just poor at testing. :) > Tools/Scripts/webkitpy/tool/bot/irc_command.py:124 > + help_string = "Restarts sheriffbot." I might even give a little more info. "Restarts sherrifbot. Will update its WebKit checkout, and re-join the channel momentarily." > Tools/Scripts/webkitpy/tool/bot/irc_command.py:171 > + help_string = "Creates a patch for the reverse diff of the given revision(s) and flags it as commit-queue?." "Opens a rollout bug, CCing author + reviewer, and attaching the reverse-diff of the given revisions marked as commit-queue=?" might give a little more info? > Tools/Scripts/webkitpy/tool/bot/irc_command.py:292 > + help_string = "Searches the known contributors/committers/reviewers for additional information about them." "Searches known contributors and returns any matches with irc, email and full name."? I'm not sure that's better, but "contributors" implies the other two categories. :)
Created attachment 182851 [details] Patch
(In reply to comment #5) > > Tools/Scripts/webkitpy/tool/bot/irc_command.py:124 > > + help_string = "Restarts sheriffbot." > > I might even give a little more info. "Restarts sherrifbot. Will update its WebKit checkout, and re-join the channel momentarily." > > > Tools/Scripts/webkitpy/tool/bot/irc_command.py:171 > > + help_string = "Creates a patch for the reverse diff of the given revision(s) and flags it as commit-queue?." > > "Opens a rollout bug, CCing author + reviewer, and attaching the reverse-diff of the given revisions marked as commit-queue=?" might give a little more info? > > > Tools/Scripts/webkitpy/tool/bot/irc_command.py:292 > > + help_string = "Searches the known contributors/committers/reviewers for additional information about them." > > "Searches known contributors and returns any matches with irc, email and full name."? I'm not sure that's better, but "contributors" implies the other two categories. :) Updated help messages. I'm glad you made these suggestions since I haven't even used most of these commands!
Comment on attachment 182851 [details] Patch LGTM.
Comment on attachment 182851 [details] Patch Clearing flags on attachment: 182851 Committed r139805: <http://trac.webkit.org/changeset/139805>
All reviewed patches have been landed. Closing bug.