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

Older version with dash shows as newer #223

Open
brewin opened this issue Aug 20, 2020 · 7 comments
Open

Older version with dash shows as newer #223

brewin opened this issue Aug 20, 2020 · 7 comments
Assignees

Comments

@brewin
Copy link

brewin commented Aug 20, 2020

refreshVersions incorrectly shows 'x.y-whatever' as newer than 'x.y.z'

version.com.russhwolf..multiplatform-settings-no-arg=0.6.1
##                                       # available=0.6-1.4-M1
##                                       # available=0.6-1.4-M2
##                                       # available=0.6-1.4-M3
##                                       # available=0.6-1.4.0-rc
@LouisCAD
Copy link
Member

LouisCAD commented Aug 21, 2020

Thanks for the report!
Indeed, for simplicity (on my end), dots and dashes are treated the same for now.

That gives more examples to tune a better version sorter.

Adding another (tricky) real-world example:

As of version 0.9.5 (release coming this week), we can have the following:

version.kotlinx.coroutines=1.3.8
##             # available=1.3.8-1.4-rc-154
##             # available=1.3.8-1.4.0-rc
##             # available=1.3.8-1.4.0-rc-218
##             # available=1.3.9-native-mt
##             # available=1.3.9

but the correct order would be:

version.kotlinx.coroutines=1.3.8
##             # available=1.3.8-1.4-rc-154
##             # available=1.3.8-1.4.0-rc-218
##             # available=1.3.8-1.4.0-rc
##             # available=1.3.9
##             # available=1.3.9-native-mt

@LouisCAD LouisCAD self-assigned this Aug 21, 2020
@jmfayard
Copy link
Member

@brewin developers are crazy creative with their naming scheme

The simplest solution is to use a rejectVersionIf
https://jmfayard.github.io/refreshVersions/update-dependencies/#filter-which-versions-are-added-to-versionsproperties

@LouisCAD LouisCAD reopened this Sep 14, 2022
@LouisCAD
Copy link
Member

We can still tweak the version ordering system some day, because the scheme described here is quite common.

I might do it sometime next year as a mental exercise.

@rlatapy-luna
Copy link
Contributor

Is there any update on this? I currently reject snapshots with same version as release using candidate.value.startsWith(current.value) && candidate.stabilityLevel == StabilityLevel.Snapshot, but a custom sorting would be better.

@LouisCAD
Copy link
Member

No changes to expect on that in the foreseeable future, it's low priority, I already tuned the sorting algorithm to make it better, and you have a workaround.

@LouisCAD
Copy link
Member

Also, snapshots for the same release should not be shown.

@rlatapy-luna
Copy link
Contributor

Also, snapshots for the same release should not be shown.

Yes but in our case we bump the version immediately after releasing a new version. So our snapshots during feature dev are like 1.5.0-my_feature_under_dev-SNAPSHOT and won't be superseded by 1.5.0 after release.
I agree that this may not be the main case, but an api to inject a kind of custom comparator could be nice.

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

4 participants