Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/review/git-codereview: automatically assign reviewers #17555

Closed
josharian opened this issue Oct 23, 2016 · 14 comments
Closed

x/review/git-codereview: automatically assign reviewers #17555

josharian opened this issue Oct 23, 2016 · 14 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@josharian
Copy link
Contributor

Many contributors don't assign a reviewer to their CLs, either because they don't think they need to or they don't know who would be a good reviewer. In theory, those CLs are supposed to get promptly triaged and assigned reviewers. In practice, they aren't, and CLs fall through the cracks.

I suggest that when 'git mail' is invoked without specifying a reviewer with the -r flag, it automatically selects one.

The selection algorithm can be tuned over time, but as an initial pass, I'd suggest a recency-weighted sum of who has committed to and/or reviewed the files touched by the CL, falling back to directories/parent directories as needed for new files/directories. The initial reviewer can always redirect to another reviewer if the algorithm guesses wrong.

If the CL contains DO NOT REVIEW or DO NOT SUBMIT, it will not automatically select a reviewer.

This won't help with people who don't use git-codereview. An alternative that would cover them is to set up a bot that monitors CLs and does the automatic reviewer assignment. Doing it in git-codereview seems simpler and easier and probably sufficient, though.

Feedback requested.

cc @bradfitz @adg @quentinmit @spf13

@josharian josharian added this to the Unreleased milestone Oct 23, 2016
@cznic
Copy link
Contributor

cznic commented Oct 23, 2016

Many contributors don't assign a reviewer to their CLs, either because they don't think they need to or they don't know who would be a good reviewer.

FTR: Some contributors, me included, do not normally assign a reviewer because they are told not to do so:

Contribution Guidelines/Mail the change for review
Unless explicitly told otherwise, such as in the discussion leading up to sending in the change list, it's better not to specify a reviewer.

@alexd765
Copy link
Contributor

I agree with cznic: this feels like a documentation issue.

I don't assign a reviewer because i am told to do so. If we just change the guidelines I feel even I as a newbie contributor could figure out a possible reviewer.

@ALTree
Copy link
Member

ALTree commented Oct 23, 2016

I don't think changing the documentation will be enough to solve this problem.

Suppose we write something like

once you've uploaded your change, assign it to an appropriate reviewer.

Then what? I've contributed for like 2 years I don't really know who should I add as a reviewer on half of the changes I upload... I doubt a novice contributor will know better.

@ALTree
Copy link
Member

ALTree commented Oct 23, 2016

One possible solution could be to write a wiki page with a map package -> [list of suggested reviewers]. For example

net -> bradfitz
math/big -> gri

etc... but if we can compile such a list easily, then it could be a good idea to also include it in the codereview tool for automatic assignment like josharian suggests.

@dominikh
Copy link
Member

Related issue: #12364

@rakyll
Copy link
Contributor

rakyll commented Oct 25, 2016

Related to #12364, we should probably can create a list of reviewers by looking at who has approved reviews for the package in the past X months and blame the previous author of the lines. Then, pick 2 or 3 people and assign the CL to them.

Btw, none of this has to be done in the codereview program. We should probably use Gerrit hooks if we want to automate the assignment.

@minux
Copy link
Member

minux commented Oct 25, 2016 via email

@dsnet
Copy link
Member

dsnet commented Jul 15, 2017

I should mention that we now have https://golang.org/s/owners which is a rough list of owners per package.

@jessfraz
Copy link
Contributor

jessfraz commented Jul 15, 2017 via email

@ysmolski
Copy link
Member

Is this being worked on actively?

My thinking is that having owners in spreadsheet is a maintenance burden. That doc has not beed updated in 1 year.

What if there could be some kind of package which can return suggested reviews based on the change, older changes along with reviewes? It could be a package using which we can build additions to Gerrit, git-codereview, and other tools. I am a new contributor to the project and have really hard times trying to figure out the reviewers.

@josharian
Copy link
Contributor Author

cc @andybons

@rakyll
Copy link
Contributor

rakyll commented Mar 21, 2018

I created a CL a while ago to introduce an owners package, but I am too busy to keep working on it at this point. See https://go-review.googlesource.com/c/build/+/39390.

@andybons andybons self-assigned this Mar 21, 2018
@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 21, 2018
@andybons
Copy link
Member

There is a plan to create an endpoint on dev.golang.org that can be queried both by humans and machines to find owners. @rakyll’s prior work on this will be helpful. Thanks!

@dmitshur
Copy link
Contributor

@andybons I think this issue has been resolved by CL 121018 (though that CL doesn't mention it in the commit message), is that right? If so, we can close this issue.

@golang golang locked and limited conversation to collaborators Sep 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests