Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Ability to require reviews from all assigned reviewers. #1205

Open
Chekote opened this issue Mar 21, 2018 · 11 comments
Open

Ability to require reviews from all assigned reviewers. #1205

Chekote opened this issue Mar 21, 2018 · 11 comments

Comments

@Chekote
Copy link

Chekote commented Mar 21, 2018

Regarding:

https://help.github.com/articles/enabling-required-reviews-for-pull-requests/

Optionally, select Require review from Code Owners to require review from a code owner when the pull request affects code that has a designated owner.

Feature Request:

I would like to have a flag on the repo that when enabled requires all assigned reviewers to approve the PR before it can be merged.

We are currently using the specific number of reviews required, but this is too rigid for our workflow. For us, the number of reviewers required depends on what was touched by the PR.

We have automation that assigns the necessary reviewers to our PRs. Having a simple check that required all assigned reviewers to approve the PR is the last piece of our workflow puzzle.

Thanks for your consideration!

@Chekote
Copy link
Author

Chekote commented Mar 26, 2018

Response from Github:

Laura Coursen (GitHub Staff) | 11:58 AM

Hi there,

Thanks for reaching out! That's not currently possible, but I would be happy to pass it along to the team as a feature request. I can't promise if or when it will be implemented, but your suggestion is definitely in the right hands!

Regards,
Laura
@lecoursen

@davecranwell-adestra
Copy link

Our development team is divided into 4 discipline teams e.g frontend and backend.

Code changes often require review by multiple teams, so our CODEOWNERS file defines multiple teams per section. Anywhere between 1-4 teams allocated on any given directory.

Only an approval from someone in each of the assigned codeowner teams would be deemed as "properly" reviewed for our processes.

However the way Github currently works, an approving review from one person in any of those teams is considered enough to allow the PR to be merged. But we can't use the "Require approving reviews" feature, since the correct number varies per directory of code.

@thechenky
Copy link

I'd love this feature as well - we work in a large team and it would be great to have this functionality.

@kosanna
Copy link

kosanna commented Feb 20, 2019

Same here. Our team is distributed across multiple locations, for the sake of knowledge share we require at least 2 locations teams to approve everything. We have it set up in requested reviews, but there is no way to enforce it. For example 2 reviews from the same team will count as 2 approvals and PR will be green to go and not blocked from merging, this is not what we want to, unfortunately.

Any updates on the issue?

Cheers.

@JohnSBarden
Copy link

I have the same requirement. We have 2 teams that we request for review on each PR, but allow any number of people from each team to add reviews. Our current setup which requires 2 approvals does not allow for us to specify that we need 1 approval from each team. Is this request on the roadmap for implementation?

@dweber019
Copy link

@JohnSBarden maybe this helps: https://www.pullapprove.com/

@Chekote
Copy link
Author

Chekote commented Jun 14, 2019

Thanks, @dweber019, that looks interesting. It that might even allow us to stop maintaining our proprietary workflow automation and use that instead.

@Chekote
Copy link
Author

Chekote commented Jun 18, 2019

Github just acquired Pull Panda which might be another potential solution.

@PseudoNinja
Copy link

We have a real world need for this. Occasionally we get "guest" engineers creating pull requests in our application repo and then triggering the merge before all of the reviewers assigned have reviewed it. We currently use the min required option but these PRs require a little more scrutiny and may be reviewed by six or more.

@earonesty
Copy link

allowing flexibility to require X reviews from each of a a specific team seems to handle all the requests above.

  • we want to a) require at least 2 reviews from members and b) at least 1 review from the qa team
  • original author wants 1 review from EACH team
  • some deeper flexibility on review reqs would be great.

@Levi-Lesches
Copy link
Contributor

Levi-Lesches commented Jul 10, 2021

Note that you can do this by writing a GitHub action: simply make it throw an error when the assigned reviewers are still pending (or whatever condition).

GitHub Actions has a pull_request event, which you can use to run your own code whenever something happens to a pull request. You can use the assigned or review_requested types and their associated data to check when users have been requested to review, and use the pull_request_review event to see which users completed their reviews. You can also use unassigned and review_request_removed to check for cancellations. Once all users have completed their reviews, you can stop throwing the error.

There is already a similar action on the GitHub marketplace, Label Requires Reviews, which requires a certain number of reviews based on the label applied to the PR. That seems to address:

allowing flexibility to require X reviews from each of a a specific team seems to handle all the requests above.

In general, whenever an idea for GitHub seems simple or robotic, check if such a bot/action has already been written on the GitHub Marketplace

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants