Last Comment Bug 774145 - mach command to find reviewer for patch
: mach command to find reviewer for patch
Status: NEW
[mach]
:
Product: Core
Classification: Components
Component: mach (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Mike Hoye [:mhoye]
:
Mentors:
Depends on:
Blocks: machfeatures
  Show dependency treegraph
 
Reported: 2012-07-15 18:16 PDT by Gregory Szorc [:gps]
Modified: 2014-09-11 11:58 PDT (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Gregory Szorc [:gps] 2012-07-15 18:16:32 PDT
Mach should provide a way to easily identify a recommended reviewer for a patch.

What this is really asking for is a way to identify stakeholders in a file. An obvious application is to find reviewers for a patch. But, it could also be used to look up who to contact with questions on a specific file. Perhaps this could interact with the mozillians.org phonebook (is there an API) to retrieve contact information, etc.

I think this goes beyond just `hg blame` because it will need to parse commit messages to extract the reviewer. It's not enough to just look at the author of a commit because they may not be a reviewer.
Comment 1 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2012-07-16 06:35:55 PDT
This is interesting. I think that there are really two parts to this, and we should perhaps separate them. 

1) algorithmic part of figuring out who a good reviewer is for a patch
2) exposing that in mach

Part 1 would be equally or even more useful in bugzilla and is one of the short list of bugzilla improvements that we really want but haven't had time for; so I personally think we should try to expose that as a web service that can be access both from mach and from bugzilla.
Comment 2 Gregory Szorc [:gps] 2012-07-16 11:07:32 PDT
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #1)
> This is interesting. I think that there are really two parts to this, and we
> should perhaps separate them. 
> 
> 1) algorithmic part of figuring out who a good reviewer is for a patch
> 2) exposing that in mach

We will definitely separate them. mach is really just a frontend to a bunch of Python modules in the mozbuild (and other) packages. Making everything a library is a requirement for getting r+ on new mach/mozbuild features.

> Part 1 would be equally or even more useful in bugzilla and is one of the
> short list of bugzilla improvements that we really want but haven't had time
> for; so I personally think we should try to expose that as a web service
> that can be access both from mach and from bugzilla.

That's a cool idea! Are there any bugs on file?
Comment 3 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2012-07-16 11:47:25 PDT
glob says there are no existing bugs files for bugzilla integration, I'll rectify that.
sfink says https://bitbucket.org/sfink/mqext/ has `hg reviewers`
Comment 4 Jeff Hammel 2012-09-26 13:57:27 PDT
Mercy on high this is a great idea
Comment 5 Josh Matthews [:jdm] 2012-09-26 14:08:04 PDT
See https://github.com/bwinton/Mozilla-Tools/blob/master/getReviewer.py for some code that might be integratable.
Comment 6 Steve Fink [:sfink] [:s:] 2012-09-26 15:00:18 PDT
(In reply to Josh Matthews [:jdm] from comment #5)
> See https://github.com/bwinton/Mozilla-Tools/blob/master/getReviewer.py for
> some code that might be integratable.

I think that's the code I started with for mqext's |hg reviewers|. I don't think I added much that was unrelated to the hg integration, though I may have modified the regexes a bit.
Comment 7 Mike Hoye [:mhoye] 2013-07-17 12:02:53 PDT
This one's on me as a q3 goal.
Comment 8 Saurabh Anand [:sawrubh] 2014-09-10 23:41:54 PDT
A polite little bump. Any action going on? I would love to have this feature!
Comment 9 Steve Fink [:sfink] [:s:] 2014-09-11 11:58:54 PDT
I don't know of any activity, but just to be sure you're aware of the status quo:

- mach mercurial-setup will install mqext, which includes an |hg reviewers| command.
- |hg reviewers| by default will look at the top patch in your mq queue.
- |hg reviewers -f <filename>| will give you reviewers for a particular file.
- the IRC bot "mrgiggles" will run the above command for you. Example:

  /msg mrgiggles who has reviewed nsJSEnvironment.cpp?

will give you back a response like

  smaug x 59, mccr8 x 24, bz x 19

(You'll also see people ask publicly in channels that mrgiggles hangs out in, usually using the syntax "who can review XXX.cpp?". And if you want mrgiggles in another channel, just /invite him.)

None of this is to say that this bug is unnecessary. It would be best if this functionality were incorporated into mach.

Note You need to log in before you can comment on or make changes to this bug.