ci: check the release version against its fragments and limit what a release/ branch may change #176
Notifications
Due Date
No due date set.
Depends on
Reference: Mortis/Kamino#176
Reference in new issue
Block a user
Spec: Release automation. Shares the fragment-to-bump mapping with the release workflow issue: one function, imported by both, tested once. Whichever issue lands first creates the module, the other imports it.
What
galaxy.yml's version, check that the new version is exactly what the fragments the pull request releases call for (the bump mapping from the spec, applied to the last released version). A hand-edited version fails. Run it fromorigin/main's copy, like the other judge scripts.changelogs/config.yaml:breaking_changes,removed_features.minor_changes,deprecated_features.bugfixes,security_fixes,known_issues.major_changescase: this issue removes themajor_changespair fromsectionsinchangelogs/config.yaml, so the existingantsibull-changelog linthook refuses such a fragment in the contributor's own pull request. A major release comes frombreaking_changesorremoved_features.removed_featurestitle: inputs are removed without a deprecation period.scheduleorworkflow_dispatchrun ofmolecule.ymlonmain.GET /repos/{owner}/{repo}/actions/workflows/molecule.yml/runs?branch=main(Gitea >= 1.27; the job token is accepted). Keep only those two events and take the newest completed run.permissions: actions: read. Pass values throughenv:.scripts/check_bot_pr_diff.pyso arelease/head ref may only change:version:line ofgalaxy.yml,changelogs/changelog.yaml,changelogs/.plugin-cache.yamlandCHANGELOG.rst,changelogs/fragments/.Anything else fails. Like the
renovate/rule, this only constrains the bot's own pull requests (the branch name is attacker-controlled).Acceptance
release/branch fails.changelogs/.plugin-cache.yamlon arelease/head passes (test).major_changessection failsantsibull-changelog lint.mainand re-run. With it green, the check passes.Spec change from Release path: fragment check, failed publish and tarball integrity:
changelogs/.plugin-cache.yamlto what arelease/head may change (it changes in every release commit), with a test.Scope added by Role standard gaps found in review (resolution comment, rule 8): the version check maps every section in
changelogs/config.yaml. Major:breaking_changes,removed_features. Minor:minor_changes,deprecated_features. Patch:bugfixes,security_fixes,known_issues. Amajor_changesfragment fails the check (usebreaking_changesorminor_changes). Drop "(previously deprecated)" from theremoved_featurestitle inchangelogs/config.yaml: inputs are removed without a deprecation period.Review of the map (2026-11-17).
The comment of 2026-11-17 says "A
major_changesfragment fails the check". The version check fires only on the release pull request, which may not edit fragments, so the author of the fragment never sees the refusal.Proposal for the maintainer: remove the
major_changespair fromsectionsinchangelogs/config.yaml. The existingantsibull-changelog linthook then refuses such a fragment in the contributor's own pull request ("invalid section: major_changes", checked with 0.37.0), and the version check needs no case for it. If accepted, the rule reads:major_changesis not used; reason: a major release comes frombreaking_changesorremoved_features; held by control, the changelog lint hook. A standard tool then holds it and no custom code is added.Scope added from What Molecule proves before a merge, and who acts on the nightly run (2026-11-20)
The release-content check also fails a release pull request unless the latest completed full run succeeded.
scheduleorworkflow_dispatchrun ofmolecule.ymlonmain.GET /repos/{owner}/{repo}/actions/workflows/molecule.yml/runs?branch=main(Gitea ≥ 1.27; the job token is accepted). Keep only those two events and take the newest completed run.permissions: actions: read. Pass values throughenv:.mainand re-run. With it green, the check passes.Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
major_changesleavessectionsinchangelogs/config.yaml, so the changelog lint hook refuses it; the version check has nomajor_changescase, and an acceptance line was added for it..plugin-cache.yamlon arelease/head, the shared module note and the latest-full-run check (withpermissions: actions: read) are carried from the earlier comments.Scope added by #359, the pull request for #262: the Releases section of
docs/contributing/maintaining.mdholds this rule as Held by: aspirational, worded for a hand-cut release because no release pull request exists yet: "No release while the latest full run onmainis red. After a fix, dispatch Molecule onmainand release only once it succeeds."The pull request that lands this issue's release-content check updates that rule in
maintaining.md:mainsucceeded; after a fix, dispatch Molecule onmainand re-run the release pull request's checks.If the release workflow has landed by then, the same pull request also rewrites the hand-cut release rule above it to "a release happens only by merging the generated release pull request". Neither line names an issue number.