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
Version ordering seems to be alpha sorted and needs to following some kind of versioning comparison scheme #1090
Comments
Things to consider off the top of my head: Variable number of versions: 1.2 > 1.1.2 Rubygems prereleases: 2.3.1 > 2.3.1.alpha4 SemVer prereleases: 2.3.1 > 2.3.1-alpha4 RPM epochs: 12:0.1.2 > 2:1.2.3 Openssl: 1.0.1g > 1.0.1a |
Just using semantic versioning is also already broken since openssl is already in the depot:
|
@lamont-granquist the results of the API are actually not gauranteed to be sorted but they are close enough that we could make some changes and add that gaurantee. As you point out, the identifiers are lexographically sorted which mostly gets us there but doesn't work for every versioning schema. I don't think the web client does any additional sorting so this is probably both a bug and a feature add |
Ah, I see there's also a "latest" route:
So really this bug applies to that endpoint more than the sort order of the JSON output (or both, possibly) |
@lamont-granquist yeah it applies to that endpoint as well! |
We can probably sort them with https://github.com/steveklabnik/semver |
@smith unfortunately the version piece of our package-ident doesn't enforce semver, its just the version of the software. I think we need a graceful way to:
|
I'm not suggesting we force semver, just use the comparison algorithm in that package to sort the versions. |
@smith I agree with you, the items below my first reply outline the feature to remedy this problem. It probably needs a bit more discussion as to how we'll best let people specify a comparison algorithm ;) |
We'll also need this client-side so that the hab binary can determine what the latest version of origin/pkg is installed as well (which it'll need to do) |
The depot now versions packages correctly so that, for example, 0.10.0 is greater than 0.9.3. |
can we get a link to the PR that implemented it? |
@lamont-granquist I believe it was #1221 |
My understanding is that version sorting is server-side and last-entry-wins on client-side.
2.13.0 should be sorted higher than 2.4.x, 2.3.x, 2.2.x, etc.
This, of course, generates a huge problem over what version sort order to use, which is a fairly open ended question with no clear solution.
At some point winners and losers likely need to get picked.
In an ideal world it would be nice to be able to tweak the version sorting scheme on a package-by-package basis since one-size-fits-all does inevitably generate losers here.
The text was updated successfully, but these errors were encountered: