8000 issue: fix timestamp updating by Kosadchiy · Pull Request #6210 · gogs/gogs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

issue: fix timestamp updating #6210

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

Merged
merged 6 commits into from
Aug 24, 2020
Merged

issue: fix timestamp updating #6210

merged 6 commits into from
Aug 24, 2020

Conversation

Kosadchiy
Copy link
Contributor
@Kosadchiy Kosadchiy commented Jun 20, 2020

Pull request with fix issue timestamp updating #6209.
As you are using xorm events like BeforeUpdate () together with Cols (cols ...) method, it changes only fields wich you pass to Cols () method and BeforeUpdate () doesn’t work.
I think you also should check pull, release and repo updating. It may contains the same problem.

@codecov
Copy link
codecov bot commented Jun 20, 2020

Codecov Report

Merging #6210 into master will decrease coverage by 0.26%.
The diff coverage is 0.00%.

@@            Coverage Diff            @@
##           master   #6210      +/-   ##
=========================================
- Coverage    8.91%   8.65%   -0.27%     
=========================================
  Files          99      99              
  Lines       17811   17767      -44     
=========================================
- Hits         1588    1537      -51     
- Misses      16064   16073       +9     
+ Partials      159     157       -2     

@Kosadchiy Kosadchiy closed this Jun 21, 2020
@Kosadchiy Kosadchiy reopened this Jun 21, 2020
@manfer
Copy link
Contributor
manfer commented Aug 15, 2020

I have not tested but I wonder if you can just solve this with:

func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
        cols = append(cols, "deadline_unix", "updated_unix")
	_, err := e.ID(issue.ID).Cols(cols...).Update(issue)
	return err
}

Copy link
Member
@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@unknwon unknwon added status: needs followup Need some extra work status: reviewed It has been reviewed by maintainers labels Aug 17, 2020
Kosadchiy and others added 2 commits August 22, 2020 02:49
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
@Kosadchiy Kosadchiy marked this pull request as draft August 21, 2020 23:54
@Kosadchiy
Copy link
Contributor Author
Kosadchiy commented Aug 23, 2020

I have not tested but I wonder if you can just solve this with:

func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
        cols = append(cols, "deadline_unix", "updated_unix")
	_, err := e.ID(issue.ID).Cols(cols...).Update(issue)
	return err
}

I chosed @manfer decision. Obviosly it is better way. I have tested, it works

@Kosadchiy Kosadchiy marked this pull request as ready for review August 23, 2020 20:33
@Kosadchiy Kosadchiy requested a review from unknwon August 23, 2020 20:33
Copy link
Member
@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thank you!

@unknwon unknwon changed the title fix issue timestamp updating issue: fix timestamp updating Aug 24, 2020
@unknwon unknwon merged commit a02b3e1 into gogs:master Aug 24, 2020
unknwon added a commit that referenced this pull request Aug 24, 2020
unknwon added a commit that referenced this pull request Aug 27, 2020
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
@unknwon
Copy link
Member
unknwon commented Aug 27, 2020

This patch has been cut with 0.12.1 release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: needs followup Need some extra work status: reviewed It has been reviewed by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0