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

Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs #16067

Merged
merged 5 commits into from
Jun 7, 2021

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 4, 2021

As title.

@lunny lunny changed the title Fix bug when delete branch don't close related PRs Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs Jun 4, 2021
return err
}

if err := pull_service.CloseBranchPulls(doer, repo.ID, branchName); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloseBranchPulls is already called in PushUpdate here:

if err = pull_service.CloseBranchPulls(pusher, repo.ID, branch); err != nil {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it's safe to run it twice and there is slight performance reduce. The invoke in push.go will be invoked from both git command and DeleteBranch and others.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 4, 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 Jun 5, 2021
@lunny lunny force-pushed the lunny/fix_cleanuppullrequest branch from 514aeac to cfc0fda Compare June 5, 2021 15:20
@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2021

Codecov Report

Merging #16067 (4b948c7) into main (3607f79) will decrease coverage by 0.02%.
The diff coverage is 43.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16067      +/-   ##
==========================================
- Coverage   44.19%   44.17%   -0.03%     
==========================================
  Files         683      684       +1     
  Lines       82375    82335      -40     
==========================================
- Hits        36409    36373      -36     
- Misses      40071    40074       +3     
+ Partials     5895     5888       -7     
Impacted Files Coverage Δ
routers/repo/pull.go 30.37% <0.00%> (-0.79%) ⬇️
routers/repo/branch.go 56.97% <35.71%> (+1.45%) ⬆️
routers/api/v1/repo/branch.go 38.14% <44.44%> (-0.34%) ⬇️
services/repository/branch.go 61.29% <61.29%> (ø)
modules/queue/queue_channel.go 91.66% <0.00%> (-5.00%) ⬇️
modules/charset/charset.go 71.71% <0.00%> (-4.05%) ⬇️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
services/pull/check.go 26.02% <0.00%> (-2.74%) ⬇️
modules/process/manager.go 72.83% <0.00%> (-2.47%) ⬇️
services/pull/patch.go 54.23% <0.00%> (-1.70%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3607f79...4b948c7. Read the comment docs.

@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 Jun 7, 2021
@lunny lunny merged commit 0909695 into go-gitea:main Jun 7, 2021
@lunny lunny deleted the lunny/fix_cleanuppullrequest branch June 7, 2021 14:53
lunny added a commit to lunny/gitea that referenced this pull request Jun 7, 2021
…ranch don't close related PRs (go-gitea#16067)

* Fix bug when delete branch don't close related PRs

* Merge all deletebranch as one method

* Add missed branch.go

* fix comment

Co-authored-by: Lauris BH <lauris@nix.lv>
6543 pushed a commit that referenced this pull request Jun 7, 2021
…ranch don't close related PRs (#16067) (#16097)

* Fix bug when delete branch don't close related PRs

* Merge all deletebranch as one method

Co-authored-by: Lauris BH <lauris@nix.lv>
@6543 6543 added the backport/done All backports for this PR have been created label Jun 7, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
…ranch don't close related PRs (go-gitea#16067)

* Fix bug when delete branch don't close related PRs

* Merge all deletebranch as one method

* Add missed branch.go

* fix comment

Co-authored-by: Lauris BH <lauris@nix.lv>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
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. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants