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

Handle deleted base branch in PR #10618

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Mar 5, 2020

If you delete the base branch of a PR, although the PR will be closed if you view the PR you will be presented with a 500. This PR will handle this case.

See for an example PR https://try.gitea.io/arandomer/anudderrepo/pulls/1

Signed-off-by: Andrew Thornton [email protected]

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added this to the 1.12.0 milestone Mar 5, 2020
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.

This seems to work OK on all the pages I could test. I didn't test deleting the ref from refs/pulls/# and gc/prunning because I don't think that case it supposed to be covered by this PR. 👍

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 5, 2020
@zeripath
Copy link
Contributor Author

zeripath commented Mar 5, 2020

@guillep2k deleting the internal ref is most definitely not covered by this PR and probably should be an internal server error - it should not be deleted unless you actually delete the PR.

@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 Mar 5, 2020
@codecov-io
Copy link

Codecov Report

Merging #10618 into master will increase coverage by <.01%.
The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10618      +/-   ##
==========================================
+ Coverage   43.69%   43.69%   +<.01%     
==========================================
  Files         587      587              
  Lines       82174    82183       +9     
==========================================
+ Hits        35905    35910       +5     
- Misses      41819    41824       +5     
+ Partials     4450     4449       -1
Impacted Files Coverage Δ
routers/repo/pull.go 28.89% <11.11%> (-0.17%) ⬇️
services/pull/check.go 50% <0%> (-5.49%) ⬇️
modules/git/command.go 86.95% <0%> (-2.61%) ⬇️
services/pull/patch.go 61.93% <0%> (-2.59%) ⬇️
services/pull/temp_repo.go 29.05% <0%> (-2.57%) ⬇️
modules/indexer/issues/indexer.go 56.19% <0%> (-1.33%) ⬇️
models/gpg_key.go 53.95% <0%> (+0.52%) ⬆️
modules/queue/workerpool.go 59.07% <0%> (+1.06%) ⬆️
modules/queue/unique_queue_disk_channel.go 55.76% <0%> (+1.92%) ⬆️
modules/git/repo.go 49.08% <0%> (+2.29%) ⬆️
... and 3 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 ae452d0...7195f3c. Read the comment docs.

@zeripath zeripath merged commit 3502730 into go-gitea:master Mar 5, 2020
@zeripath zeripath deleted the fix-handle-base-branch-deletion branch March 5, 2020 18:51
zeripath added a commit to zeripath/gitea that referenced this pull request Mar 5, 2020
lafriks added a commit that referenced this pull request Mar 5, 2020
@zeripath zeripath added the backport/done All backports for this PR have been created label Mar 6, 2020
@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
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.

6 participants