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

Disallow merge when required checked are missing (#29143) #29268

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

MarkusAmshove
Copy link
Contributor

backport #29143

fixes go-gitea#21892

This PR disallows merging a PR when not all commit status contexts
configured in the branch protection are met.

Previously, the PR was happy to merge when one commit status was
successful and the other contexts weren't reported.

Any feedback is welcome, first time Go :-)
I'm also not sure if the changes in the template break something else

Given the following branch protection:

![branch_protection](https://github.com/go-gitea/gitea/assets/2401875/f871b4e4-138b-435a-b496-f9ad432e3dec)

This was shown before the change:

![before](https://github.com/go-gitea/gitea/assets/2401875/60424ff0-ee09-4fa0-856e-64e6e3fb0612)

With the change, it is now shown as this:

![after](https://github.com/go-gitea/gitea/assets/2401875/4e464142-efb1-4889-8166-eb3be26c8f3d)

---------

Co-authored-by: wxiaoguang <[email protected]>
@GiteaBot GiteaBot added this to the 1.21.6 milestone Feb 19, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 19, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 19, 2024
@wxiaoguang wxiaoguang changed the title Disallow merge when required checked are missing Disallow merge when required checked are missing (#29143) Feb 19, 2024
@wxiaoguang
Copy link
Contributor

Has it been tested on 1.21 branch? If it is not tested .... manual backport sometimes breaks. If yes, please help to share some screenshots, or add some test code. Thank you very much!

@MarkusAmshove
Copy link
Contributor Author

Yes, sorry, forgot to add the screenshot.

It contains the version in the footer

grafik

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 19, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 19, 2024
@lafriks lafriks enabled auto-merge (squash) February 19, 2024 20:29
@lafriks lafriks enabled auto-merge (squash) February 19, 2024 20:29
@lafriks lafriks merged commit 78f41e4 into go-gitea:release/v1.21 Feb 19, 2024
27 checks passed
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants