Repository navigation
Description
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 keyand groups the keys that start withindex-by their scope. - THEN The output holds exactly one key that starts with
index-service-1-, one that starts withindex-runner-1-and one that starts withindex-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.0and the same command forghcr.io/dan-petty/devops-cli/runner:v0.176.0and for the tagv0.175.0of 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.0andghcr.io/dan-petty/devops-cli/runner:v0.176.0with those ofv0.175.0, read withdocker 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 withgh cache list --ref refs/heads/main; the project's cache list shows each BuildKit index underindex-<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:309already 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
servicestage the apt upgrade layer isRUN apt-get update && apt-get upgrade -y(Dockerfile:220) and the project layer is theCOPY --from=builderstep after it (Dockerfile:222); therunnerstage has the same two steps (Dockerfile:138andDockerfile:140), anddocs/CLUSTER.md:68states 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 historyon 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-towritesmode=max(.github/workflows/release.yml:421, and the runner and mcp-server jobs), andtests/gate/tree_checks/image_cache.py:40fails an entry that lacks its target scope or itsmode=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.
Activity
devops-cli-service commentedon Nov 16, 2026
Both concern per-image cache scopes in CI; #4928 adds the scope fix, the candidate verifies the scopes and layer digests after two releases.devops-cli-service commentedon Nov 18, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
dan-petty commentedon Nov 19, 2026
#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.perf(ci): keep the image build cache in GHCR (#6530)