Skip to content

ci: single-writer guards on the pnpm-store and next-build caches #888

Closed

Description

@athvin

Problem

The 10 GB Actions cache budget is full with sccache out of it — probed
2026-11-08:

active_caches_size_in_bytes: 10,387,544,511   # 73 entries

Roughly 2.3 GB of that is PR branches writing entries main already owns,
because three actions/cache call sites have no save-if and so save from any
ref:

key entries bytes writers
pnpm-store-* 4 ~1.58 GB frontend.yml x2 call sites, frontend-experiments.yml
next-build-* 4 ~0.74 GB frontend.yml, frontend-experiments.yml

rust.yml already enforces the pattern this wants — "lint is the SINGLE
WRITER of shared-key: rust, and only from main", with the other compile jobs
save-if: false. The frontend caches never got the same treatment.

Fix

One writer per key, and only from main; every other call site restore-only.
PR branches keep reading main's entry through the existing restore-keys
prefix, which is where nearly all the value is.

Why now

It is a prerequisite for #887 (moving sccache back onto this budget) and it
lowers the peak hourly usage that the raised limit will be billed against. It is
also correct independently of #887: a PR branch writing a shared cache entry is
the eviction pressure that #887's own history documents.

Correction

An earlier revision of this body listed v2-rust-coverage (~1.6 GB, 2 entries)
as a fourth writer. It is not one — coverage is
schedule/workflow_dispatch-only, so no pull request can write its entries,
and the two entries are rust-cache's ordinary key-churn. Whether a nightly job
should hold 1.6 GB of a shared budget is a real question, but it belongs to
#887's measurement phase rather than here.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions