-
Notifications
You must be signed in to change notification settings - Fork 56
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
sanitizeVersion breaks helm lint because it's not semver compliant #258
Comments
if anyone is hitting this issue as well, I'm using this workaround. right after plugin application,
|
Is there a specific reason you choose to do this for the entire project, instead of just varying it for the task(s) that need a sanitized version? This doesn't feel like something that should be a concern of the plugin, and happen only when necessary. Arguably if you follow the semantic versioning meaning of |
maybe is yet another opinion, but I prefer to have all the artifacts built by one gradle-build with the same version. To avoid any kind of confusion.
I think it should be concern of the plugin to maintain compliancy with semantic versioning also with the regarding the proposed solution to strip everything from the For example, in the affected pipeline that caused me to create this issue, we build a docker image, a helm chart (and some other artifacts) on a pr with a version that at the moment looks like this If we do this, if/when the pipeline (or a developer) will try to install the helm chart, it's going to be more difficult to understand which commit is installed in a dev/test cluster because developer can amend their commits on the same pr, causing the pre-release section While if would keep the unsanitized version It's just a bit confusing and increases complexity when the time for debugging comes. |
use case:
build and release docker images and helm charts
the issue:
Because docker tags won't accept the
+
symbol, I added the sanitizeVersion propertyThis replaces the
+
symbol with the.
symbol creating a new pre-release identifier.example from the readme:
The last pre-release component (
e1c43c7
) is the shortened hash of the revision being built.According to https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions, each of the dot-separated pre-release components should be an alphanumeric string or a number starting with a positive-digit.
So, in the event of a revision hash that has digits only and it is starting with a
0
, the version created by this plugin is not SemVer compliant. ( the probability of this happening is circa 0.4%)And apparently Helm lint is very strict about this.
the solution:
prepending or appending a character to the shortened revision hash could be very confusing (as it could easily be mistaken for a character of the hash).
Maybe prepending something like
rev-
to have1.351.0-dev.21.pr.489.rev-0303690
could work?(note that the symbol
-
is a valid non-digit in the grammar)However I'm not sure if this could break some other use cases, so maybe we need a breaking-change or a new property to adopt this behaviour?
The text was updated successfully, but these errors were encountered: