A bug edge case in gradle versioning for versions that end with a separator #33604
Labels
priority-4-low
Low priority, unlikely to be done unless it becomes important to more people
type:bug
Bug fix of existing functionality
versioning:gradle
Gradle versioning
Discussed in #33581
Originally posted by PhilipAbed January 12, 2025
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
github
Please tell us more about your question or problem
The failed version is taken from here: https://mvnrepository.com/artifact/org.jenkins-ci.plugins/token-macro
input is: 400.v35420b_922dcb_
and it fails to tokenize this version in gradle.
to reproduce the bug
add a test to the
lib/modules/versioning/gradle/index.spec.ts
The first succeeds but the second fails because it ends with a
_
separatorso i tried the same test in
lib/modules/versioning/maven/index.spec.ts
and it works like a charm.
here's the results of Gradle versioning tokenize:
note: returns null when it reaches the last character
_
here's the result of Maven versioning tokenize
I noticed both functions in gradle and maven have the same purpose but.
each of them consider different separators.
Gradle has "_" as a separator while maven considers it a normal letter.
They mention in gradle docs
Versions are divided into parts using the characters [. - _ +].
yet they let you set a version that ends with a separator which is confusing our resolution
We should not deviate from the gradle docs.
but there's no harm in changing tokenize function to allow ending with a separator "_"
The text was updated successfully, but these errors were encountered: