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

API: don't allow merged PRs to be reopened #17192

Merged
merged 6 commits into from
Oct 3, 2021

Conversation

noerw
Copy link
Member

@noerw noerw commented Sep 30, 2021

fix #17180

I tried to add tests, but didn't find a way to merge a pull request without introducing a race condition in testing (pr.CanAutoMerge() blocks merging right away). If you have any hints, I'll add tests

@noerw noerw added the modifies/api This PR adds API routes or modifies them label Sep 30, 2021
routers/api/v1/repo/pull.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 30, 2021
@6543 6543 added this to the 1.16.0 milestone Sep 30, 2021
@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 Oct 1, 2021
@codecov-commenter

This comment has been minimized.

@techknowlogick techknowlogick merged commit 1f45b3a into go-gitea:main Oct 3, 2021
@lunny
Copy link
Member

lunny commented Oct 4, 2021

Please send back port to v1.15

@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 Oct 4, 2021
@noerw noerw added the backport/done All backports for this PR have been created label Oct 8, 2021
Chianina pushed a commit to Chianina/gitea that referenced this pull request Oct 15, 2021
* api: dont open merged PRs

* don't change base branch when already merged

* don't allow any state change

* also validate opening merged PRs in EditIssue

Co-authored-by: John Olheiser <[email protected]>
Co-authored-by: 6543 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is possible to reopen merged PRs via API
7 participants