We resolve issue #380 by trimming input version values from VERSION files for maven and crate artifacts assembly rules. It solves the problem of VERSION files being passed as version_file to the respective rules after being formatted to have an additional empty line in the end, which is a standard convention for files and a common IDE setting, or just being formatted incorrectly while containing a valid value.
From now on, VERSION files passed into assemble_maven and assemble_crate can have any leading and trailing whitespaces.
What are the changes implemented in this PR?
We add trim() calls for all the .kt scripts reading version files. This behavior used to exist for many .py scripts (with strip() for Pythonstring), but these places were left forgotten (and not noticed by us as we use --define version=$(cat VERSION) in most of our assembly pipelines).
We also add a respective check for trimmed version values into the maven deployment script to prevent users from forgetting to format their input versions while using any pom file as it can lead to corrupted snapshots, snapshot repositories URLs, and other automation failures.
What is the goal of this PR?
We resolve issue #380 by trimming input
version
values fromVERSION
files formaven
andcrate
artifacts assembly rules. It solves the problem ofVERSION
files being passed asversion_file
to the respective rules after being formatted to have an additional empty line in the end, which is a standard convention for files and a common IDE setting, or just being formatted incorrectly while containing a valid value.From now on,
VERSION
files passed intoassemble_maven
andassemble_crate
can have any leading and trailing whitespaces.What are the changes implemented in this PR?
We add
trim()
calls for all the.kt
scripts readingversion
files. This behavior used to exist for many.py
scripts (withstrip()
forPython
string
), but these places were left forgotten (and not noticed by us as we use--define version=$(cat VERSION)
in most of our assembly pipelines). We also add a respective check for trimmedversion
values into themaven
deployment script to prevent users from forgetting to format their inputversion
s while using anypom
file as it can lead to corrupted snapshots, snapshot repositoriesURL
s, and other automation failures.