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

Add bulk pull request approval support #295

Open
Sam13 opened this issue Oct 21, 2022 · 6 comments
Open

Add bulk pull request approval support #295

Sam13 opened this issue Oct 21, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@Sam13
Copy link

Sam13 commented Oct 21, 2022

Additional / optional pull request approval support would be nice for the merge command.

When you have e.g. GitHub branch protections which do not allow administrator bypassing you cannot bulk merge the changes you created with the run command..

@lindell
Copy link
Owner

lindell commented Oct 21, 2022

Could you provide more info on the problem?

My understanding is that you have approval requirements on repositories, but not administrator bypassing. What addition to the merge command would resolve this?

@Sam13
Copy link
Author

Sam13 commented Oct 21, 2022

Yes. You cannot merge any PR then when not approved.

GitHub API will provide the following error message if you try to do so:

At least 1 approving review is required by reviewers with write access.

To enable merge, a review with approval review action (event=APPROVE) is required.
The GitHub API is documented here:
https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request
https://docs.github.com/en/graphql/reference/input-objects#addpullrequestreviewinput

I think your GO GitHub library supports that:
https://github.com/google/go-github/blob/master/github/pulls_reviews.go

I suggest to make this approval an optional option maybe with some additional review comments which can be provided?

@lindell
Copy link
Owner

lindell commented Oct 22, 2022

I don't think you can approve your own PR?

Even if you could, this would only work when exactly one required reviewer is set, anything more than that would not work.

@Sam13
Copy link
Author

Sam13 commented Oct 23, 2022

I don't think you can approve your own PR?

No you can't. Sorry for being unprecise in my initial description.

This feature would be useful e.g. to bulk approve and merge Dependabot PRs or PRs that somebody else created (with multi-gitter).
If you have the policy that administrators cannot bypass branch protection and use multi-gitter, you'll end up with hundreds of pull request which need to be manually approved and merged.

Even if you could, this would only work when exactly one required reviewer is set, anything more than that would not work.

Valid point, then maybe approval should be a separate command?

@lindell
Copy link
Owner

lindell commented Oct 23, 2022

This feature would be useful e.g. to bulk approve and merge Dependabot PRs or PRs that somebody else created (with multi-gitter).

Even though the merge/close/status commands can be used on PRs not created by multi-gitter, it's not really the use case. If users use those commands for it, that's fine, but changes will not be made because of it.

then maybe approval should be a separate command?

I think this is the solution if one were to be implemented 🙂
But currently, I think this is a special case since the setting, that not even administrators should be able to override a merge indicate that it should indeed not be overridden in any way. And creating a new sub command for this special case is today not relevant. But I'm open to having my mind changed if a lot of people have this use case. I will therefore leave this open and allow others to comment if they have this use case.

@lindell lindell added the enhancement New feature or request label Oct 23, 2022
@Sam13 Sam13 changed the title Add pull request approval support for merge command Add bulk pull request approval support Oct 24, 2022
@raffis raffis mentioned this issue Mar 24, 2023
2 tasks
@MHAbido
Copy link

MHAbido commented Aug 30, 2023

Hey @lindell is there a plan to add this feature soon ? it's a big time-saver :D

I can see there's already a PR for that #332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants