Skip to content

ci(gate): the gate job's Chromium cache is written where nothing can read it #459

Closed

Description

@sydevs-bot

Summary

The gate job caches Chromium with actions/cache — restore and save — but ci.yml triggers
on pull_request and merge_group only. A cache saved on either ref is scoped to that ref, so no
gate run ever writes a key a later pull request or a merge-queue entry can read. The job pays a
~170 MB Chromium download plus a post-job cache upload on every first run of a pull request and on
every merge-queue entry, on the critical path of the one required check.

This is the same failure .github/workflows/browser-cache.yml's own header documents for the
browser lane, which was moved onto a main-warmed cache. The gate was never moved with it.

⚠ The comment at .github/workflows/ci.yml:84–86 states a saving this arrangement cannot
deliver — it counts a hit a merge-queue entry cannot get, because its ref is new per entry. That
prose is wrong today, whatever is decided below.

Approach

.github/workflows/ci.yml:104–110 is the gate job's cache and install pair.
.github/workflows/browser-cache.yml is the warm job that saves on each push to main, and
.github/workflows/ci.yml:198–212 is the browser lane reading it restore-only.

Two facts block a one-line fix, and both need settling before any edit.

  1. The keys differ. The gate keys on playwright-${{ runner.os }}-<version>
    (.github/workflows/ci.yml:107); the lane and the warm job key on
    playwright-chromium-${{ runner.os }}-<version> (ci.yml:203, browser-cache.yml:45). The
    ~/.cache/ms-playwright path is identical, so the warmed cache is one rename away from serving
    the gate — but a rename alone is not enough, because of (2).
  2. The payloads differ. scripts/check-a11y.mjs calls chromium.launch() with no channel,
    i.e. the headless shell build. browser-cache.yml:51 saves --no-shell, which is the full
    Chromium without the shell. Unifying the keys without also installing the shell in the warm job
    would hand the gate a cache it still has to download into.

So the work is: decide what the warm job saves, make the gate restore-only against that key, and
move the cache pins in scripts/ci-workflows.test.ts:310–319, which currently assert the lane
uses actions/cache/restore and saves nothing. A pin for the gate's half has to be added, or the
regression returns silently.

⚠ pnpm exec playwright install --with-deps chromium must keep running unconditionally in the
gate: --with-deps installs system libraries outside the cached directory, so a hit does not
cover them. The browser lane splits this into install on a miss and install-deps on a hit
(ci.yml:206–212); copy that shape rather than inventing one.

Open questions

What should the warm job save, so one cache serves both consumers?

  • A — save both builds on main (recommended). browser-cache.yml runs
    playwright install chromium as well as --no-shell, under one key, and both the gate and the
    lane restore it. Costs the warm job one extra download per Playwright bump; costs each consumer
    nothing, and leaves one key rather than two. Nothing on the critical path grows.
  • B — give the a11y gate an explicit channel: 'chromium', matching the lane, so the existing
    --no-shell cache serves it unchanged. One line in scripts/check-a11y.mjs, no warm-job
    change — but it changes what the accessibility gate actually drives, and
    docs/testing.md § "The accessibility lane needs a browser" records measurements taken against
    the current build. Those would need re-measuring, and scripts/check-a11y.test.ts may pin the
    launch.
  • C — keep two keys and add a second warm job step that saves the gate's key separately. No
    behaviour change to either consumer, at the cost of a second cache entry and a second thing to
    keep in step.

Recommend A: it leaves one key and one claim to keep true, and does not disturb a gate whose
behaviour is measured.

Acceptance criteria

  • No job in .github/workflows/ci.yml saves a Chromium cache. Both consumers restore only.
  • A merge-queue entry and a first pull-request run both restore Chromium from the cache
    browser-cache.yml saved on main, measured on a real run rather than inferred.
  • scripts/ci-workflows.test.ts pins the gate's half as it pins the lane's: restore-only, one
    key, one path, and the key agreeing with browser-cache.yml's.
  • .github/workflows/ci.yml:84–86's comment no longer claims a saving the arrangement
    cannot deliver.
  • The system-library install still runs on a cache hit, in both jobs.

Verification checklist

  • pnpm test:run scripts/ci-workflows.test.ts
  • .claude/skills/pr-prep/check.sh
  • pnpm test:a11y locally, to confirm the gate still drives a browser it has.
  • Read this pull request's own Lint, Typecheck & Build job log: the Chromium step must report
    a cache hit, and no post-job cache upload may appear. A green job that downloaded 170 MB is
    the failure mode.
  • Read a merge-queue entry's log for the same thing after it lands — that is the case this
    ticket exists for, and the only one a pull-request run cannot demonstrate.

Notes

  • Found while implementing ci(smoke): let a Dependabot run skip Smoke quietly #457, which dropped a dead id: browser-cache from this same step. The
    dead id was in that ticket's scope; this is not — it is a behaviour change across three files,
    and it turns on a decision.
  • No measurement of the download's wall-clock cost here is in hand. docs/testing.md records
    "a miss costs a download, never a failure" for the lane; the same holds for the gate, so this is
    cost, not correctness.

Activity

  1. added theissue type on Nov 22, 2026
  2. added
    proposal
    on Nov 22, 2026
  3. Ardnived commented on Nov 22, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  4. added
    bot:working
    and removed
    proposal
    on Nov 22, 2026
  5. sydevs-bot commented on Nov 22, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running
    approved by Ardnived

    recent dispatches
    • 20:20Z implement · attempt 1 · session · done
    • 20:20Z implement · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Nov 22, 2026
  7. removed
    bot:working
    on Nov 22, 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

    No labels
    No labels

    Type

    Fields

    Priority

    Low

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions