Repository navigation
fix(release-ansible-collection): gate release on galaxy.yml version and changelog section - #197
Merged
Merged
Conversation
…nd changelog section A tag that differs from the galaxy.yml version, or a missing or empty CHANGELOG section, now fails before the Galaxy publish instead of shipping a release with empty notes. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
There was a problem hiding this comment.
The new awk heading match is stricter than the old sed: ## [1.0.0](url) headings and CRLF changelogs no longer match, so those releases now fail. The galaxy.yml check gives no clear error when the file or its version key is missing. The hard-fail behaviour change is filed under 'Fixed' with no breaking callout for consumers. Extraction logic now differs from templates/workflows/tag.yml. In the last section, the trailing link-reference definitions end up in the release notes. Details are in the inline comments.
- Match changelog headings by prefix like templates/workflows/tag.yml, so
linked headings ('## [1.0.0](url)') and date suffixes still match.
- Strip CR so CRLF changelogs match, and stop at trailing link reference
definitions so they stay out of the release notes.
- Read galaxy.yml version with sed instead of yq and fail with an explicit
annotation when the file or the version key is missing.
- Flag the hard-fail behaviour as breaking in the CHANGELOG migration notes.
Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
versioningalaxy.yml(av-prefixed tag now fails here instead of silently falling back to generated notes).CHANGELOG.mdis missing or the## [VERSION]section is missing or empty; before, it setfound=trueand published empty release notes. Thegenerate_release_notesfallback is gone.awkmatch: dots in the version are no longer regex wildcards, and the last section in the file keeps its final line (the oldsed '$d'dropped it).Behaviour change for callers: a release without a matching, non-empty changelog section or with a tag/galaxy.yml mismatch now fails before publishing. All three collection callers pin a date tag, so this reaches them only via the Renovate bump.
Test plan
actionlintandyamllintclean on the workflowv-prefix and1x1x0fail; bracketed, unbracketed and last section succeed