-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
table pull_request
wasn't updated correctly
#2649
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2649 +/- ##
=======================================
Coverage 27.13% 27.13%
=======================================
Files 86 86
Lines 17061 17061
=======================================
Hits 4629 4629
Misses 11754 11754
Partials 678 678
Continue to review full report at Codecov.
|
LGTM |
models/pull.go
Outdated
@@ -422,7 +422,7 @@ func (pr *PullRequest) setMerged() (err error) { | |||
if err = pr.Issue.changeStatus(sess, pr.Merger, pr.Issue.Repo, true); err != nil { | |||
return fmt.Errorf("Issue.changeStatus: %v", err) | |||
} | |||
if _, err = sess.Id(pr.ID).Cols("has_merged").Update(pr); err != nil { | |||
if _, err = sess.Id(pr.ID).Cols("has_merged, merged_commit_id, merger_id, merged_unix").Update(pr); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be sess.ID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are aliases but by GoLang naming ID is more correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id(..)
is deprecated, so I think we should prefer ID(..)
(https://godoc.org/github.com/go-xorm/xorm#Engine.Id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm ... but Id(..)
is used in many other places.
It seems to be reasonable to fix all of them at once as an other issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To not to accidently break something it's better to change them one by one when touching old code like in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll fix it
https://try.gitea.io/amama/haipro/pulls/1 Why if do I enter into commits or files it shows a 500 error? 😕 |
It is because This PR fixes this bug too. |
rebased |
LGTM |
Since this commit (dd55534), table
pull_request
wasn't updated correctly.Because of this, merge description says such wrong thing:
Ghost merged 1 commits from user/branch into user/branch 48 years ago
Example https://try.gitea.io/amama/haipro/pulls/1