Release CI handling of newlines/lack of newlines
In the 1.29 release we ran into an issue with synker failing (very nondescript error). After reviewing the clean install images.txt artifact we discovered that there were two images listed in a single line (example: image1:1.0image2:2.0
).
Tracking the issue down, one package was missing a newline at the end of tests/images.txt
.
While including a newline at the end of a file is a best practice we should make sure that CI creates proper output regardless. This issue can be traced back to the [bigbang_additional_images](https://repo1.dso.mil/platform-one/big-bang/pipeline-templates/pipeline-templates/-/blob/master/library/templates.sh#L176)
function that runs. Potentially we could just add a check like the following:
if curl -f "${repourl%.git}/-/raw/${version}/tests/images.txt?inline=false" 1>${package}.images.txt 2>/dev/null; then
if [ "$(tail -c 1 ${package}.images.txt)" != "" ]; then
echo "" >> ${package}.images.txt
fi
cat ${package}.images.txt >> images.txt
fi
This would essentially check if a newline exists at the end of the images file and if it doesn't, append one (note: has not been tested).
Regardless of the specific implementation we should ensure that a release is not held up on adding a newline to a file.