Add checkbox to delete pull branch after successful merge #16049

Merged
lunny merged 18 commits from delete-pull-branch-on-merge into main 2021-07-12 23:26:25 +00:00
Contributor

Fixes #13568

Fixes #13568
zeripath reviewed 2021-06-29 21:26:43 +00:00
Contributor

You already have the pull request, and git repo open which means that at least until 1204 is already done.

You already have the pull request, and git repo open which means that at least until 1204 is already done.
jpraet reviewed 2021-06-29 22:07:08 +00:00
Author
Contributor

I'll see if I can do some cleanup to avoid these unnecessary operations.
How can I access the already opened repo of the PR head?

I'll see if I can do some cleanup to avoid these unnecessary operations. How can I access the already opened repo of the PR head?
jpraet reviewed 2021-06-29 22:11:46 +00:00
Author
Contributor

After reflecting on https://github.com/go-gitea/gitea/pull/16049#discussion_r660996140, I think this is wrong.
This only works if the pr head branch is in the same repo.
We need to delete the branch on pr.HeadRepo instead of ctx.Repo.Repository.

After reflecting on https://github.com/go-gitea/gitea/pull/16049#discussion_r660996140, I think this is wrong. This only works if the pr head branch is in the same repo. We need to delete the branch on pr.HeadRepo instead of ctx.Repo.Repository.
jpraet reviewed 2021-06-30 19:47:21 +00:00
@ -306,1 +306,3 @@
log.Error("GetDiverging: %v", err)
if models.IsErrBranchDoesNotExist(err) && !git.IsBranchExist(pr.HeadRepo.RepoPath(), pr.HeadBranch) {
log.Warn("Cannot test PR %s/%d: head_branch %s no longer exists", pr.BaseRepo.Name, pr.IssueID, pr.HeadBranch)
} else {
Author
Contributor

I no longer observe this warning when testing this feature on my local instance, whereas previously I saw it most of the time.
Maybe it has been fixed by another PR. Should I revert these changes to the error handling?

I no longer observe this warning when testing this feature on my local instance, whereas previously I saw it most of the time. Maybe it has been fixed by another PR. Should I revert these changes to the error handling?
zeripath reviewed 2021-06-30 20:18:51 +00:00
@ -306,1 +306,3 @@
log.Error("GetDiverging: %v", err)
if models.IsErrBranchDoesNotExist(err) && !git.IsBranchExist(pr.HeadRepo.RepoPath(), pr.HeadBranch) {
log.Warn("Cannot test PR %s/%d: head_branch %s no longer exists", pr.BaseRepo.Name, pr.IssueID, pr.HeadBranch)
} else {
Contributor

leave it in.

leave it in.
zeripath approved these changes 2021-07-05 05:24:08 +00:00
6543 (Migrated from github.com) approved these changes 2021-07-12 23:01:16 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#16049
No description provided.