Skip to content

ci(release): push each image once, then verify and tag that digest #6407

Closed

Description

@dan-petty

Problem

The release builds the service, runner and mcp-server images two times: a load build that is smoked and scanned, and a second build that pushes. The second build runs the stages under no-cache-filters again (apt-get upgrade, install-tools), so it can push a digest that nobody scanned. Run 44415593173 scanned service 495393479143 but pushed 390801b6e0c0. The devcontainer flow (release.yml:152-311) already pushes once by digest, then smokes, attests and tags that digest.

Change

Owner decisions of 2026-11-19:

  • Build each image once, then smoke, scan, attest and tag that digest. This replaces the owner decision of 2026-10-23 that ci(image): move the image checks to one path-filtered workflow #1858 records (the publish job rebuilds from the cache).
  • Promote each image on its own. A failed verify of one image does not stop the others.
  • apt-get upgrade stays in the trixie images (service and mcp-server).

For service, runner and mcp-server, release.yml uses a 3-job flow with a matrix over the 3 images:

  1. Build job: one docker/build-push-action step with outputs push-by-digest=true,name-canonical=true,push=true, sbom: true and provenance mode=max. It takes labels from metadata-action with context: git, so the revision is the release-please sha. no-cache-filters: service, runner, and runner,mcp-server for MCP.
  2. Verify job: read-only (contents and packages read, no id-token). It pulls image@digest and runs the image-smoke action (ci(image): move the image checks to one path-filtered workflow #1858) and the image-scan action (ci(security): scan each image with one Trivy action and SARIF #6405).
  3. Attest-and-tag job: actions/attest (attest-build-provenance v4 is a wrapper), then docker buildx imagetools create, then a check that each tag resolves to the digest (as release.yml:307-310 does).

Delete the 3 'Build and Load' steps. Update RELEASE_CYCLE.md:59-66 (job names) and 72-75: to take an outside CVE fix, use 'Re-run all jobs', because a re-run of verify scans the same digest. Update the invariant tests that read the step names.

Renovate. The built-in github-actions manager updates actions/attest. No new pin.

Risk. A failed verify leaves an untagged digest in the public package. Image Updater reads only latest, so it ignores that digest. The retention job of #4816 deletes untagged digests older than 30 days. Two more jobs per image add runner start time and a pull of about 10-30 s. A CVE that is fixed outside the repository then ships only in the next build.

Proof

  • In the first release after the merge, the pushed 'exporting manifest' digest equals the digest that verify scanned and the digest that docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/<image>:<tag> returns.
  • The PR reports the job times against today's means of 284, 341 and 338 s.

Depends on: #6405, #1858

Proposed design

Problem statement

The release builds the service, runner and mcp-server images two times: a load build that it smokes and scans, and a second build that pushes. The second build runs the no-cache stages again (apt-get upgrade, install-tools), so it can push a digest that nobody scanned. Run 44415593173 scanned service 495393479143 but pushed 390801b6e0c0. The change builds each image once, pushes that build by digest, and then smokes, scans, attests and tags that digest, one image at a time.

Acceptance criteria

Requirement: One build per image

The release workflow SHALL build each of the service, runner and mcp-server images in one job, push that build by digest, and MUST NOT run a separate load build of an image that it pushes.

Scenario: The release run builds each image once

  • WHEN the first release after the merge runs uv run devops gh run view <run_id> --log for each image job
  • THEN the log of each image holds one exporting manifest digest and no Build and Load step, and the verify job pulls that digest.

Requirement: Three-job matrix over the images

The release workflow SHALL run the build, verify and attest-and-tag jobs for each image through one matrix that names service, runner and mcp-server.

Scenario: actionlint accepts the matrix

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the pull request
  • THEN the command exits 0 and reports no error on the matrix of .github/workflows/release.yml.

Requirement: Verify holds read-only permissions

The verify job MUST hold only contents: read and packages: read, and it MUST NOT request id-token.

Scenario: zizmor reports no excess permission

  • WHEN uv run devops ci --check --only zizmor runs on the pull request
  • THEN the command exits 0 and reports no excessive-permissions finding for the verify job in .github/workflows/release.yml.

Requirement: Attest then tag the digest

The attest-and-tag job SHALL attest the pushed digest with actions/attest and MUST create each release tag on that digest with docker buildx imagetools create.

Scenario: The tags name the attested digest

  • WHEN the first release after the merge runs uv run devops gh run view <run_id> --log and docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/<image>:<tag>
  • THEN the actions/attest step succeeds before the imagetools create step, and the inspect digest equals the digest that the build job exported, for the release tag and for latest.

Requirement: Tag check fails on another digest

The attest-and-tag job MUST fail when a tag does not resolve to the digest that the build job pushed.

Scenario: The tag check compares each digest

  • WHEN the first release after the merge runs uv run devops gh run view <run_id> --log for the attest-and-tag job
  • THEN the job's check step runs a test comparison of each tag's imagetools inspect digest with the build digest, and the job exits 1 when one differs.

Requirement: Each image promotes on its own

A failed verify of one image MUST NOT cancel the verify or the attest-and-tag job of the other images.

Scenario: The matrix keeps the other images

  • WHEN a release run has one failed verify job and uv run devops gh run view <run_id> --json jobs lists the jobs
  • THEN the verify and attest-and-tag jobs of the other images run to completion and the run reports a failure only for that image.

Existing Tool Considered

Open, maintained tools cover each step of the need. docker/build-push-action builds once and pushes by digest with push-by-digest=true,name-canonical=true (.github/workflows/release.yml:417-433). docker buildx imagetools create puts the tags on that digest and imagetools inspect checks them (.github/workflows/release.yml:293-311). actions/attest writes the provenance; the pinned actions/[email protected] is its wrapper (.github/workflows/release.yml:287, openspec/changes/archive/2026-11-12-4896-make-renovate-cover-every-pin-on/proposal.md:29). docker/metadata-action supplies the labels (.github/workflows/release.yml:348-362). None of them smokes or scans an image: .github/actions/ holds only devcontainer-image, devcontainer-smoke and setup-toolchain, so the smoke and scan come from the image-smoke action (#1858) and the image-scan action (#6405), which this issue waits on. The change builds no code of its own, so it has no build cost.

Key questions

  • Does the release build each image once or twice?: Once. The build job pushes by digest with outputs: type=image,name=...,push-by-digest=true,name-canonical=true,push=true, as the second build of .github/workflows/release.yml:417-433 already does, and the verify job pulls image@digest. The load build at .github/workflows/release.yml:364-374 goes, because its no-cache stages run again in the second build and can push a digest that nobody scanned. This replaces the owner decision of 2026-10-23 that the publish job rebuilds from the cache. (best practice) [sources: .github/workflows/release.yml:364-374, .github/workflows/release.yml:417-433, .github/workflows/release.yml:152-311]
    • Chosen: Build once and push by digest. The pushed digest is the scanned digest, so no unscanned image ships. The devcontainer flow already does this at .github/workflows/release.yml:152-311.
    • Rejected: Keep the load build and rebuild for push. The second build runs the no-cache stages again and can push a digest that nobody scanned. Run 44415593173 scanned 495393479143 but pushed 390801b6e0c0.
  • How does the workflow put the release tags on the scanned digest?: The attest-and-tag job runs actions/attest on the digest, then docker buildx imagetools create to put the release tag and latest on it, then a test that each tag's imagetools inspect digest equals the build digest, as the devcontainer job does at .github/workflows/release.yml:293-311 and the runner job at .github/workflows/release.yml:583-594. (best practice) [sources: .github/workflows/release.yml:293-311, .github/workflows/release.yml:583-594]
    • Chosen: Tag the digest with imagetools create. It tags the exact digest that verify scanned, with no rebuild.
    • Rejected: Rebuild and push each tag. A rebuild can produce a different digest and pushes an image that verify did not scan.
  • Does a failed verify of one image stop the other images?: No. The matrix sets fail-fast: false, as the sharded jobs of .github/workflows/ci.yml:149-153 and .github/workflows/service-image-test.yml:109-112 do, so each image's verify and attest-and-tag run to their end: one failed verify promotes no tag and cancels no other image. (best practice) [sources: .github/workflows/ci.yml:149-153, .github/workflows/service-image-test.yml:109-112]
    • Chosen: Set fail-fast: false. The owner decision of 2026-11-19 promotes each image on its own, and the sharded jobs of the repository already keep every shard to its end.
    • Rejected: Keep the default fail-fast: true. One failed verify would cancel the other images and delay their release.
  • Which labels set the revision of a pushed image?: docker/metadata-action with context: git. The build job checks out needs.release-please.outputs.sha (.github/workflows/release.yml:331-336), so the git context gives the revision the release-please sha; the default context: workflow would give the sha of the tag push. (best practice) [sources: .github/workflows/release.yml:331-336, .github/workflows/release.yml:348-362]
    • Chosen: context: git. The release-please sha is the commit that the release builds, so the label matches the release.
    • Rejected: The default context: workflow. The workflow sha is the commit of the tag push, not the release-please sha.
  • Which cache filters does each image build use?: no-cache-filters: service for the service image, no-cache-filters: runner for the runner image, and no-cache-filters: runner,mcp-server for the MCP image. The MCP stage builds FROM runner (Dockerfile:172), so its build also runs the runner stage's apt-get upgrade (Dockerfile:139); naming only mcp-server, as .github/workflows/release.yml:707 does today, lets that upgrade come from the MCP cache scope. (best practice) [sources: .github/workflows/release.yml:707]
    • Chosen: runner,mcp-server for the MCP image. The MCP image builds on the runner stage, so the runner stage's apt-get upgrade must run fresh as well as the mcp-server stage's kubectl and helm install.
    • Rejected: mcp-server only, as today. The runner stage of the MCP image would come from the mcp-server cache scope, so its apt-get upgrade could keep a package that a security update has since fixed.
    • Rejected: Set no filter. The stages that apt-get upgrade and install-tools change would come from cache and hide a new package.
  • Does the change add a new Renovate pin for actions/attest?: No. The shared preset .github/renovate/base.json:64-69 groups every github-actions action update, so the built-in github-actions manager updates actions/attest with no new custom rule. actions/attest-build-provenance is a wrapper that bumps actions/attest in its own action.yml (openspec/changes/archive/2026-11-12-4896-make-renovate-cover-every-pin-on/proposal.md:29). (best practice) [sources: .github/renovate/base.json:64-69, openspec/changes/archive/2026-11-12-4896-make-renovate-cover-every-pin-on/proposal.md:29]
    • Chosen: Rely on the built-in github-actions manager. The preset already groups and updates every action reference, so a second pin would duplicate it.
    • Rejected: Add a custom Renovate rule. It adds a rule that the built-in manager already covers.
  • How does a person take an outside CVE fix after a release?: Use 'Re-run all jobs'. The build job runs again and takes the current base image and apt packages, and verify scans the new digest; a re-run of the verify job alone pulls and scans the same digest, so the fix does not ship. RELEASE_CYCLE.md:70-75 holds the failure steps that the change rewrites. (best practice) [sources: RELEASE_CYCLE.md:70-75]
    • Chosen: Tell a person to use 'Re-run all jobs'. The build job runs again and takes the fixed base image, and verify scans the new digest.
    • Rejected: Tell a person to re-run the verify job. The verify job scans the same digest, so the new CVE fix does not ship.
  • Which tests read the release step names?: tests/invariants/test_runner_image.py (RUNNER_STEPS at 16-23 and the runner-image job at 92-98), tests/invariants/test_mcp_server_image.py (the mcp-server-image job at 71-83), tests/commands/test_ci.py (the service job step order at 840-910) and tests/invariants/test_workflow_contracts.py (the attest step of each job id at 306-318). tests/invariants/test_architectural_invariants.py reads no release.yml. The change updates these four to the matrix job ids and the new step names. [sources: tests/invariants/test_runner_image.py:16-23, tests/invariants/test_runner_image.py:92-98, tests/invariants/test_mcp_server_image.py:71-83, tests/commands/test_ci.py:840-910, tests/invariants/test_workflow_contracts.py:306-318]
  • Does the change clean up an untagged digest that a failed verify leaves?: No. A failed verify leaves a digest that no tag names. Image Updater moves only on latest (docs/CLUSTER.md:281), so that digest never reaches the cluster, and the release adds no cleanup step. The repository's one cleanup workflow deletes untagged digests of the devcontainer package only, older than one day (.github/workflows/cleanup-devcontainer.yml:91-100); the retention job of ci(cleanup): prune untagged GHCR images and old attestation tags #4816 is the place for the three release packages, and it is not in this repository yet. (best practice) [sources: docs/CLUSTER.md:281, .github/workflows/cleanup-devcontainer.yml:91-100]
  • Does apt-get upgrade stay in the trixie images?: Yes. The owner decision of 2026-11-19 keeps apt-get upgrade in the trixie stages runner (Dockerfile:139) and service (Dockerfile:221), and the no-cache filters keep those stages fresh, so a release still takes the Debian security updates (CHANGELOG.md:4508). (best practice) [sources: CHANGELOG.md:4508]
    • Chosen: Keep apt-get upgrade. The owner decision of 2026-11-19 keeps it in the trixie images, and the no-cache filter runs it on each build.
    • Rejected: Remove apt-get upgrade. It contradicts the owner decision of 2026-11-19 and would ship the base image's older packages.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6405, #1858

Alternatives check of 2026-11-19: not-applicable.
Class: ci, no search.
Tool: none found.

Activity

  1. added
    type/infra
    scope/release
    source/agent
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  5. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 20, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 21, 2026
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

    effort/mediumpriority/p2-mediumscope/releasesource/agenttype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions