Skip to content

Manual-merge check will close and mark merged PRs that are reset to master #9551

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

Closed
guillep2k opened this issue Dec 30, 2019 · 8 comments
Closed
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@guillep2k
Copy link
Member

Gitea Version: 1.11.0+dev-497-gc0f879546 c0f8795

If a PR's branch is reset to the content of the base repo's master, the PR will be closed and marked as merged by the manual-merge detection routine. This at least seems to be what's happened to https://gitea.com/gitea/go-sdk/pulls/203 (which incidentally was created from a master branch).

@6543
Copy link
Member

6543 commented Dec 30, 2019

@zeripath
Copy link
Contributor

I guess if we just change these two lines to be Closed instead:

notification.NotifyMergePullRequest(pr, merger, baseGitRepo)
log.Info("manuallyMerged[%d]: Marked as manually merged into %s/%s by commit id: %s", pr.ID, pr.BaseRepo.Name, pr.BaseBranch, commit.ID.String())

@zeripath
Copy link
Contributor

pr.Merger = merger
pr.MergerID = merger.ID
if err = pr.SetMerged(); err != nil {
log.Error("PullRequest[%d].setMerged : %v", pr.ID, err)

and these too.

@guillep2k
Copy link
Member Author

But is it correct to close the PR? It can't be merged anymore, but the PR itself could receive further commits that change that.

@lunny lunny added the type/bug label Dec 31, 2019
@lunny
Copy link
Member

lunny commented Dec 31, 2019

It should be marked as merged but not closed if it's correct. But that's not the issue.

In fact the detection if it has been merged is not right I think.

@zeripath
Copy link
Contributor

It's actually quite difficult - by the time ManualMerge is called we've lost the previous SHA.

In Pushtobaserepo we have both and can do the check but there's no state we can choose which says don't mark as merged

@lunny
Copy link
Member

lunny commented Jan 1, 2020

So maybe we should disable that currently to avoid making confuse.

@stale stale bot added the issue/stale label Mar 1, 2020
@zeripath zeripath added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Mar 1, 2020
@stale stale bot removed the issue/stale label Mar 1, 2020
@go-gitea go-gitea deleted a comment from stale bot Mar 3, 2020
@zeripath
Copy link
Contributor

zeripath commented Mar 6, 2021

Fixed by #12543

@zeripath zeripath closed this as completed Mar 6, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
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
Projects
None yet
Development

No branches or pull requests

4 participants