-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fallback to approvers as reviewers #7742
Fallback to approvers as reviewers #7742
Conversation
Can we just make the review list the union of approvers and reviewers? |
I would argue for falling back to approvers by default (no config option). |
@@ -61,6 +61,9 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin | |||
} | |||
|
|||
type ownersClient interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you should provide a different implementation of the ownersClient
that returns approvers instead of duplicating methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'll experiment with that approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevekuznetsov RFAL.
/ok-to-test |
Please get this to pass tests? |
I haven't had time to work on this recently. :( If someone else wants to
pick it up, feel free. Otherwise I'll try to carve out some time next week.
…On Sat, May 12, 2018, 11:12 AM Erick Fejta ***@***.***> wrote:
Please get this to pass tests?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7742 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAACqJVBbD7g2N3GvFYQ0hL-PlnljHIWks5txyYPgaJpZM4TZFiE>
.
|
e6166ac
to
6a7566f
Compare
Where should the fallback live? Should the behavior of |
If we make the reviewer set the combination of everyone in reviewers and approvers then we do not need a fallback option, right? |
I don't think we should do that. We want to prioritize using the reviewers over the approvers and only use the approvers as a last resort if no reviewers are found. If we union the approvers and reviewers we can't distinguish them. I think the fallback belongs in blunderbuss. Not all potential consumers of OWNERS file data from |
I removed the type reviewersClient interface {
FindReviewersOwnersForFile(path string) string
Reviewers(path string) sets.String
LeafReviewers(path string) sets.String
}
type ownersClient interface {
reviewersClient
FindApproverOwnersForFile(path string) string
Approvers(path string) sets.String
LeafApprovers(path string) sets.String
} That allows this implementation of type fallbackReviewersClient struct {
ownersClient
}
func (foc fallbackReviewersClient) FindReviewersOwnersForFile(path string) string {
return foc.ownersClient.FindApproverOwnersForFile(path)
}
func (foc fallbackReviewersClient) Reviewers(path string) sets.String {
return foc.ownersClient.Approvers(path)
}
func (foc fallbackReviewersClient) LeafReviewers(path string) sets.String {
return foc.ownersClient.LeafApprovers(path)
} |
I disagree that approvers should not share the burden of reviewing code. People who do not review the code should not be approving the code. The intent of the reviewer system is to support overloaded code owners, not create a caste system where as soon as we add a reviewer the approvers are forever freed from the burden of doing initial reviews. |
Prow as a software product doesn’t need to dictate that, though. That situation would be solved by having that user in both the reviewer and the approver section (what we do in most places anyways). This allows us to have the flexibility to allow a particular overloaded approver to drop from the frontline pool without revoking their approval rights. |
I changed the name of the config option to @fejta I agree with you that making this explicit in OWNERS is probably a better solution, but a much more extensive one. |
On this PR: it looks good to me. Falling back seems like a sane default. Should probably squash out commits before merge. On the social friction bikeshed: I agree from a healthy ecosystem point of view, but I'm not convinced that embedding that prow is needed. Maintaining healthy reviewer/approver pools (ensuring reviewers and approvers are active and responsive) is more critical to me. |
If there aren't enough qualified reviewers available (as determined by the reviewer_count option), then fall back to using approvers as reviewers. This is most useful for projects that don't have a reviewer role. Those projects may now use OWNERS files containing only approvers lists. This is now the default behavior, so approvers which are not in any reviewer lists may now get review requests when they didn't before. To return to the previous behavior of only considering reviewers, set the exclude_approvers option to true.
ff84f72
to
48d7aae
Compare
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
I remain convinced that combining approvers and reviewers into the reviewer set is the right default, but we don't need to resolve this conflict in this PR. And falling back to approvers is certainly better than the current situation.
Thanks!
@@ -107,12 +131,28 @@ func handle(ghc githubClient, oc ownersClient, log *logrus.Entry, reviewerCount, | |||
return err | |||
} | |||
if missing := *reviewerCount - len(reviewers); missing > 0 { | |||
log.Warnf("Not enough reviewers found in OWNERS files for files touched by this PR. %d/%d reviewers found.", len(reviewers), reviewerCount) | |||
log.Warnf("Not enough reviewers found in OWNERS files for files touched by this PR. %d/%d reviewers found.", len(reviewers), *reviewerCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this only warn if excludeApprovers
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to warn after fallback to approvers (if enabled). WDYT?
} | ||
} | ||
|
||
if len(reviewers) > 0 { | ||
if maxReviewers > 0 && len(reviewers) > maxReviewers { | ||
log.Warnf("Limiting request of %d reviewers to %d maxReviewers.", len(reviewers), maxReviewers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more like info to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @fejta! RFAL.
@@ -107,12 +131,28 @@ func handle(ghc githubClient, oc ownersClient, log *logrus.Entry, reviewerCount, | |||
return err | |||
} | |||
if missing := *reviewerCount - len(reviewers); missing > 0 { | |||
log.Warnf("Not enough reviewers found in OWNERS files for files touched by this PR. %d/%d reviewers found.", len(reviewers), reviewerCount) | |||
log.Warnf("Not enough reviewers found in OWNERS files for files touched by this PR. %d/%d reviewers found.", len(reviewers), *reviewerCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to warn after fallback to approvers (if enabled). WDYT?
} | ||
} | ||
|
||
if len(reviewers) > 0 { | ||
if maxReviewers > 0 && len(reviewers) > maxReviewers { | ||
log.Warnf("Limiting request of %d reviewers to %d maxReviewers.", len(reviewers), maxReviewers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, fixed.
/retest |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fejta, grantr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Should this be announced on any mailing lists, since it changes default behavior? |
We need to build and deploy a new prow before this takes effect. Could you add a blurb to https://github.com/kubernetes/test-infra/blob/master/prow/ANNOUNCEMENTS.md? |
If the newly added blunderbuss option
ApproverFallback
is trueExcludeApprovers
is false, the reviewer selection method will attempt to add approvers to the list if there aren't enough qualifying reviewers to satisfy the requested reviewer count.While the implementation works and is tested with mixed approver and reviewer lists, this feature is most useful for projects that don't have a reviewer role and thus have OWNERS files containing only approver lists. Those projects
should now enable thecan rely on the default to have Blunderbuss select reviewers from approver lists.ApproverFallback
option/kind feature
/area prow
/assign @cjwagner
/cc @rsdcastro @fejta
Fixes #7691