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 migration panic when Head.User is not exist #7226

Merged
merged 3 commits into from
Jun 18, 2019

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 17, 2019

As title

@lunny lunny added the type/bug label Jun 17, 2019
@lunny lunny added this to the 1.9.0 milestone Jun 17, 2019
@codecov-io
Copy link

codecov-io commented Jun 17, 2019

Codecov Report

Merging #7226 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7226      +/-   ##
==========================================
+ Coverage   40.96%   40.98%   +0.01%     
==========================================
  Files         462      462              
  Lines       62567    62584      +17     
==========================================
+ Hits        25631    25647      +16     
+ Misses      33576    33575       -1     
- Partials     3360     3362       +2
Impacted Files Coverage Δ
modules/migrations/github.go 84.01% <100%> (+0.77%) ⬆️
modules/log/event.go 64.61% <0%> (-1.03%) ⬇️
models/gpg_key.go 55.83% <0%> (-0.84%) ⬇️
models/repo_list.go 73.09% <0%> (+1.01%) ⬆️
models/unit.go 67.56% <0%> (+5.4%) ⬆️

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 954d24c...ef32f0f. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 17, 2019
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

Assuming that base.PullRequestBranch can tolerate these being potentially empty - I'll approve

@@ -443,10 +462,10 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq
MergedTime: pr.MergedAt,
IsLocked: pr.ActiveLockReason != nil,
Head: base.PullRequestBranch{
Ref: *pr.Head.Ref,
SHA: *pr.Head.SHA,
Ref: headRef,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will base be able to cope with these being effectively empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

Base Repo's Ref, SHA information should be stored in databased even if the branch deleted. So they will not be empty, but it will fail on coming process.

@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 17, 2019
@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 18, 2019
@techknowlogick techknowlogick merged commit 392fe6c into go-gitea:master Jun 18, 2019
@lunny lunny deleted the lunny/fix_migration_panic branch June 19, 2019 02:04
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
* fix migration panic when Head.User is not exist

* fix test
@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.

6 participants