vendir icon indicating copy to clipboard operation
vendir copied to clipboard

sort-semver skip numeric identifiers over unsigned long

Open jvalkeal opened this issue 4 years ago • 1 comments

What steps did you take: If semver identifier in a metadata contains only numeric characters and if that "number" exceeds unsigned long (18,446,744,073,709,551,615), tools simply ignores that version.

$ vendir tools sort-semver -v "1.0.0+18446744073709551615" 
Versions

Version  
1.0.0+18446744073709551615  

Highest version: 1.0.0+18446744073709551615

Succeeded

$ vendir tools sort-semver -v "1.0.0+18446744073709551616" 
Versions

Version  

Succeeded

$ vendir tools sort-semver -v "1.0.0+18446744073709551615x" 
Versions

Version  
1.0.0+18446744073709551615x  

Highest version: 1.0.0+18446744073709551615x

Succeeded

$ vendir tools sort-semver -v "1.0.0+18446744073709551616x" 
Versions

Version  
1.0.0+18446744073709551616x  

Highest version: 1.0.0+18446744073709551616x

Succeeded

What happened: Version is ignored

What did you expect: Expecting metadata identifier to work with any alphanumeric characters

Environment:

  • vendir version 0.23.0
  • OS Ubuntu 18.04.3 LTS

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

jvalkeal avatar Oct 15 '21 08:10 jvalkeal

im guessing uint64 is used in underlying library (e.g. constant 18446744073709551616 overflows uint64 type of error). im actually not quite sure if we should do anything about this given practical limitations of how numbers are stored.

@jvalkeal what was your use case for using such large numbers. are they based on timestamps?

cppforlife avatar Oct 22 '21 22:10 cppforlife