Bug 106629 - Extend sheriffbot's "help" command to be able to get help on individual commands
Summary: Extend sheriffbot's "help" command to be able to get help on individual commands
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alan Cutter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-10 19:33 PST by Alan Cutter
Modified: 2013-01-15 16:03 PST (History)
5 users (show)

See Also:


Attachments
Patch (14.87 KB, patch)
2013-01-14 22:47 PST, Alan Cutter
no flags Details | Formatted Diff | Diff
Patch (13.65 KB, patch)
2013-01-15 00:52 PST, Alan Cutter
no flags Details | Formatted Diff | Diff
Patch (13.78 KB, patch)
2013-01-15 15:03 PST, Alan Cutter
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Cutter 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.
Comment 1 Alan Cutter 2013-01-14 22:47:31 PST
Created attachment 182705 [details]
Patch
Comment 2 Eric Seidel (no email) 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"
Comment 3 Alan Cutter 2013-01-15 00:52:30 PST
Created attachment 182714 [details]
Patch
Comment 4 Alan Cutter 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.
Comment 5 Eric Seidel (no email) 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. :)
Comment 6 Alan Cutter 2013-01-15 15:03:19 PST
Created attachment 182851 [details]
Patch
Comment 7 Alan Cutter 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!
Comment 8 Eric Seidel (no email) 2013-01-15 15:09:33 PST
Comment on attachment 182851 [details]
Patch

LGTM.
Comment 9 WebKit Review Bot 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>
Comment 10 WebKit Review Bot 2013-01-15 16:03:53 PST
All reviewed patches have been landed.  Closing bug.