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

download count for latest pre-release #1113

Closed
tooomm opened this issue Sep 29, 2017 · 5 comments
Closed

download count for latest pre-release #1113

tooomm opened this issue Sep 29, 2017 · 5 comments
Labels
good first issue New contributors, join in! service-badge New or updated service badge

Comments

@tooomm
Copy link
Contributor

tooomm commented Sep 29, 2017

We have a download count badge with several options for github releases, e.g. for a fixed tag or more importantly last release (since it updates automatically with your new releases):
dl from latest-pre

I request a download count for "latest pre-release" as well. Some repos use releases for stable versions and
pre-releases for betas for example. So both badges would show always up to date data without the need to update the badge to a hard coded tag all the time.

@tooomm tooomm changed the title download count for latest pre-release // "total" rephrase download count for latest pre-release Sep 29, 2017
@paulmelnikow paulmelnikow added good first issue New contributors, join in! enhancement service-badge New or updated service badge and removed enhancement labels Sep 29, 2017
@platan
Copy link
Member

platan commented Oct 7, 2017

As far as I can see GitHub REST API does not allow to get latest prerelease or even filter all releases to get only prereleases. So we have to list all releases and find prerelease. Do we want to do in this way? We could add some limits, e.g. check only first page of results (30 by default, max 100).

@paulmelnikow
Copy link
Member

If 2.0.0-rc2 is followed by 2.0.0, it's not helpful to see stats for 2.0.0-rc2 on a badge. So, the Shields semantics for "latest (pre-)release" is "latest release including prereleases." downloads-pre includes prereleases, and downloads excludes prereleases. It's the same idea as #1133.

@platan
Copy link
Member

platan commented Oct 7, 2017

Thanks! OK. I will do it in this way.

paulmelnikow pushed a commit that referenced this issue Oct 9, 2017
Implements #1113.

Removed extra space in 2 cases (failing tests without this change):

  1) Github downloads for latest release 
	[ GET http://localhost:1111/github/downloads/photonstorm/phaser/latest/total.json ]:
     ValidationError: child "value" fails because ["value" with value "63k " fails to match the required pattern: /^[0-9]+[kMGTPEZY]?$/]
--
  2) Github downloads-pre for latest release 
	[ GET http://localhost:1111/github/downloads-pre/photonstorm/phaser/latest/total.json ]:
     ValidationError: child "value" fails because ["value" with value "34 " fails to match the required pattern: /^[0-9]+[kMGTPEZY]?$/]
--
  3) Github downloads for specific asset from latest release 
	[ GET http://localhost:1111/github/downloads/atom/atom/latest/atom-amd64.deb.json ]:
     ValidationError: child "value" fails because ["value" with value "3k  [atom-amd64.deb]" fails to match the required pattern: /^[0-9]+[kMGTPEZY]? \[atom-amd64\.deb\]$/]
--
  4) Github downloads-pre for specific asset from latest release 
	[ GET http://localhost:1111/github/downloads-pre/atom/atom/latest/atom-amd64.deb.json ]:
     ValidationError: child "value" fails because ["value" with value "372  [atom-amd64.deb]" fails to match the required pattern: /^[0-9]+[kMGTPEZY]? \[atom-amd64\.deb\]$/]
@paulmelnikow
Copy link
Member

Done in #1140.

@tooomm
Copy link
Contributor Author

tooomm commented Oct 9, 2017

So I wait for the next deploy now. A lot of great PR's with interesting new possibilities recently! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

3 participants