ci: check the release version against its fragments and limit what a release/ branch may change #176

Open
opened 2026-11-15 18:39:40 +00:00 by Claude · 6 comments
Owner

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

  1. Build: version consistency. On a pull request that changes 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 from origin/main's copy, like the other judge scripts.
    • Section-to-bump mapping, one entry for each section in changelogs/config.yaml:
      • Major: breaking_changes, removed_features.
      • Minor: minor_changes, deprecated_features.
      • Patch: bugfixes, security_fixes, known_issues.
    • The version check has no major_changes case: this issue removes the major_changes pair from sections in changelogs/config.yaml, so the existing antsibull-changelog lint hook refuses such a fragment in the contributor's own pull request. A major release comes from breaking_changes or removed_features.
    • In the same file, drop "(previously deprecated)" from the removed_features title: inputs are removed without a deprecation period.
    • Latest full run. The check also fails a release pull request unless the latest completed full run succeeded.
      • A full run is a schedule or workflow_dispatch run of molecule.yml on main.
      • Read it with 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.
      • The check's job needs permissions: actions: read. Pass values through env:.
      • Every other pull request passes this step, so the check can stay required.
  2. Bot-diff gate. Extend scripts/check_bot_pr_diff.py so a release/ head ref may only change:
    • the version: line of galaxy.yml,
    • changelogs/changelog.yaml, changelogs/.plugin-cache.yaml and CHANGELOG.rst,
    • deletions under 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

  • Tests for both: a matching release passes; a hand-bumped version, an extra file, or an edited (not deleted) fragment on a release/ branch fails.
  • A change to changelogs/.plugin-cache.yaml on a release/ head passes (test).
  • A fragment with a major_changes section fails antsibull-changelog lint.
  • With the latest full run red, a release pull request's check fails and says to dispatch Molecule on main and re-run. With it green, the check passes.
Spec: [Release automation](https://git.rkdr.net/Mortis/Kamino/issues/98). Shares the fragment-to-bump mapping with [the release workflow issue](https://git.rkdr.net/Mortis/Kamino/issues/175): one function, imported by both, tested once. Whichever issue lands first creates the module, the other imports it. ## What 1. **Build: version consistency.** On a pull request that changes `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 from `origin/main`'s copy, like the other judge scripts. - Section-to-bump mapping, one entry for each section in `changelogs/config.yaml`: - Major: `breaking_changes`, `removed_features`. - Minor: `minor_changes`, `deprecated_features`. - Patch: `bugfixes`, `security_fixes`, `known_issues`. - The version check has no `major_changes` case: this issue removes the `major_changes` pair from `sections` in `changelogs/config.yaml`, so the existing `antsibull-changelog lint` hook refuses such a fragment in the contributor's own pull request. A major release comes from `breaking_changes` or `removed_features`. - In the same file, drop "(previously deprecated)" from the `removed_features` title: inputs are removed without a deprecation period. - **Latest full run.** The check also fails a release pull request unless the latest completed full run succeeded. - A full run is a `schedule` or `workflow_dispatch` run of `molecule.yml` on `main`. - Read it with `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. - The check's job needs `permissions: actions: read`. Pass values through `env:`. - Every other pull request passes this step, so the check can stay required. 2. **Bot-diff gate.** Extend `scripts/check_bot_pr_diff.py` so a `release/` head ref may only change: - the `version:` line of `galaxy.yml`, - `changelogs/changelog.yaml`, `changelogs/.plugin-cache.yaml` and `CHANGELOG.rst`, - deletions under `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 - Tests for both: a matching release passes; a hand-bumped version, an extra file, or an edited (not deleted) fragment on a `release/` branch fails. - A change to `changelogs/.plugin-cache.yaml` on a `release/` head passes (test). - A fragment with a `major_changes` section fails `antsibull-changelog lint`. - With the latest full run red, a release pull request's check fails and says to dispatch Molecule on `main` and re-run. With it green, the check passes.
Claude added the
Status
Ready for Agent
label 2026-11-15 18:39:40 +00:00
Claude added this to the Continuous delivery milestone 2026-11-15 22:21:21 +00:00
Author
Owner

Spec change from Release path: fragment check, failed publish and tarball integrity:

  • Add changelogs/.plugin-cache.yaml to what a release/ head may change (it changes in every release commit), with a test.
  • The fragment-to-bump function is shared with the release workflow issue; whichever issue lands first creates the module, the other imports it.
Spec change from [Release path: fragment check, failed publish and tarball integrity](https://git.rkdr.net/Mortis/Kamino/issues/211): - Add `changelogs/.plugin-cache.yaml` to what a `release/` head may change (it changes in every release commit), with a test. - The fragment-to-bump function is shared with [the release workflow issue](https://git.rkdr.net/Mortis/Kamino/issues/175); whichever issue lands first creates the module, the other imports it.
Author
Owner

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. A major_changes fragment fails the check (use breaking_changes or minor_changes). Drop "(previously deprecated)" from the removed_features title in changelogs/config.yaml: inputs are removed without a deprecation period.

Scope added by [Role standard gaps found in review](https://git.rkdr.net/Mortis/Kamino/issues/214) (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`. A `major_changes` fragment fails the check (use `breaking_changes` or `minor_changes`). Drop "(previously deprecated)" from the `removed_features` title in `changelogs/config.yaml`: inputs are removed without a deprecation period.
Author
Owner

Review of the map (2026-11-17).

The comment of 2026-11-17 says "A major_changes fragment 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_changes pair from sections in changelogs/config.yaml. The existing antsibull-changelog lint hook 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_changes is not used; reason: a major release comes from breaking_changes or removed_features; held by control, the changelog lint hook. A standard tool then holds it and no custom code is added.

Review of the map (2026-11-17). The comment of 2026-11-17 says "A `major_changes` fragment 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_changes` pair from `sections` in `changelogs/config.yaml`. The existing `antsibull-changelog lint` hook 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_changes` is not used; reason: a major release comes from `breaking_changes` or `removed_features`; held by control, the changelog lint hook. A standard tool then holds it and no custom code is added.
Author
Owner

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.

  • A full run is a schedule or workflow_dispatch run of molecule.yml on main.
  • Read it with 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.
  • The check's job needs permissions: actions: read. Pass values through env:.
  • Every other pull request passes this step, so the check can stay required.
  • Acceptance, added: with the latest full run red, a release pull request's check fails and says to dispatch Molecule on main and re-run. With it green, the check passes.
## Scope added from [What Molecule proves before a merge, and who acts on the nightly run](https://git.rkdr.net/Mortis/Kamino/issues/256) (2026-11-20) The release-content check also fails a release pull request unless the latest completed **full run** succeeded. - A full run is a `schedule` or `workflow_dispatch` run of `molecule.yml` on `main`. - Read it with `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. - The check's job needs `permissions: actions: read`. Pass values through `env:`. - Every other pull request passes this step, so the check can stay required. - Acceptance, added: with the latest full run red, a release pull request's check fails and says to dispatch Molecule on `main` and re-run. With it green, the check passes.
Author
Owner

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.

  • Decision 1: major_changes leaves sections in changelogs/config.yaml, so the changelog lint hook refuses it; the version check has no major_changes case, and an acceptance line was added for it.
  • The seven-section bump mapping, .plugin-cache.yaml on a release/ head, the shared module note and the latest-full-run check (with permissions: actions: read) are carried from the earlier comments.
Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, https://git.rkdr.net/Mortis/Kamino/issues/87#issuecomment-12281). The body is the spec; the earlier comments are history. - Decision 1: `major_changes` leaves `sections` in `changelogs/config.yaml`, so the changelog lint hook refuses it; the version check has no `major_changes` case, and an acceptance line was added for it. - The seven-section bump mapping, `.plugin-cache.yaml` on a `release/` head, the shared module note and the latest-full-run check (with `permissions: actions: read`) are carried from the earlier comments.
Author
Owner

Scope added by #359, the pull request for #262: the Releases section of docs/contributing/maintaining.md holds 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 on main is red. After a fix, dispatch Molecule on main and release only once it succeeds."

The pull request that lands this issue's release-content check updates that rule in maintaining.md:

  • The rule becomes: the release pull request merges only when the latest full run on main succeeded; after a fix, dispatch Molecule on main and re-run the release pull request's checks.
  • The held-by line becomes: Held by: control: the release-content check.

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.

Scope added by #359, the pull request for #262: the Releases section of `docs/contributing/maintaining.md` holds 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 on `main` is red. After a fix, dispatch Molecule on `main` and release only once it succeeds." The pull request that lands this issue's release-content check updates that rule in `maintaining.md`: - The rule becomes: the release pull request merges only when the latest full run on `main` succeeded; after a fix, dispatch Molecule on `main` and re-run the release pull request's checks. - The held-by line becomes: *Held by:* control: the release-content check. 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#176