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

Version oddities #137

Closed
v1gnesh opened this issue Jan 24, 2024 · 9 comments
Closed

Version oddities #137

v1gnesh opened this issue Jan 24, 2024 · 9 comments

Comments

@v1gnesh
Copy link
Contributor

v1gnesh commented Jan 24, 2024

Hey, more oddities I can't figure out.
Please help when you find time?

https://github.com/pocoproject/poco/releases

bump pipeline -v 'gitrefs:https://github.com/pocoproject/poco.git|re:/poco-([\d.]+p?\d?)-release/$1/'

Seems to be finding things other than 1.12.5p2.

@wader
Copy link
Owner

wader commented Jan 24, 2024

Hmm another case of some kind of custom version sorter would be nice #112? when i use ...|semver:* i get1.13.0 now. The problem with semver is that suffixes like p2 will be seen a pre-releases i think https://semver.org/spec/v2.0.0-rc.2.html#spec-item-11

Will think a bit more about this

@wader
Copy link
Owner

wader commented Jan 24, 2024

BTW i noticed the regex seem to produce duplicates, probably because of tags/ and head/ and also -release and -release^{}. Something like this gitrefs:https://github.com/pocoproject/poco.git|re:#tags/poco-([\d.]+p?\d?)-release$#$1#

@wader
Copy link
Owner

wader commented Jan 24, 2024

In this case i think #112 would do the correct thing?

➜  bump git:(version-sort) ✗ go run ./cmd/bump pipeline -v 'static:1.11.6,1.12.5p2,1.12.5|sort:version'
Parsed pipeline: static:1.11.6,1.12.5p2,1.12.5|sort:version
static:1.11.6,1.12.5p2,1.12.5:
  1.11.6
  1.12.5p2
  1.12.5
  @ name -> name
sort:version:
  1.12.5p2
  1.12.5
  1.11.6
  @ name -> name
  value 1.12.5p2
1.12.5p2

Maybe we talked about it before, the sort:version PR works by splitting the string into an array of continuous digits or something else so -> 1.2.3asd5 -> [1,2,3,"asd",5] and then a sort is done by compare same index sorting numbers and strings descending and after that prefer arrays with more elements.

You can play around with it using GOPROXY=direct go run github.com/wader/bump/cmd/bump@version-sort pipeline -v 'static:1.11.6,1.12.5p2,1.12.5,1.12.5p123|sort:version' (GOPROXY=direct to not use some cached version).

If useful maybe some filter like that could be added? maybe a better name? separate filter and not argument to sort?

@v1gnesh
Copy link
Contributor Author

v1gnesh commented Jan 24, 2024

Good news, I worked around it by finding another source of info - their website.
The main website says '1.13.0' is the latest; so maybe they just haven't promoted from pre-release on GitHub.
Good old file server listings are still great.

# bump: poco-version /POCO_VERSION="(.*)"/ https://pocoproject.org/|re:/Latest.Release:.([\d.]+p?\d?)/$1/
POCO_VERSION="1.12.5p2"

export ZOPEN_DEV_URL="https://pocoproject.org/releases/poco-${POCO_VERSION}/poco-${POCO_VERSION}.tar.gz"

@v1gnesh
Copy link
Contributor Author

v1gnesh commented Jan 24, 2024

BTW i noticed the regex seem to produce duplicates, probably because of tags/ and head/ and also -release and -release^{}. Something like this gitrefs:https://github.com/pocoproject/poco.git|re:#tags/poco-([\d.]+p?\d?)-release$#$1#

I tried the version-sort branch and it works ok.
But since I've found a workaround also, no pressure in committing to something.
Please do things at your own pace as you like :)

go run github.com/wader/bump/cmd/bump@version-sort pipeline -v 'gitrefs:https://github.com/pocoproject/poco.git|re:#tags/poco-([\d.]+p?\d?)-release$#$1#|sort:version'
...
sort:version:
  1.13.0:commit=fe3d9dba5b9a146dcb86929bfa102b742358be52
  1.12.5p2:commit=e6c3d5821ff7e6f25d8dc20b116b81b073316147
  1.12.5p1:commit=47bb4db5c61f5a5ac9a5ead2b65c9afc2a2e1228
  1.12.5:commit=bbffa0fb3fb3668bce34cc7d9b40d21495cc754b

@wader
Copy link
Owner

wader commented Jan 24, 2024

Good news, I worked around it by finding another source of info - their website.
The main website says '1.13.0' is the latest; so maybe they just haven't promoted from pre-release on GitHub.
Good old file server listings are still great.

👍 yeap i've notice also sometimes that git tags show up a bit early sometimes 😄

I tried the version-sort branch and it works ok.

Thanks for testing, do let me know if you run into similar cases that are hard to sort etc so we have more context and tests for a possible future filter

@wader
Copy link
Owner

wader commented Jan 26, 2024

Close?

@v1gnesh
Copy link
Contributor Author

v1gnesh commented Jan 26, 2024

Yup, thanks as always for your help & for sharing your excellent, excellent work.

@v1gnesh v1gnesh closed this as completed Jan 26, 2024
@wader
Copy link
Owner

wader commented Jan 26, 2024

🥳

@wader wader reopened this Jan 26, 2024
@wader wader closed this as completed Jan 26, 2024
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

2 participants