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 merging except canceling the auto merge status #30659

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 23, 2024

Before:
Users can click merge button even if a pull request is on the automerge status

image

After:
Users have to cancel the automerge status before click merge button.

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 23, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 23, 2024
@wxiaoguang
Copy link
Contributor

Why it should force users to use one more step to cancel?

I don't see anything wrong by allowing the merge without cancel.

@lunny
Copy link
Member Author

lunny commented Apr 23, 2024

Why it should force users to use one more step to cancel?

I don't see anything wrong by allowing the merge without cancel.

This is following GH's design.

@wxiaoguang
Copy link
Contributor

Why it should force users to use one more step to cancel?
I don't see anything wrong by allowing the merge without cancel.

This is following GH's design.

Why GitHub is right?

@lunny
Copy link
Member Author

lunny commented Apr 23, 2024

In fact we need a state which indicates the checking is running, otherwise if the automerge checking is running and someone merge the pull request manually. Some inconsistent state of this pull request will be occupied.

@wxiaoguang
Copy link
Contributor

In fact we need a state which indicates the checking is running, otherwise if the automerge checking is running and someone merge the pull request manually. Some inconsistent state of this pull request will be occupied.

It is a new problem and it is not related to this PR. Even if you take this PR, then think about this case:

  1. User A opens the PR page, see the "merge" button
  2. User B opens the PR page and sets to "auto merge"
  3. Then User A clicks the "merge" button

The reason is the same.


So, if you would like to completely resolve the problem, I think it should also do something in backend code and add some tests.

@lunny
Copy link
Member Author

lunny commented Apr 23, 2024

In fact we need a state which indicates the checking is running, otherwise if the automerge checking is running and someone merge the pull request manually. Some inconsistent state of this pull request will be occupied.

It is a new problem and it is not related to this PR. Even if you take this PR, then think about this case:

1. User A opens the PR page, see the "merge" button

2. User B opens the PR page and sets to "auto merge"

3. Then User A clicks the "merge" button

The reason is the same.

So, if you would like to completely resolve the problem, I think it should also do something in backend code and add some tests.

Yes, I will continue to this PR.

@lunny lunny marked this pull request as draft April 23, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/js size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants