Skip to content

Fix: Make upsert git tag match full version string

What does this MR do?

Make the upsert git tag match the full version string. In particular, an existing git tag v3.0.0-alpha0 should not match a new changelog entry for v3.0.0 (stable release). See https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/jobs/2477352079#L67

What are the relevant issue numbers?

None

Testing

% lima nerdctl run -ti --rm alpine                                                                                
# cat > tmp/tags
v2.8.0          Switch to Alpine Linux
v2.8.1          Fix flaky requirements for pipenv (!49)
v2.9.0          Add id field to vulnerabilities in JSON report
v3.0.0-alpha0   Merge branch 'retag-3.0.0-alpha1' into 'v3'
^d

# for CHANGELOG_VERSION in v2.9.0 v3.0.0-alpha0 v3.0.0; do
> echo -n "$CHANGELOG_VERSION: "
> cat tmp/tags | grep "^$CHANGELOG_VERSION\s\+" || echo NOT FOUND
> done
v2.9.0: v2.9.0          Add id field to vulnerabilities in JSON report
v3.0.0-alpha0: v3.0.0-alpha0   Merge branch 'retag-3.0.0-alpha1' into 'v3'
v3.0.0: NOT FOUND

Merge request reports