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

Differentiate between releases and pre-releases #2239

Closed
mattnelson opened this issue Jul 15, 2019 · 5 comments · Fixed by #2905
Closed

Differentiate between releases and pre-releases #2239

mattnelson opened this issue Jul 15, 2019 · 5 comments · Fixed by #2905
Assignees
Labels
enhancement help wanted small Issues that new contributors can pick up

Comments

@mattnelson
Copy link

Releases can be created from tags, which can then be further classified as pre-release or the default of the latest release.
Screen Shot 2019-07-15 at 6 47 35 PM

The latest release widget displays a release marked as pre-release as the latest release.
Screen Shot 2019-07-15 at 6 46 31 PM

The API supports the ability to differentiate between the two.
https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository

@sindresorhus
Copy link
Member

PR welcome :)

@fregante
Copy link
Member

fregante commented Jul 22, 2019

The Tags endpoint doesn’t include this info and the Releases endpoint doesn’t include all tags (so it would only work if a repo uses releases)

This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.

The Tag object doesn’t include references to the related release either: https://developer.github.com/v4/object/tag/

The only way to do this seems to be making 2 queries and then check filter out any tags that are in prereleases.

More generically, I think we can just exclude tags that include - which seems to be used for prereleases

@fregante fregante added the small Issues that new contributors can pick up label Mar 19, 2020
@kidonng
Copy link
Member

kidonng commented Mar 19, 2020

we can just exclude tags that include -

Quite a few repos have dates in their tag names (for example YYYY-MM-DD).

@fregante
Copy link
Member

fregante commented Mar 20, 2020

I think we already have a condition that excludes tags that aren’t “version-like”

We’ll never catch all the edge cases but, maybe:

  • exclude specifically x.y-b and x.y.z-b tags
  • in our existing v4 query, also check if we have information about a tag being a pre-release or “latest release” The first one is enough

@fregante fregante self-assigned this Mar 20, 2020
@fregante
Copy link
Member

This is why we can't use GitHub's "latest release" feature:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted small Issues that new contributors can pick up
Development

Successfully merging a pull request may close this issue.

4 participants