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

Show download count info in release list #10124

Merged

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Feb 3, 2020

Fixes #9265

image

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Feb 3, 2020
@lafriks lafriks added this to the 1.12.0 milestone Feb 3, 2020
@codecov-io
Copy link

codecov-io commented Feb 3, 2020

Codecov Report

Merging #10124 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10124      +/-   ##
==========================================
+ Coverage   43.38%    43.4%   +0.01%     
==========================================
  Files         576      576              
  Lines       79623    79623              
==========================================
+ Hits        34548    34560      +12     
+ Misses      40794    40785       -9     
+ Partials     4281     4278       -3
Impacted Files Coverage Δ
routers/org/setting.go 0% <ø> (ø) ⬆️
routers/api/v1/admin/user.go 30.19% <0%> (ø) ⬆️
models/gpg_key.go 55.37% <0%> (+0.55%) ⬆️
modules/queue/unique_queue_disk_channel.go 54.48% <0%> (+1.92%) ⬆️
modules/queue/workerpool.go 46.61% <0%> (+2.13%) ⬆️

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 265497d...56dfd32. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 3, 2020
@lafriks lafriks force-pushed the feat/attachment_download_count branch from abba5b7 to fbc1fa2 Compare February 3, 2020 15:10
@jolheiser
Copy link
Member

How does this compare to https://github.com/dustin/go-humanize/blob/master/comma.go#L11-L44?

It doesn't need to handle negative numbers in the context of this PR (https://play.golang.org/p/5wF98ePRPc-) but perhaps it would be nice to have so we can re-use this function in other areas?

@lafriks lafriks force-pushed the feat/attachment_download_count branch from fbc1fa2 to 9003512 Compare February 3, 2020 15:23
@lafriks
Copy link
Member Author

lafriks commented Feb 3, 2020

I did not want to add new library just for this but it could probably be useful also in other places

@jolheiser
Copy link
Member

Yes, agreed we don't need that whole library. Maybe just extending it to negatives, if possible?

iirc there is an issue for humanizing diff counts, which is the only thing I can think of with negatives but I'm sure there are more.

@lafriks
Copy link
Member Author

lafriks commented Feb 3, 2020

Actually it is second function already so I just added go-humanize (FileSize was actually copied over already)

Copy link
Member

@jolheiser jolheiser left a comment

Choose a reason for hiding this comment

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

A nit and question, otherwise LGTM

modules/base/tool.go Show resolved Hide resolved
modules/templates/helper.go Show resolved Hide resolved
@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 Feb 3, 2020
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

nice - you only have to edit the tests

@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 Feb 3, 2020
@lafriks lafriks force-pushed the feat/attachment_download_count branch from 8beb882 to 265497d Compare February 3, 2020 18:36
@lafriks lafriks merged commit 20c513b into go-gitea:master Feb 3, 2020
@lafriks lafriks deleted the feat/attachment_download_count branch February 3, 2020 19:51
@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/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show the count of file downloads in Release page.
5 participants