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

Wrong release listed as 'latest' in github #28530

Closed
ajchiarello opened this issue Apr 27, 2021 · 5 comments
Closed

Wrong release listed as 'latest' in github #28530

ajchiarello opened this issue Apr 27, 2021 · 5 comments
Labels
bug new new issue not yet triaged

Comments

@ajchiarello
Copy link

I have a system that automatically pulls the release marked as 'latest' on github, and was surprised when it pulled version 0.11.15 this morning instead of 0.15.1 - did you intend to mark 0.11.15 as 'latest'?

@ajchiarello ajchiarello added bug new new issue not yet triaged labels Apr 27, 2021
@jbardin
Copy link
Member

jbardin commented Apr 27, 2021

Hi @ajchiarello,

I don't think there is any way to define what "latest" means in the GitHub UI. It appears that GitHub uses that to mean "most recent", and 0.11.15 is the most recent tag in the repo.

@apparentlymart
Copy link
Member

Yes, GitHub's idea of "latest release" is the release with the newest Git tag, and so it's not really a useful signal for anything except GitHub deciding what to show in the UI.

If you noticed this because you built some automation around GitHub's idea of latest then I would suggest using a different strategy to decide "latest", because GitHub's idea of "latest" is not fit for that purpose and isn't something we can customize. One other possibility is to use the JSON index of releases on releases.hashicorp.com, which is something we directly control as part of our release process. The index isn't in any particular order but you can apply your own ordering using typical version precedence functions.

@ajchiarello
Copy link
Author

Ah - thanks, I had misunderstood how the latest tag was applied, and had gotten lucky in the past. I'll use a different method to pull the version.

@minamijoyo
Copy link
Contributor

TIL: The git command can sort tags in semver order.

$ git -c 'versionsort.suffix=-' ls-remote --refs --tags --sort='v:refname' https://github.com/hashicorp/terraform | tail -n 1 | cut -d'/' -f3 | sed s/^v//
0.15.1

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants