Skip to content

fix(release): the Service image a release pins is published before main pins it, so Argo CD never rolls the roadmap Service onto a missing image #1451

Closed

Description

@dan-petty

Problem

k8s/devops/kustomization.yaml pins ghcr.io/dan-petty/devops-cli/service with newTag: vX.Y.Z, and the release cut bumps it on the release branch. Argo CD's devops application tracks main (path k8s/overlays/homelab/devops, which only includes k8s/devops) and reconciles every 120 s. The image itself is published only by release.yml on the merge to main, after devops release check. For v0.2.28 the release run took from 23:43:28 to 23:50:20.

So for several minutes after every release merge, main pins an image that does not exist yet. The roadmap Service's Deployment uses strategy: Recreate, because its home volume is ReadWriteOnce, so the running pod is stopped before the new one is created. That pod then backs off on the missing image, and the CronJob that uses the same image fails too. If the release run fails, as it did for v0.2.27 and as every automatic cut does today (companion changelog item), the outage lasts until a person fixes the release.

Proposed remedy

Make the image a release pins exist before main pins it, so a merge can only deploy a published image. The design chooses one of:

  • publish service:vX.Y.Z from release/vX.Y.Z on every push once the branch holds version X.Y.Z, so the merged tree's image already exists;
  • an Argo CD sync gate that waits for the image;
  • a required check on the release pull request that builds and pushes the image;
  • pinning by digest.

Weigh tag mutability, the cluster's imagePullPolicy: IfNotPresent, provenance attestation, and GitOps (the cluster is git).

Key questions

  • Which mechanism? Proposed: publish from the release branch, because it is the smallest change to release.yml, keeps Argo CD and the manifests as they are, and needs no new cluster component. The design phase decides on evidence.
  • Is release.yml's merge-time build still needed? Proposed: it re-tags or verifies the image the release branch published for the merged commit, so latest and the attestation stay right.

Acceptance criteria

  • After the change, the image main pins for a release exists in GHCR before the release pull request can merge, shown by a workflow test or a check on the release pull request.
  • The roadmap Service never runs a pod whose image tag is unpublished during a release, documented in k8s/README.md and RELEASE_CYCLE.md.
  • actionlint passes, uv run devops ci passes, and any logic in Python is tested offline.

Related: #741, #753, #1283, #1260, #1360.

Opened as a borrow (#1153, budget/borrowed): a bug that takes the roadmap Service down on every release, placed in v0.2.29 by the owner on 2026-10-08.

Update 2026-10-08: delivered scope

Mechanism. The image is published from the release branch, which is the remedy the issue proposed. release.yml also runs on pushes to release/v*.

On a push to release/vX.Y.Z that holds X.Y.Z, the run builds, smoke-tests and scans service:vX.Y.Z, pushes it by digest, attests it and then tags it. It does this when the image's inputs changed, or when the tag's image has no release.yml provenance. The inputs are Dockerfile, .dockerignore, pyproject.toml, uv.lock, src and release.yml, hashed with git ls-tree into the label io.github.dan-petty.devops-cli.image-inputs.

  • It does nothing before the cut, on a superseded commit, or once main holds the version.
  • It fails when main has image changes the branch lacks (git merge-tree). The fix is a chore/open-vX.Y.Z-main pull request into the branch, merged with a merge commit. It also fails when the branch tip can't be read.
  • Right before tagging, it checks the branch tip and main again. A release merged during the build keeps the image main pins, and the run fails instead of moving the tag.

On main, release.yml points latest at that image once gh attestation verify passes. The check accepts only release.yml signing on main or on the release branch. release.yml never replaces service:vX.Y.Z: when the merged tree has other inputs, it warns and the difference ships in the next release. It builds the image only when no image has the tag.

ci.yml. Service Image no longer builds this repository's release pull request, which saves about 36 runner-minutes per release (measured on v0.2.28).

Acceptance criteria:

  • Criterion 1: shown by the 'Build & Publish Service Image' check on the release PR's head commit. Also by tests/test_release_service_image_plan.py, whose 25 offline cases run the plan and tag steps verbatim, and by the release.yml invariants in tests/test_ci.py.
  • Criterion 2: documented in k8s/README.md ('When a release merges into main', step 3) and RELEASE_CYCLE.md. docs/ROUTINE_TASKS.md follows.
  • Criterion 3: actionlint and uv run devops ci pass.

Pending a person, on the first real run (the v0.2.29 cut and merge):

  • gh attestation verify ... --signer-workflow dan-petty/devops-cli/.github/workflows/release.yml --source-ref refs/heads/release/v0.2.29 passes.
  • A later branch push that leaves the inputs alone logs was built and attested from these inputs already.
  • latest and v0.2.29 share one digest.
  • devops argo cd apps status devops is Synced and Healthy, with no ImagePullBackOff.

Not in scope:

Activity

  1. added this to the v0.2.29 milestone on Oct 8, 2026
  2. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.29 by the owner on 2026-10-08: without this fix the roadmap Service is not updated by the v0.2.29 release, and goes down instead. Please keep it in v0.2.29.

  3. added
    type/bug
    scope/k8s
    scope/ci
    scope/release
    source/agent
    on Oct 8, 2026
  4. removed this from the v0.2.29 milestone on Oct 8, 2026
  5. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: only a critical fix joins the current release at intake; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. Recurring outage on every release of a homelab service, but limited blast radius and a manual workaround (fix the release run) exist.
    • Value: High. Every release currently takes the roadmap Service and its CronJob offline for minutes or longer, directly harming the project's own delivery pipeline.
    • Effort: Medium. The smallest proposed fix (publish the image from the release branch in release.yml) touches one workflow and a verification step, but requires weighing tag mutability, attestation, and GitOps constraints.
  6. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Owner decision, 2026-10-08: v0.2.29 waits for this item. The roadmap Service (still on v0.2.28, which lacks #1349) moved it to the backlog at intake. It is placed back in v0.2.29 when its pull request is ready to merge, and the v0.2.29 release pull request merges only after it and the changelog collection have landed on release/v0.2.29.

  7. added this to the v0.2.29 milestone on Oct 8, 2026
  8. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1452, merged into release/v0.2.29 as 345bf4d.

    Closes #1451

    10 file(s) changed.

    How it was verified

    Check runs at 5116495:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1451-image-before-main-pins-it.md:

    • The image main pins for a release exists in GHCR before the release pull request can merge, shown by a check on the release pull request and by workflow tests. Each push to release/vX.Y.Z that holds X.Y.Z runs Build & Publish Service Image on the release pull request's head commit, and devops pr check-readiness blocks a merge while that check is pending or failed. tests/test_release_service_image_plan.py runs the plan step verbatim under bash in a real git repository with a bare origin, with only docker, gh and, for an unreachable remote, git ls-remote faked on PATH. For the plan it covers before the cut, the cut, a push that leaves the inputs alone, an image release.yml did not attest, a fix after the cut, a superseded run, an unreadable branch tip, main with image changes the branch lacks and with other commits, a re-run after the merge, main with matching inputs, the release merge, a later push and a recovering push with other inputs, an image main's own run built, an unattested image on main, main with no image, and a GHCR read error. It runs the tag step verbatim too: the branch tip, main with latest, a release merged during the build, a run superseded during the build, and an unreadable branch tip. test_service_image_release_job_invariants (tests/test_ci.py) pins the triggers, the job and step gates, the step order (plan, build, smoke, scan, push, attest, tag), the push by digest with no tags, the promote step, and shell: bash on the plan and tag steps. test_release_service_image_inputs_are_what_the_image_is_built_from (tests/test_architectural_invariants.py) keeps SERVICE_IMAGE_INPUTS in step with the Dockerfile.
    • The roadmap Service never runs a pod whose image tag is unpublished during a release, documented in k8s/README.md ("When a release merges into main", step 3) and RELEASE_CYCLE.md (diagram, Step 3 item 2, critical-fix item 3, Step 5 item 5). docs/ROUTINE_TASKS.md follows.
    • actionlint passes on release.yml and ci.yml, and uv run devops ci passes. The plan's logic is bash in the workflow, tested offline: no test reaches the network or a registry, and each call phase is under 1 s.
    • changelog.d/1451.md exists, and CHANGELOG.md and docs/ROADMAP.md are untouched.
    • Pending a person: after the v0.2.29 cut pushes release/v0.2.29, run gh run list -R dan-petty/devops-cli --workflow release.yml --branch release/v0.2.29 --limit 3 and open the newest run. Build & Publish Service Image shows the plan's publish, then the push by digest, the attestation and the tag step. Then docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/service:v0.2.29 --format '{{ .Manifest.Digest }} {{ index .Image.Config.Labels "io.github.dan-petty.devops-cli.image-inputs" }}' prints a digest and a 64-character hash, and gh attestation verify oci://ghcr.io/dan-petty/devops-cli/service:v0.2.29 -R dan-petty/devops-cli --signer-workflow dan-petty/devops-cli/.github/workflows/release.yml --source-ref refs/heads/release/v0.2.29 passes. The next push to release/v0.2.29 that leaves the image's inputs alone, such as the changelog.d/ collection, logs was built and attested from these inputs already in its plan step, which shows gh attestation verify works with the job's token.
    • Pending a person: after the v0.2.29 release pull request merges, the main run's plan step logs promote within seconds, and docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/service:latest --format '{{ .Manifest.Digest }}' prints the same digest as service:v0.2.29. devops argo cd apps status devops is Synced and Healthy, and kubectl -n devops rollout status deploy/roadmap-service --timeout=300s succeeds with no ImagePullBackOff in kubectl -n devops get pods -l app.kubernetes.io/name=roadmap-service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/ciscope/k8sscope/releasesource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions