[GH-ISSUE #8950] [Feature]: Stop pull requests writing the Docker build cache in container-build-test #8904

Closed
opened 2026-11-07 22:46:27 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8950

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

The container-build-test job in .github/workflows/pull-request-checks.yml runs docker/build-push-action with cache-to: type=gha,mode=max on every pull request. Each PR merge ref therefore writes its own full set of Docker layer blobs into the repository's GitHub Actions cache. A sample of the cache showed 8.15 GB of the 8.27 GB of Docker blobs belonging to three PR merge refs, while staging held 0.08 GB. The cache is at its 10 GB limit (actions/cache/usage reports 10.34 GB across 84 entries on 2026-11-07), so GitHub evicts the pnpm, Playwright and CodeQL entries that other jobs rely on, and PR Docker builds do not benefit from the blobs anyway because each is scoped to its own merge ref.

Proposed solution

Remove cache-to: type=gha,mode=max from the container-build-test build step and keep cache-from: type=gha. The workflow only runs on pull_request, so no conditional is needed. Add a one-line comment saying PRs read the cache that build-container.yml writes on staging pushes and never write it, to protect the Actions cache budget.

Scope: .github/workflows/pull-request-checks.yml, job container-build-test, only. build-container.yml (staging/main pushes) keeps writing the cache.

Verification: node scripts/validate-pr-triage.mjs passes; the PR's own run logs the cache import attempt (the first run may miss because staging holds almost no blobs yet); record actions/cache/usage before and a few days after merge.

Alternatives considered

  • Moving the Docker cache to GHCR (type=registry): sturdier, but the package must be public for fork PRs. Proposed as a follow-up only if the Actions cache is still over its limit after this change.
  • Leaving it as is: PR builds keep evicting the caches other jobs need.

Additional context

Part of the CI speed work; E2 (CodeQL incremental base database on staging pushes) depends on this landing because the base database needs cache room.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Nov 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8950 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? The `container-build-test` job in `.github/workflows/pull-request-checks.yml` runs `docker/build-push-action` with `cache-to: type=gha,mode=max` on every pull request. Each PR merge ref therefore writes its own full set of Docker layer blobs into the repository's GitHub Actions cache. A sample of the cache showed 8.15 GB of the 8.27 GB of Docker blobs belonging to three PR merge refs, while `staging` held 0.08 GB. The cache is at its 10 GB limit (`actions/cache/usage` reports 10.34 GB across 84 entries on 2026-11-07), so GitHub evicts the pnpm, Playwright and CodeQL entries that other jobs rely on, and PR Docker builds do not benefit from the blobs anyway because each is scoped to its own merge ref. ## Proposed solution Remove `cache-to: type=gha,mode=max` from the `container-build-test` build step and keep `cache-from: type=gha`. The workflow only runs on `pull_request`, so no conditional is needed. Add a one-line comment saying PRs read the cache that `build-container.yml` writes on `staging` pushes and never write it, to protect the Actions cache budget. Scope: `.github/workflows/pull-request-checks.yml`, job `container-build-test`, only. `build-container.yml` (staging/main pushes) keeps writing the cache. Verification: `node scripts/validate-pr-triage.mjs` passes; the PR's own run logs the cache import attempt (the first run may miss because `staging` holds almost no blobs yet); record `actions/cache/usage` before and a few days after merge. ## Alternatives considered - Moving the Docker cache to GHCR (`type=registry`): sturdier, but the package must be public for fork PRs. Proposed as a follow-up only if the Actions cache is still over its limit after this change. - Leaving it as is: PR builds keep evicting the caches other jobs need. ## Additional context Part of the CI speed work; E2 (CodeQL incremental base database on `staging` pushes) depends on this landing because the base database needs cache room. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-08 00:50:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8904
No description provided.