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

Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch #9927

Merged
merged 9 commits into from
Jan 25, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 22, 2020

Fix #9914

  • only load head information when head repository/branch valid.
  • close all branch related unmerged pull requests when the branch deleted
  • close all repository related unmerged pull requests when repo deleted
  • broken pull requests tests

@lunny lunny added the type/bug label Jan 22, 2020
@lunny lunny added this to the 1.12.0 milestone Jan 22, 2020
@lunny lunny added the pr/wip This PR is not ready for review label Jan 22, 2020
@codecov-io
Copy link

codecov-io commented Jan 22, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@29e5a90). Click here to learn what that means.
The diff coverage is 51.69%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9927   +/-   ##
=========================================
  Coverage          ?   42.26%           
=========================================
  Files             ?      610           
  Lines             ?    80364           
  Branches          ?        0           
=========================================
  Hits              ?    33969           
  Misses            ?    42217           
  Partials          ?     4178
Impacted Files Coverage Δ
models/models.go 61.71% <ø> (ø)
models/repo_list.go 76.81% <ø> (ø)
models/issue.go 55.28% <ø> (ø)
routers/api/v1/org/hook.go 0% <0%> (ø)
cmd/admin.go 0% <0%> (ø)
routers/org/teams.go 0% <0%> (ø)
models/pull_sign.go 34.86% <0%> (ø)
routers/api/v1/repo/issue_subscription.go 0% <0%> (ø)
routers/api/v1/repo/release.go 46.2% <0%> (ø)
routers/api/v1/repo/key.go 20.37% <0%> (ø)
... and 88 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 29e5a90...7982aca. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 22, 2020
@lunny lunny removed the pr/wip This PR is not ready for review label Jan 22, 2020
@lunny
Copy link
Member Author

lunny commented Jan 22, 2020

It's ready to review now.

@lunny lunny changed the title fix pull view when head repository or head branch missed and close related pull requests when delete branch Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch Jan 22, 2020
models/pull.go Outdated Show resolved Hide resolved
modules/repofiles/update.go Show resolved Hide resolved
modules/repofiles/update.go Outdated Show resolved Hide resolved
models/pull.go Outdated Show resolved Hide resolved
modules/repofiles/update.go Show resolved Hide resolved
modules/repofiles/update.go Show resolved Hide resolved
@lunny
Copy link
Member Author

lunny commented Jan 22, 2020

@guillep2k @zeripath done.

services/pull/pull.go Outdated Show resolved Hide resolved
services/pull/pull.go Show resolved Hide resolved
services/pull/pull.go Show resolved Hide resolved
@lunny
Copy link
Member Author

lunny commented Jan 23, 2020

@guillep2k done.

Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

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

LGTM

@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 Jan 23, 2020
@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 Jan 23, 2020
@lunny lunny merged commit f2d12f7 into go-gitea:master Jan 25, 2020
@lunny lunny deleted the lunny/fix_pr_broken branch January 25, 2020 02:48
lunny added a commit to lunny/gitea that referenced this pull request Jan 25, 2020
…lated pull requests when delete head repository or head branch (go-gitea#9927)

* fix pull view when head repository or head branch missed and close related pull requests when delete branch

* fix pull view broken when head repository deleted

* close pull requests when head repositories deleted

* Add tests for broken pull request head repository or branch

* fix typo

* ignore special error when close pull request

Co-authored-by: Lauris BH <lauris@nix.lv>
@lunny
Copy link
Member Author

lunny commented Jan 25, 2020

also fix #2466

lunny added a commit that referenced this pull request Jan 25, 2020
…lated pull requests when delete head repository or head branch (#9927) (#9974)

* fix pull view when head repository or head branch missed and close related pull requests when delete branch

* fix pull view broken when head repository deleted

* close pull requests when head repositories deleted

* Add tests for broken pull request head repository or branch

* fix typo

* ignore special error when close pull request

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

View pull request 500
6 participants