ci(images): assign image versions in CI and open the pin PR right after a push #165

Closed
opened 2026-11-15 14:29:03 +00:00 by Claude · 8 comments
Owner

Spec: CI image pipeline: keep, simplify or replace, resolution sections 3 and 4.

What

  • Remove the version: lines from the image.yml build matrix. Each image gets a small base: line (MAJOR.MINOR) that a human edits only for a minor or major.
  • Adapt matrix_of and check_pins in scripts/check_image_versions.py to the base: matrix, the smallest change that keeps check_image_versions.py pins passing. The check that a consumer pin is not newer than the matrix version goes, since the matrix holds no version. Remove Lint's "Check image versions were bumped" step in .gitea/workflows/lint.yml. The rest of that script's rewrite stays with refactor(images): image docs next to the images, check_image_versions.py pins only.
  • On push to main, the image job computes a checksum of the image's inputs and compares it with the input-checksum label of the newest published <base>.x. If they differ, it publishes the next patch as <version> and latest, with the checksum as a label. If they match, it ends without building. A published tag is never moved.
  • After a new version is pushed, the pin-follow PR opens within minutes. renovate.yml gets on: workflow_run: workflows: [Images], types: [completed], runs live (not as a dry run), and is guarded on conclusion == 'success'. A manual dispatch of the Renovate workflow is a dry run unless its input is exactly the string "false", so image.yml does not dispatch it. Gitea implements workflow_run; it needs no token, no API call and no input. Check first that a workflow_run started by an Actions-triggered run is not filtered out. Fallback if it is: a separate job with needs: on the image job that dispatches with inputs: {dry_run: "false"}; name the credential it uses (never the registry secret), and verify that the job token may dispatch.
  • Remove scripts/bump_image_versions.py and its tests, the bump mode of check_image_versions.py, Renovate's post-upgrade task, and the bot-diff gate's allowance for matrix version: lines. Update the two-PR loop text in images/AGENTS.md (and in the root AGENTS.md, if it has a line on it).

Acceptance

  • An image-input PR needs no version edit, and Lint passes without one.
  • Merging it publishes the next patch version, and the pin PR exists shortly after the image push (a dry run that opens nothing does not count).
  • A merge that does not change an image's inputs publishes nothing.
  • The pin PR automerges only after one maintainer approval per image build, once CODEOWNERS and the protection setting are in. Decision: Code-owner approval against Renovate automerge, and where secrets live, point 1. See also Renovate automerge posture.

The registry credential stays in image.yml only. The Renovate trigger must not hand it on.

Open proposals

  • The number of minutes for "the pin PR exists within N minutes of the image push": proposal 15 minutes, observed by the maintainer after the merge and noted on this issue. The number is the maintainer's.
Spec: [CI image pipeline: keep, simplify or replace](https://git.rkdr.net/Mortis/Kamino/issues/96), resolution sections 3 and 4. ## What - Remove the `version:` lines from the `image.yml` build matrix. Each image gets a small `base:` line (`MAJOR.MINOR`) that a human edits only for a minor or major. - Adapt `matrix_of` and `check_pins` in `scripts/check_image_versions.py` to the `base:` matrix, the smallest change that keeps `check_image_versions.py pins` passing. The check that a consumer pin is not newer than the matrix version goes, since the matrix holds no version. Remove Lint's "Check image versions were bumped" step in `.gitea/workflows/lint.yml`. The rest of that script's rewrite stays with [refactor(images): image docs next to the images, check_image_versions.py pins only](https://git.rkdr.net/Mortis/Kamino/issues/169). - On push to `main`, the image job computes a checksum of the image's inputs and compares it with the input-checksum label of the newest published `<base>.x`. If they differ, it publishes the next patch as `<version>` and `latest`, with the checksum as a label. If they match, it ends without building. A published tag is never moved. - After a new version is pushed, the pin-follow PR opens within minutes. `renovate.yml` gets `on: workflow_run: workflows: [Images], types: [completed]`, runs live (not as a dry run), and is guarded on `conclusion == 'success'`. A manual dispatch of the Renovate workflow is a dry run unless its input is exactly the string "false", so `image.yml` does not dispatch it. Gitea implements `workflow_run`; it needs no token, no API call and no input. Check first that a `workflow_run` started by an Actions-triggered run is not filtered out. Fallback if it is: a separate job with `needs:` on the image job that dispatches with `inputs: {dry_run: "false"}`; name the credential it uses (never the registry secret), and verify that the job token may dispatch. - Remove `scripts/bump_image_versions.py` and its tests, the `bump` mode of `check_image_versions.py`, Renovate's post-upgrade task, and the bot-diff gate's allowance for matrix `version:` lines. Update the two-PR loop text in `images/AGENTS.md` (and in the root `AGENTS.md`, if it has a line on it). ## Acceptance - An image-input PR needs no version edit, and Lint passes without one. - Merging it publishes the next patch version, and the pin PR exists shortly after the image push (a dry run that opens nothing does not count). - A merge that does not change an image's inputs publishes nothing. - The pin PR automerges only after one maintainer approval per image build, once CODEOWNERS and the protection setting are in. Decision: [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210), point 1. See also [Renovate automerge posture](https://git.rkdr.net/Mortis/Kamino/issues/97). The registry credential stays in `image.yml` only. The Renovate trigger must not hand it on. ## Open proposals - The number of minutes for "the pin PR exists within N minutes of the image push": proposal 15 minutes, observed by the maintainer after the merge and noted on this issue. The number is the maintainer's.
Claude added the
Status
Ready for Agent
label 2026-11-15 14:29:03 +00:00
Claude added a new dependency 2026-11-15 22:20:38 +00:00
Claude added a new dependency 2026-11-15 22:20:38 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added this to the Continuous delivery milestone 2026-11-15 22:21:20 +00:00
Author
Owner

Order: this now waits on the contributor-doc split (#189) where it edits CONTRIBUTING.md, and on docs(agents): replace CLAUDE.md with a root AGENTS.md (#185): put the CLAUDE.md edits in the root or nested AGENTS.md instead. (From Order of the implementation backlog, #198.)

Order: this now waits on the contributor-doc split (#189) where it edits `CONTRIBUTING.md`, and on docs(agents): replace CLAUDE.md with a root AGENTS.md (#185): put the `CLAUDE.md` edits in the root or nested `AGENTS.md` instead. (From Order of the implementation backlog, #198.)
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

  • A dispatch of the Renovate workflow is a dry run. The issue says "image.yml dispatches the Renovate workflow". .gitea/workflows/renovate.yml:73-75: "A manual dispatch is a dry run unless the input is exactly the string "false"", and DRY_RUN is true for any workflow_dispatch without it. Taken literally, the run logs a dry run and the pin PR never opens.
  • The dispatch step would run in a container kaniko has overwritten. .gitea/workflows/image.yml:309-313: when the executor finishes, the job container's filesystem is the built image, and the shell "needs only builtins by then". A curl call to the dispatch API in that job may find no curl.
  • Change: prefer on: workflow_run: workflows: [Images], types: [completed] in renovate.yml, run live, guarded on conclusion == 'success'. Gitea implements workflow_run; it needs no token, no API call and no input. Check first that a workflow_run started by an Actions-triggered run is not filtered out. Fallback: a separate job with needs: on the image job that dispatches with inputs: {dry_run: "false"}; name the credential it uses (never the registry secret), and verify that the job token may dispatch.
  • The acceptance passes on a dry run. "a Renovate run starts" is met by a dry run that opens nothing. Change it to "the pin PR exists within N minutes of the image push".
  • The bump rule text this issue removes is about to be rewritten elsewhere first. docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs lands before this issue and puts "bump version: in the PR that changes an image" and the two-PR loop into images/AGENTS.md. Change: add images/AGENTS.md (and the root AGENTS.md, if it has a line on it) to the files this issue updates.
  • Milestone. This issue is in Continuous delivery, but it blocks three Open to friends issues (ci: lint workflows with zizmor, chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli, and through it the local settings issue). Open to friends cannot close before it. Proposal for the maintainer: move this issue into Open to friends.
Review of the map (2026-11-15): corrections to this issue. - **A dispatch of the Renovate workflow is a dry run.** The issue says "`image.yml` dispatches the Renovate workflow". `.gitea/workflows/renovate.yml:73-75`: "A manual dispatch is a dry run unless the input is exactly the string "false"", and `DRY_RUN` is true for any `workflow_dispatch` without it. Taken literally, the run logs a dry run and the pin PR never opens. - **The dispatch step would run in a container kaniko has overwritten.** `.gitea/workflows/image.yml:309-313`: when the executor finishes, the job container's filesystem is the built image, and the shell "needs only builtins by then". A `curl` call to the dispatch API in that job may find no `curl`. - **Change:** prefer `on: workflow_run: workflows: [Images], types: [completed]` in `renovate.yml`, run live, guarded on `conclusion == 'success'`. Gitea implements `workflow_run`; it needs no token, no API call and no input. Check first that a `workflow_run` started by an Actions-triggered run is not filtered out. Fallback: a separate job with `needs:` on the image job that dispatches with `inputs: {dry_run: "false"}`; name the credential it uses (never the registry secret), and verify that the job token may dispatch. - **The acceptance passes on a dry run.** "a Renovate run starts" is met by a dry run that opens nothing. Change it to "the pin PR exists within N minutes of the image push". - **The bump rule text this issue removes is about to be rewritten elsewhere first.** [docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs](https://git.rkdr.net/Mortis/Kamino/issues/182) lands before this issue and puts "bump `version:` in the PR that changes an image" and the two-PR loop into `images/AGENTS.md`. Change: add `images/AGENTS.md` (and the root `AGENTS.md`, if it has a line on it) to the files this issue updates. - **Milestone.** This issue is in *Continuous delivery*, but it blocks three *Open to friends* issues ([ci: lint workflows with zizmor](https://git.rkdr.net/Mortis/Kamino/issues/145), [chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli](https://git.rkdr.net/Mortis/Kamino/issues/193), and through it the local settings issue). *Open to friends* cannot close before it. Proposal for the maintainer: move this issue into *Open to friends*.
Claude modified the milestone from Continuous delivery to Open to contributors 2026-11-16 06:53:30 +00:00
Author
Owner

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

  • "N minutes". The acceptance "the pin PR exists within N minutes of the image push" has no number. Proposal: 15 minutes, observed by the maintainer after the merge and noted on this issue. The number is the maintainer's.
  • Automerge of the pin pull request is no longer undecided. It waits for one maintainer approval per image build, once CODEOWNERS and the protection setting are in. Decision: Code-owner approval against Renovate automerge, and where secrets live, point 1.
  • Body against comment. The body's "image.yml dispatches the Renovate workflow" and "Update the two-PR loop text in CLAUDE.md and CONTRIBUTING.md" are replaced by the comment of 2026-11-16 (workflow_run; images/AGENTS.md).
  • In the gate on soft edges. This issue was moved into Open to friends because three gate issues are blocked by it. Each of the three can be built today with the manual PATCH bump, so those edges do not pass the order decision's own test ("cannot be built, or would fail CI or break a rule"). Whether this issue is needed before the first friend is open in Which issues must land before the first friend: image versions in CI, the apm trim and the unfiled skills commit. Nothing was changed.
Review of the map (2026-11-17). - **"N minutes".** The acceptance "the pin PR exists within N minutes of the image push" has no number. Proposal: 15 minutes, observed by the maintainer after the merge and noted on this issue. The number is the maintainer's. - **Automerge of the pin pull request** is no longer undecided. It waits for one maintainer approval per image build, once CODEOWNERS and the protection setting are in. Decision: [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210), point 1. - **Body against comment.** The body's "`image.yml` dispatches the Renovate workflow" and "Update the two-PR loop text in `CLAUDE.md` and `CONTRIBUTING.md`" are replaced by the comment of 2026-11-16 (`workflow_run`; `images/AGENTS.md`). - **In the gate on soft edges.** This issue was moved into *Open to friends* because three gate issues are blocked by it. Each of the three can be built today with the manual PATCH bump, so those edges do not pass the order decision's own test ("cannot be built, or would fail CI or break a rule"). Whether this issue is needed before the first friend is open in [Which issues must land before the first friend: image versions in CI, the apm trim and the unfiled skills commit](https://git.rkdr.net/Mortis/Kamino/issues/259). Nothing was changed.
Claude removed a dependency 2026-11-20 21:25:58 +00:00
Claude removed a dependency 2026-11-20 21:25:58 +00:00
Claude modified the milestone from Open to contributors to Continuous delivery 2026-11-20 21:25:58 +00:00
Author
Owner

Moved to Continuous delivery by Which issues must land before the first friend (question 1). It no longer blocks zizmor, the apm trim or refuse CLAUDE.md by hook: each builds today with the manual PATCH bump, so the edges failed the order decision's hard test. Its other edges are unchanged.

Moved to *Continuous delivery* by [Which issues must land before the first friend](https://git.rkdr.net/Mortis/Kamino/issues/259) (question 1). It no longer blocks [zizmor](https://git.rkdr.net/Mortis/Kamino/issues/145), [the apm trim](https://git.rkdr.net/Mortis/Kamino/issues/193) or [refuse CLAUDE.md by hook](https://git.rkdr.net/Mortis/Kamino/issues/244): each builds today with the manual PATCH bump, so the edges failed the order decision's hard test. Its other edges are unchanged.
Author
Owner

Final validation round, second pass (2026-11-20): body edited.

  • "What": added the adaptation of matrix_of and check_pins in scripts/check_image_versions.py to the base: matrix (the pin-not-newer check goes) and the removal of Lint's "Check image versions were bumped" step; the rest of the script's rewrite stays with the image-layout issue.
  • Folded in the comment of 2026-11-16: renovate.yml runs on workflow_run of Images, live, guarded on success (a dispatch is a dry run), with the fallback job; the two-PR loop text goes in images/AGENTS.md (and the root AGENTS.md if it has a line), not CLAUDE.md and CONTRIBUTING.md; the acceptance no longer passes on a dry run.
  • Folded in the comment of 2026-11-17: the pin PR's automerge is decided (one maintainer approval per image build, per the code-owner issue).
  • "N minutes" (proposal: 15) is kept under a new "Open proposals" heading.
  • The comments above stay as history.
Final validation round, second pass (2026-11-20): body edited. - "What": added the adaptation of `matrix_of` and `check_pins` in `scripts/check_image_versions.py` to the `base:` matrix (the pin-not-newer check goes) and the removal of Lint's "Check image versions were bumped" step; the rest of the script's rewrite stays with the image-layout issue. - Folded in the comment of 2026-11-16: `renovate.yml` runs on `workflow_run` of Images, live, guarded on success (a dispatch is a dry run), with the fallback job; the two-PR loop text goes in `images/AGENTS.md` (and the root `AGENTS.md` if it has a line), not `CLAUDE.md` and `CONTRIBUTING.md`; the acceptance no longer passes on a dry run. - Folded in the comment of 2026-11-17: the pin PR's automerge is decided (one maintainer approval per image build, per the code-owner issue). - "N minutes" (proposal: 15) is kept under a new "Open proposals" heading. - The comments above stay as history.
Claude modified the milestone from Continuous delivery to CI velocity (emergency) 2026-11-23 20:55:58 +00:00
Defame1297 was assigned by Claude 2026-11-23 20:57:33 +00:00
Author
Owner

Observed after the merges of #340 and #341 (2026-11-23, from the run records):

  • Images run 5236 (push of the #341 merge) published molecule-ubuntu2404 0.1.10, molecule-ubuntu2604 0.1.6 and ci 0.2.39, each with the net.rkdr.mortis.inputs-sha256 label. It finished at 22:22:10.
  • Renovate run 5238 (event workflow_run) started at 22:22:11 and ran live.
  • The pin PRs #342, #343 and #344 opened at 22:22:26–31: about 20 seconds after the Images run finished, and at most about 6 minutes after the run's first image push.
  • The workflow_run after the failed run 5229 was skipped (run 5231), as the success guard intends.

Against the proposal of 15 minutes for "the pin PR exists within N minutes of the image push", this is well inside it. The number itself is the maintainer's.

Still open: a run whose inputs are unchanged building nothing. A manual dispatch of Images from main is checking that next.

Observed after the merges of #340 and #341 (2026-11-23, from the run records): - [Images run 5236](https://git.rkdr.net/Mortis/Kamino/actions/runs/5236) (push of the #341 merge) published molecule-ubuntu2404 0.1.10, molecule-ubuntu2604 0.1.6 and ci 0.2.39, each with the `net.rkdr.mortis.inputs-sha256` label. It finished at 22:22:10. - [Renovate run 5238](https://git.rkdr.net/Mortis/Kamino/actions/runs/5238) (event `workflow_run`) started at 22:22:11 and ran live. - The pin PRs #342, #343 and #344 opened at 22:22:26–31: about 20 seconds after the Images run finished, and at most about 6 minutes after the run's first image push. - The `workflow_run` after the failed [run 5229](https://git.rkdr.net/Mortis/Kamino/actions/runs/5229) was [skipped (run 5231)](https://git.rkdr.net/Mortis/Kamino/actions/runs/5231), as the success guard intends. Against the proposal of 15 minutes for "the pin PR exists within N minutes of the image push", this is well inside it. The number itself is the maintainer's. Still open: a run whose inputs are unchanged building nothing. A manual dispatch of Images from `main` is checking that next.
Author
Owner

Confirmed: a run with unchanged inputs publishes nothing.

  • Images run 5249 (manual dispatch on main) succeeded. Each of the three jobs logged "Inputs of mortis/ are unchanged since its newest version: nothing to publish." and skipped the build. Each job took 13–20 s once it had a runner. The newest tags are still 0.1.10, 0.1.6 and 0.2.39.
  • Renovate run 5270 was started by that run's workflow_run event in the same second it completed. It ran live and opened no pull request.

Acceptance status:

  • Criteria 1–3 are shown by #340, Images run 5236 with pin PRs #342–#344, and the runs above.
  • The automerge criterion depends on the branch-protection setting from #210 point 1, not on this change.
  • The minutes figure in the open proposal is the maintainer's to set.

Assisted-by: Claude Code

Confirmed: a run with unchanged inputs publishes nothing. - Images run [5249](https://git.rkdr.net/Mortis/Kamino/actions/runs/5249) (manual dispatch on `main`) succeeded. Each of the three jobs logged "Inputs of mortis/<name> are unchanged since its newest version: nothing to publish." and skipped the build. Each job took 13–20 s once it had a runner. The newest tags are still 0.1.10, 0.1.6 and 0.2.39. - Renovate run [5270](https://git.rkdr.net/Mortis/Kamino/actions/runs/5270) was started by that run's `workflow_run` event in the same second it completed. It ran live and opened no pull request. Acceptance status: - Criteria 1–3 are shown by #340, Images run 5236 with pin PRs #342–#344, and the runs above. - The automerge criterion depends on the branch-protection setting from #210 point 1, not on this change. - The minutes figure in the open proposal is the maintainer's to set. Assisted-by: Claude Code
Author
Owner

Decision (maintainer): the pin PR exists within 15 minutes of the image push. Observed: about 15 seconds (Images run 5236 → pin PRs #342–#344).

Assisted-by: Claude Code

Decision (maintainer): the pin PR exists within **15 minutes** of the image push. Observed: about 15 seconds (Images run 5236 → pin PRs #342–#344). Assisted-by: Claude Code
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#165