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 wrong identify poster on a migrated pull request when submit review #9827

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 17, 2020

Fix #8959

@lunny lunny added this to the 1.12.0 milestone Jan 17, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 17, 2020
@@ -440,7 +440,7 @@ func (issue *Issue) HashTag() string {

// IsPoster returns true if given user by ID is the poster.
func (issue *Issue) IsPoster(uid int64) bool {
return issue.PosterID == uid
return issue.OriginalAuthorID == 0 && issue.PosterID == uid
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm from what I have understand when migrating if the user exist OriginalAuthorID is not and set and issue.PosterID is not the doer (like it is by default) but found user ?

Copy link
Member Author

Choose a reason for hiding this comment

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

If OriginalAuthorID > 0, PosterID means migrator but not poster id. OriginalAuthorID is an external system id not gitea user id.

@codecov-io
Copy link

Codecov Report

Merging #9827 into master will increase coverage by 0.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9827      +/-   ##
==========================================
+ Coverage   42.31%   42.32%   +0.01%     
==========================================
  Files         604      604              
  Lines       79116    79116              
==========================================
+ Hits        33479    33488       +9     
+ Misses      41516    41505      -11     
- Partials     4121     4123       +2
Impacted Files Coverage Δ
routers/repo/pull_review.go 0% <0%> (ø) ⬆️
models/issue.go 54.81% <100%> (ø) ⬆️
models/repo.go 47.02% <0%> (-0.13%) ⬇️
services/pull/patch.go 67.92% <0%> (ø) ⬆️
modules/queue/workerpool.go 42.48% <0%> (+1.28%) ⬆️
services/pull/check.go 56.64% <0%> (+2.09%) ⬆️
models/unit.go 39.5% <0%> (+2.46%) ⬆️
services/pull/temp_repo.go 34.18% <0%> (+2.56%) ⬆️

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 3c07d03...d1e945f. 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 Jan 17, 2020
@sapk sapk merged commit 088759f into go-gitea:master Jan 17, 2020
@sapk
Copy link
Member

sapk commented Jan 17, 2020

@lunny please send backports

@lunny lunny deleted the lunny/fix_migrated_pr_review branch January 17, 2020 11:25
@lafriks lafriks added the backport/done All backports for this PR have been created label Jan 17, 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.

Add review on a migrated pull request will be considered as author
5 participants