-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fall back to main
branch protection rules for PRs targeting branches without protection rules
#1900
Conversation
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.
Why skip PRs that do not target main? Isn't there another solution?
I have to look further into the issue but those PR can become stale too.
To determine the number of approvals needed for a PR to be considered "reviewed" (and skipped) we query the branch protection rules. Because no other branches than The alternative to skipping those PRs is to always fall back to 2 required reviews for branches other than main. If that's the preferred approach for reviewers then I am happy to change the PR to that. I don't personally see the need for PR review reminders on PRs that do not target main. In my experience those PRs generally are blocked by their downstream target PR which will inevitably target main and get review reminders. |
Yeah, I think the default would be better. We haven't changed that requirement since it was implemented. Those PRs can be blocked for merging but the review should still happen at some point. |
Instead of falling back to a hardcoded value of 2, I would recommend falling back to whatever is the required number of reviews for |
Sounds good. |
@krysal This is ready for re-review now. |
e724845
to
ba86aba
Compare
main
branch protection rules for PRs targeting branches without protection rules
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 looks good and makes sense to me!
Fixes
Fixes #1863 by @sarayourfriend
Description
Fall back to
main
branch protection for PRs that target branches without their own protection rules.Testing Instructions
Check out the unit test and confirm that it sufficiently covers the new case.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin