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 GitHub tag is shown #490

Closed
Gama11 opened this issue Jul 8, 2015 · 6 comments
Closed

Wrong GitHub tag is shown #490

Gama11 opened this issue Jul 8, 2015 · 6 comments

Comments

@Gama11
Copy link

Gama11 commented Jul 8, 2015

This repo uses this badge:

Haxelib Version

It shows the latest version as 3.3.9, even though the latest tag / most recent version is 3.3.11.

I suspect this might be caused by the double digit patch number.

@espadrine
Copy link
Member

Thanks for raising this!

One of the tags is 1.09, which is not semver compliant. Since we can't use semver ordering, we fall back on to the next best thing, ASCII ordering. It is bad, but dealing with arbitrary complex versionning schemes (as are found in the wild) is hard. If you can think of a better algorithm, it would be welcome!

@Gama11
Copy link
Author

Gama11 commented Jul 8, 2015

Ah, I see... that's from before we followed semver.

In this case (and most cases I'd imagine?) simply using the most recent tag would work just fine. That's how I thought it works until now, actually.

Different urls to deal with different versioning schemes would be another option.. tag/latest, tag/semver etc.. that might overcomplicate it though?

@espadrine
Copy link
Member

simply using the most recent tag would work just fine

Hehe, it worked that way until someone told us that they had the wrong version on their badge… They had made a 3.2.14, then a 3.3.0, then a 3.3.1, then performed a bugfix patch tagged 3.2.15.

The use of a different URL is an interesting idea. It is an issue for all badges dealing with versions, though.

@drdanz
Copy link

drdanz commented Mar 9, 2016

We have the same issue here: ![Latest Release](https://img.shields.io/github/tag/robotology/yarp.svg?label=Latest Release)
We have a tag start that is probably causing the issue.
Would it be possible to add a list of tags to skip to the URL? i.e. something like

https://img.shields.io/github/tag/robotology/yarp.svg?label=Latest Release&skip=start;foo;bar

@espadrine
Copy link
Member

@drdanz We filter out things that don't look like a version. In your case, you have a non-semver v2.3.20.1, which throws off the semver detection, which makes it fall back to ASCII comparisons.

@espadrine
Copy link
Member

I intend to switch to a simplified three-tier version analysis: semver / a custom dotted-version comparator / ASCII. The ASCII tier will no longer have non-versions filtered out, while the new custom dotted-version will use integer list comparison (and trailing data ASCII comparison for the -alpha and the like). Initial testing shows that Flixel and Yarp will be fixed by that new design. Versions that follow a different convention than dots (eg, v1-3-10) won't be fixed, and will be handled by the third tier.

(It is irrelevant for #261, which now uses the PHP algorithm. The same goes for #377, which uses GitHub's /latest version.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants