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

Ability to do a find/replace on resulting tags prior to sorting #147

Open
voor opened this issue Apr 8, 2022 · 2 comments
Open

Ability to do a find/replace on resulting tags prior to sorting #147

voor opened this issue Apr 8, 2022 · 2 comments
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@voor
Copy link

voor commented Apr 8, 2022

What steps did you take:

vendir tools sort-semver -v "v1.17.16_vmware.2-tkg.1  v1.17.16_vmware.2-tkg.2  v1.17.16_vmware.3-tkg.1  v1.18.16_vmware.1-tkg.1  v1.18.16_vmware.1-tkg.2  v1.18.16_vmware.3-tkg.1  v1.18.17_vmware.1-tkg.1  v1.18.17_vmware.2-tkg.1  v1.19.12_vmware.1-tkg.1  v1.19.12_vmware.1-tkg.2  v1.19.12_vmware.1-tkg.3-tf-v0.10.1  v1.19.16_vmware.1-tkg.1  v1.19.8_vmware.1-tkg.1  v1.19.8_vmware.1-tkg.2  v1.19.8_vmware.3-tkg.1  v1.19.9_vmware.1-tkg.1  v1.19.9_vmware.2-tkg.1  v1.20.11_vmware.1-tkg.1-tf-v0.10.1  v1.20.14_vmware.1-tkg.1  v1.20.14_vmware.1-tkg.2  v1.20.14_vmware.1-tkg.4  v1.20.14_vmware.1-tkg.4-tf-v0.11.2  v1.20.14_vmware.1-tkg.5  v1.20.4_vmware.1-tkg.1  v1.20.4_vmware.1-tkg.2  v1.20.4_vmware.3-tkg.1  v1.20.5_vmware.1-tkg.1  v1.20.5_vmware.2-fips.1-tkg.1  v1.20.5_vmware.2-tkg.1  v1.20.8_vmware.1-fips.1-tkg.2  v1.20.8_vmware.1-tkg.2  v1.20.8_vmware.1-tkg.3  v1.21.2_vmware.1-fips.1-tkg.1  v1.21.2_vmware.1-tkg.1  v1.21.2_vmware.1-tkg.2  v1.21.5_vmware.1-tkg.1-tf-v0.10.1  v1.21.8_vmware.1-tkg.1  v1.21.8_vmware.1-tkg.2  v1.21.8_vmware.1-tkg.4  v1.21.8_vmware.1-tkg.4-tf-v0.11.2  v1.21.8_vmware.1-tkg.5  v1.22.5_vmware.1-tkg.1  v1.22.5_vmware.1-tkg.3  v1.22.5_vmware.1-tkg.3-tf-v0.11.2  v1.22.5_vmware.1-tkg.4  "
Versions

Version  

Succeeded

What happened:
Nothing is properly detected as semantic versioned.

What did you expect:
Replacing + with _ is a common change since container tags cannot have a + in them. In fact most systems (like containerd) will actually replace the + into a _ for you.

vendir tools sort-semver -v "v1.17.16+vmware.2-tkg.1  v1.17.16+vmware.2-tkg.2  v1.17.16+vmware.3-tkg.1  v1.18.16+vmware.1-tkg.1  v1.18.16+vmware.1-tkg.2  v1.18.16+vmware.3-tkg.1  v1.18.17+vmware.1-tkg.1  v1.18.17+vmware.2-tkg.1  v1.19.12+vmware.1-tkg.1  v1.19.12+vmware.1-tkg.2  v1.19.12+vmware.1-tkg.3-tf-v0.10.1  v1.19.16+vmware.1-tkg.1  v1.19.8+vmware.1-tkg.1  v1.19.8+vmware.1-tkg.2  v1.19.8+vmware.3-tkg.1  v1.19.9+vmware.1-tkg.1  v1.19.9+vmware.2-tkg.1  v1.20.11+vmware.1-tkg.1-tf-v0.10.1  v1.20.14+vmware.1-tkg.1  v1.20.14+vmware.1-tkg.2  v1.20.14+vmware.1-tkg.4  v1.20.14+vmware.1-tkg.4-tf-v0.11.2  v1.20.14+vmware.1-tkg.5  v1.20.4+vmware.1-tkg.1  v1.20.4+vmware.1-tkg.2  v1.20.4+vmware.3-tkg.1  v1.20.5+vmware.1-tkg.1  v1.20.5+vmware.2-fips.1-tkg.1  v1.20.5+vmware.2-tkg.1  v1.20.8+vmware.1-fips.1-tkg.2  v1.20.8+vmware.1-tkg.2  v1.20.8+vmware.1-tkg.3  v1.21.2+vmware.1-fips.1-tkg.1  v1.21.2+vmware.1-tkg.1  v1.21.2+vmware.1-tkg.2  v1.21.5+vmware.1-tkg.1-tf-v0.10.1  v1.21.8+vmware.1-tkg.1  v1.21.8+vmware.1-tkg.2  v1.21.8+vmware.1-tkg.4  v1.21.8+vmware.1-tkg.4-tf-v0.11.2  v1.21.8+vmware.1-tkg.5  v1.22.5+vmware.1-tkg.1  v1.22.5+vmware.1-tkg.3  v1.22.5+vmware.1-tkg.3-tf-v0.11.2  v1.22.5+vmware.1-tkg.4
"
Versions

Version  
v1.17.16+vmware.2-tkg.1  
v1.17.16+vmware.2-tkg.2  
v1.17.16+vmware.3-tkg.1  
v1.18.16+vmware.1-tkg.1  
v1.18.16+vmware.1-tkg.2  
v1.18.16+vmware.3-tkg.1  
v1.18.17+vmware.1-tkg.1  
v1.18.17+vmware.2-tkg.1  
v1.19.8+vmware.1-tkg.1  
v1.19.8+vmware.1-tkg.2  
v1.19.8+vmware.3-tkg.1  
v1.19.9+vmware.1-tkg.1  
v1.19.9+vmware.2-tkg.1  
v1.19.12+vmware.1-tkg.1  
v1.19.12+vmware.1-tkg.2  
v1.19.12+vmware.1-tkg.3-tf-v0.10.1  
v1.19.16+vmware.1-tkg.1  
v1.20.4+vmware.1-tkg.1  
v1.20.4+vmware.1-tkg.2  
v1.20.4+vmware.3-tkg.1  
v1.20.5+vmware.1-tkg.1  
v1.20.5+vmware.2-fips.1-tkg.1  
v1.20.5+vmware.2-tkg.1  
v1.20.8+vmware.1-fips.1-tkg.2  
v1.20.8+vmware.1-tkg.2  
v1.20.8+vmware.1-tkg.3  
v1.20.11+vmware.1-tkg.1-tf-v0.10.1  
v1.20.14+vmware.1-tkg.1  
v1.20.14+vmware.1-tkg.2  
v1.20.14+vmware.1-tkg.4  
v1.20.14+vmware.1-tkg.5  
v1.20.14+vmware.1-tkg.4-tf-v0.11.2  
v1.21.2+vmware.1-fips.1-tkg.1  
v1.21.2+vmware.1-tkg.1  
v1.21.2+vmware.1-tkg.2  
v1.21.5+vmware.1-tkg.1-tf-v0.10.1  
v1.21.8+vmware.1-tkg.1  
v1.21.8+vmware.1-tkg.2  
v1.21.8+vmware.1-tkg.4  
v1.21.8+vmware.1-tkg.5  
v1.21.8+vmware.1-tkg.4-tf-v0.11.2  
v1.22.5+vmware.1-tkg.1  
v1.22.5+vmware.1-tkg.3  
v1.22.5+vmware.1-tkg.4  
v1.22.5+vmware.1-tkg.3-tf-v0.11.2  

Highest version: v1.22.5+vmware.1-tkg.3-tf-v0.11.2

Succeeded

Anything else you would like to add:
I don't want to solutionize here, since folks might intentionally have the _ there and it's not meant to turn into a +, just illustrating that in this isolated event treating the _ as a + would fix things.

Environment:

  • vendir version (execute vendir --version): 0.26.0
  • OS (e.g. from /etc/os-release): Fedora 35

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.

@voor voor added bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Apr 8, 2022
@joe-kimmel-vmw
Copy link
Contributor

Thanks @voor - it seems like the library we're using is enforcing the semver 2.0.0 BNF grammar which includes the + as you show above, and - (hyphens) (to designate prereleases) but not underscores.

@joe-kimmel-vmw joe-kimmel-vmw added enhancement This issue is a feature request priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. and removed bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Apr 13, 2022
@voor voor changed the title Underscores anger the semver process Ability to do a find/replace on resulting tags prior to sorting Apr 30, 2022
@voor
Copy link
Author

voor commented Apr 30, 2022

I've updated the title to reflect what I actually need. If I remove the _vmware.1 part from the versions then sorting can proceed:

vendir tools sort-semver -v "v1.19.12-tkg.1  v1.19.12-tkg.2  v1.19.12-tkg.3-tf-v0.10.1  v1.19.16-tkg.1  v1.20.11-tkg.1-tf-v0.10.1  v1.20.14-tkg.1  v1.20.14-tkg.2  v1.20.14-tkg.4  v1.20.14-tkg.4-tf-v0.11.2  v1.20.14-tkg.5  v1.20.15-tkg.1  v1.20.8-tkg.2  v1.20.8-tkg.3  v1.21.11-tkg.1  v1.21.2-tkg.1  v1.21.2-tkg.2  v1.21.5-tkg.1-tf-v0.10.1  v1.21.8-tkg.1  v1.21.8-tkg.2  v1.21.8-tkg.4  v1.21.8-tkg.4-tf-v0.11.2  v1.21.8-tkg.5" --prerelease

I need some sort of find/replace capability on the versions prior to attempting sorting. Whether that's changing _ to +, or in my case removing a chunk of erroneous text from the versions.

@neil-hickey neil-hickey added the carvel-accepted This issue should be considered for future work and that the triage process has been completed label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
Status: Unprioritized
Development

No branches or pull requests

3 participants