Skip to content

test(ci): verify per-image cache scopes after two releases #5942

Open

Description

@devops-cli-service

Split from #4928.

Problem: The workflow fix cannot show the GitHub cache indexes or the layer digests until after the merge. The cache list of main must hold one index for each scope service, runner and mcp-server. The second release must upload only the project layer and the apt upgrade layer for the Service and runner images. Why deferred: These checks wait on GitHub cache eviction and two releases. No pull request can run them offline. Acceptance criteria: After the merge, the cache list of main holds one index for scope service, one for scope runner and one for scope mcp-server. At the second release after the merge, the push of the Service and runner images uploads only the project layer and the apt upgrade layer. The dependency layers keep their digests from the release before.

Proposed design

Problem statement

#4928 gave each image build its own gha cache scope, but neither the cache indexes of main nor the layer reuse of the published images can be read offline, so no pull request can check them. #4928 is in v0.174.7, and v0.175.0 and v0.176.0 followed, so the main cache list must now hold one index for each scope service, runner and mcp-server, and the Service and runner pushes of v0.176.0 must upload only the project layer and the apt upgrade layer, with every dependency layer keeping the digest it had at v0.175.0.

Acceptance criteria

Requirement: One main cache index per image scope

The Actions cache of main SHALL hold exactly one BuildKit index for each scope service, runner and mcp-server after the merge of #4928.

Scenario: Main cache index list

  • WHEN A person runs gh cache list --ref refs/heads/main --json key and groups the keys that start with index- by their scope.
  • THEN The output holds exactly one key that starts with index-service-1-, one that starts with index-runner-1- and one that starts with index-mcp-server-1-, with no second key for any of the three scopes.

Requirement: Second release uploads only the project and apt upgrade layers

At the second release after the merge of #4928, the push of the Service image and the push of the runner image MUST upload only the project layer and the apt upgrade layer.

Scenario: Second release changed layers

  • WHEN A person runs docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/service:v0.176.0 and the same command for ghcr.io/dan-petty/devops-cli/runner:v0.176.0 and for the tag v0.175.0 of each image, and compares the layer digests that the commands print.
  • THEN Only two layers have a digest that v0.175.0 lacks: the apt upgrade layer (RUN apt-get update && apt-get upgrade -y) and the project layer (COPY --from=builder); no other layer is new.

Requirement: Dependency layer digests stay stable

The dependency layers of the Service image and the runner image SHALL keep the digests they held at the release before the second release.

Scenario: Dependency layer digests

  • WHEN A person compares the layer digests of ghcr.io/dan-petty/devops-cli/service:v0.176.0 and ghcr.io/dan-petty/devops-cli/runner:v0.176.0 with those of v0.175.0, read with docker buildx imagetools inspect <image>.
  • THEN Every layer before the apt upgrade layer has the same digest at v0.176.0 as at v0.175.0.

Existing Tool Considered

GitHub CLI (gh cache list --ref refs/heads/main) covers the cache index list, and Docker Buildx (docker buildx imagetools inspect <image>) covers the layer digests of a published image; both are open, maintained and already in use here (Dockerfile:54 installs gh, and .github/workflows/release.yml:309 runs docker buildx imagetools inspect). They lack the comparison of two releases and the mapping of a layer to a Dockerfile step, which the stage order supplies (Dockerfile:216-Dockerfile:223, Dockerfile:133-Dockerfile:141, docs/CLUSTER.md:68). No alternatives check has run.

Key questions

  • Which tool lists the GitHub Actions cache indexes for the main branch?: GitHub CLI, which the images install (Dockerfile:54), lists them with gh cache list --ref refs/heads/main; the project's cache list shows each BuildKit index under index-<scope>-1-... (openspec/changes/archive/2026-11-12-4646-stop-the-cache-export-of-pull/proposal.md:28). [sources: openspec/changes/archive/2026-11-12-4646-stop-the-cache-export-of-pull/proposal.md:28]
  • Which tool shows the layer digests of a published image?: Docker Buildx: docker buildx imagetools inspect <image> prints the manifest with its layers, and .github/workflows/release.yml:309 already runs the command with --format '{{json .Manifest}}'. [sources: .github/workflows/release.yml:309]
  • How does the check identify the project layer and the apt upgrade layer?: Compare the manifest of v0.176.0 with the manifest of v0.175.0 and name the changed layers by the stage order of the Dockerfile: in the final service stage the apt upgrade layer is RUN apt-get update && apt-get upgrade -y (Dockerfile:220) and the project layer is the COPY --from=builder step after it (Dockerfile:222); the runner stage has the same two steps (Dockerfile:138 and Dockerfile:140), and docs/CLUSTER.md:68 states that the stage adds only the apt upgrade and the project. (best practice) [sources: docs/CLUSTER.md:68]
    • Chosen: Compare the manifests of the two releases. It reads the published images, needs no local pull, and names the new layers from the stage order of the Dockerfile.
    • Rejected: Run docker history on a local image. It needs a local pull and shows the build history of the local image, not the manifest that the registry holds.
    • Rejected: Read the build log of the release run. The log can be truncated and shows the build steps, not the layers that the published image holds.
  • Which release is the second one after the merge of fix(ci): give each image build its own cache scope #4928?: fix(ci): give each image build its own cache scope #4928 is in v0.174.7 (CHANGELOG.md:38); v0.175.0 (CHANGELOG.md:24) and v0.176.0 (CHANGELOG.md:5) follow, and the manifest is at 0.176.0 (.release-please-manifest.json:2). The second release is v0.176.0 and the release before it is v0.175.0, so the wait for the two releases is over. [sources: CHANGELOG.md:38, CHANGELOG.md:24, CHANGELOG.md:5, .release-please-manifest.json:2]
  • Is the cache scope change of fix(ci): give each image build its own cache scope #4928 present at this commit?: Yes: each image build names its target scope and each cache-to writes mode=max (.github/workflows/release.yml:421, and the runner and mcp-server jobs), and tests/gate/tree_checks/image_cache.py:40 fails an entry that lacks its target scope or its mode=max. The remaining work is the live verification, not a code change. [sources: .github/workflows/release.yml:421, tests/gate/tree_checks/image_cache.py:40]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4928

Activity

  1. added
    type/test
    scope/ci
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 16, 2026
  2. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    ContributorAuthor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  4. dan-petty commented on Nov 19, 2026

    @dan-petty
    Owner

    #6404 moves the image build cache from the Actions cache (type=gha) to a registry ref (ghcr.io/dan-petty/devops-cli/<image>:buildcache). That changes the premise of this item. When #6404 merges, change the acceptance to the registry ref, or close this item as not planned.

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/lowpriority/p2-mediumscope/cisource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions