-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Admin Merge broken on 1.18.4 #23000
Labels
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
type/bug
Milestone
Comments
wolfogre
added
the
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
label
Feb 20, 2023
Noticed that as well. |
This same issue occurs when trying to schedule an "auto-merge after checks succeed", even as a non-admin. edit: logged this as #23022 since it seems slightly different and might not have the same fix. |
jolheiser
pushed a commit
that referenced
this issue
Feb 21, 2023
jolheiser
pushed a commit
that referenced
this issue
Feb 21, 2023
…23032) Backport #23010. Fix #23000. The bug was introduced in #22633, and it seems that it has been noticed: #22633 (comment) . However, #22633 did nothing wrong, the logic should be "check if they is admin only when `force` is true". So we should provide the `ForceMerge` when merging from UI. After this, an admin can also send a normal merge request with `ForceMerge` false. So it fixes a potential bug: if the admin doesn't want to do a force merge, they just see the green "Merge" button and click it. At the same time, the status of the PR changed, and it shouldn't be merged now, so the admin could send an unexpected force merge. In addition, I updated `ForceMerge *bool` to `ForceMerge bool`, I don't see the reason to use a pointer. And fixed the logic of CheckPullMergable to handle auto merge and force merge correctly.
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
type/bug
Description
I have a branch with a Branch Protection (at least 1 approval and a check that has to run)
The UI tells me I still can merge it anyway since i'm Admin. But when I try to merge it
The error message
Could also reproduce on try.gitea.io with
[Powered by Gitea](https://gitea.io/) Version: 1.19.0+dev-521-g2b3f12f6f Page: 99ms Template: 11ms
Steps To Reproduce
Gitea Version
1.18.4
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
No response
How are you running Gitea?
Irrelevant
Database
None
The text was updated successfully, but these errors were encountered: