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

Bug fix for repo releases sorted #3522

Merged
merged 2 commits into from
Feb 21, 2018
Merged

Bug fix for repo releases sorted #3522

merged 2 commits into from
Feb 21, 2018

Conversation

xwjdsh
Copy link
Contributor

@xwjdsh xwjdsh commented Feb 17, 2018

Fixes #3496

@@ -147,6 +150,7 @@ func CreateRelease(ctx *context.APIContext, form api.CreateReleaseOption) {
IsPrerelease: form.IsPrerelease,
IsTag: false,
Repo: ctx.Repo.Repository,
CreatedUnix: util.TimeStamp(time.Now().Unix()),
Copy link
Member

Choose a reason for hiding this comment

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

This should be done in xorm before save event

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just for this reason, so caused the issue that repo releases sorted when migrating, xorm save current time rather than tag created time. Test passed on local, but CI failed, could you take a look at this?

@tboerger tboerger added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 17, 2018
@tboerger tboerger 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 Feb 17, 2018
@@ -134,6 +135,8 @@ func createTag(gitRepo *git.Repository, rel *Release) error {
if err != nil {
return fmt.Errorf("CommitsCount: %v", err)
}
} else {
rel.CreatedUnix = util.TimeStamp(time.Now().Unix())
Copy link
Member

Choose a reason for hiding this comment

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

change to util.TimeStampNow()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated and the CI passed as well.

Signed-off-by: Wendell Sun <[email protected]>

Use TimeStampNow function
@codecov-io
Copy link

codecov-io commented Feb 19, 2018

Codecov Report

Merging #3522 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3522      +/-   ##
==========================================
+ Coverage   35.73%   35.74%   +<.01%     
==========================================
  Files         284      284              
  Lines       40775    40778       +3     
==========================================
+ Hits        14571    14576       +5     
+ Misses      24043    24041       -2     
  Partials     2161     2161
Impacted Files Coverage Δ
models/release.go 45.8% <100%> (+0.57%) ⬆️
models/repo_list.go 67.18% <0%> (+1.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 7b104f0...eefbcfb. Read the comment docs.

@tboerger tboerger 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 Feb 20, 2018
@ethantkoenig
Copy link
Member

Would it be worth adding a migration (in a separate PR) to fix the created_unix column for existing releases?

@lafriks lafriks added this to the 1.5.0 milestone Feb 20, 2018
@appleboy appleboy merged commit 2f5c1ba into go-gitea:master Feb 21, 2018
@lafriks
Copy link
Member

lafriks commented Feb 21, 2018

@xwjdsh Can you please backport this to release/v1.4 branch?

xwjdsh added a commit to xwjdsh/gitea that referenced this pull request Feb 21, 2018
Signed-off-by: Wendell Sun <[email protected]>

Use TimeStampNow function
appleboy pushed a commit that referenced this pull request Feb 22, 2018
Signed-off-by: Wendell Sun <[email protected]>

Use TimeStampNow function
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 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.

Mirrored repo releases sorted ascending order
6 participants