Skip to content

fix(release-ansible-collection): gate release on galaxy.yml version and changelog section - #197

Merged
sbaerlocher merged 2 commits into
mainfrom
fix/release-collection-gates
Oct 29, 2026
Merged

sbaerlocher merged 2 commits into
mainfrom
fix/release-collection-gates

Conversation

@sbaerlocher

Copy link
Copy Markdown
Member

Summary

  • New step fails the release when the pushed tag differs from version in galaxy.yml (a v-prefixed tag now fails here instead of silently falling back to generated notes).
  • Changelog extraction fails when CHANGELOG.md is missing or the ## [VERSION] section is missing or empty; before, it set found=true and published empty release notes. The generate_release_notes fallback is gone.
  • Section lookup now uses a literal awk match: dots in the version are no longer regex wildcards, and the last section in the file keeps its final line (the old sed '$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

  • actionlint and yamllint clean on the workflow
  • Extraction checked locally against a sample CHANGELOG: empty section, missing version, v-prefix and 1x1x0 fail; bracketed, unbracketed and last section succeed
  • Next collection release after the Renovate bump publishes with notes

…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>
Comment thread CHANGELOG.md Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All raised issues have been addressed.

@sbaerlocher
sbaerlocher merged commit 50929e6 into main Oct 29, 2026
13 checks passed
@sbaerlocher
sbaerlocher deleted the fix/release-collection-gates branch October 29, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant