RESOLVED FIXED 106629
Extend sheriffbot's "help" command to be able to get help on individual commands
https://bugs.webkit.org/show_bug.cgi?id=106629
Summary Extend sheriffbot's "help" command to be able to get help on individual commands
Alan Cutter
Reported 2013-01-10 19:33:50 PST
Currently sheriffbot's "help" command only spits out a list of commands. There is no formal way to query those commands individually.
Attachments
Patch (14.87 KB, patch)
2013-01-14 22:47 PST, Alan Cutter
no flags
Patch (13.65 KB, patch)
2013-01-15 00:52 PST, Alan Cutter
no flags
Patch (13.78 KB, patch)
2013-01-15 15:03 PST, Alan Cutter
no flags
Alan Cutter
Comment 1 2013-01-14 22:47:31 PST
Eric Seidel (no email)
Comment 2 2013-01-14 22:53:32 PST
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"
Alan Cutter
Comment 3 2013-01-15 00:52:30 PST
Alan Cutter
Comment 4 2013-01-15 01:02:43 PST
(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.
Eric Seidel (no email)
Comment 5 2013-01-15 01:15:46 PST
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. :)
Alan Cutter
Comment 6 2013-01-15 15:03:19 PST
Alan Cutter
Comment 7 2013-01-15 15:05:39 PST
(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!
Eric Seidel (no email)
Comment 8 2013-01-15 15:09:33 PST
Comment on attachment 182851 [details] Patch LGTM.
WebKit Review Bot
Comment 9 2013-01-15 16:03:47 PST
Comment on attachment 182851 [details] Patch Clearing flags on attachment: 182851 Committed r139805: <http://trac.webkit.org/changeset/139805>
WebKit Review Bot
Comment 10 2013-01-15 16:03:53 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.