Skip to content

ci: one reader for the pinned Playwright version, validated once #462

Closed

Description

@sydevs-bot

Summary

Three CI jobs write the pinned Playwright version into GITHUB_OUTPUT, and that value is the one
Chromium cache key all three share since #459. They read it two ways, at two levels of care: the
gate job validates it as exact semver before writing it, because a step output is repository
text and a newline inside one forges further outputs on a fork's pull request; the browser lane and
the warm job write an unvalidated command substitution. So the hardening the gate's own ⚠
documents is absent from the two jobs beside it, and one key is decided by two sources.

Approach

Line numbers as of #461, which this follows.

Three readers today:

  • .github/workflows/ci.yml:92–102 — the gate's. Reads devDependencies.playwright out of
    package.json, checks /^[0-9]+\.[0-9]+\.[0-9]+$/, then appends version=….
  • .github/workflows/ci.yml:198–200 — the browser lane's. echo "version=$(node -p "require('@playwright/test/package.json').version")", no check.
  • .github/workflows/browser-cache.yml:42–44 — the warm job's, identical to the lane's.

Replace all three with one reader they call. Two shapes, pick one:

  • A script, scripts/playwright-version.mjs, printing version=<pinned> to stdout and
    throwing on anything that is not exact semver, with each step as
    run: node scripts/playwright-version.mjs >> "$GITHUB_OUTPUT". It is testable in the unit lane,
    and scripts/AGENTS.md plus docs/testing.md § "A spec that inventories src/" hold the
    conventions a new scripts/**/*.mjs takes (⚠ the new URL(…, import.meta.url) ban, and a
    co-located spec).
  • A composite action, .github/actions/playwright-chromium/action.yml, owning the version
    read, the cache key, the path and the install, with a save input the warm job alone passes.
    This also removes the four-step read → restore → install block's third copy, and makes a key
    that disagrees with its payload structurally impossible rather than pinned after the fact. The
    repo already consumes a composite action (ci.yml:40). ⚠ docs/rules/deployment.md requires
    every third-party action pinned by SHA and scripts/ci-workflows.test.ts fails on a tag; a
    local action is neither, so that spec needs a rule for it.

Either way, scripts/ci-workflows.test.ts:422–426 (keys on a version both Playwright pins agree on) and the versionRead helper at :373 exist only because there are two readers: delete both
once there is one, and pin instead that every job reads the version through it.

⚠ Keep the gate's validation and its reason — it is the only thing standing between a fork's
package.json and a forged step output. Whichever shape wins carries that ⚠ comment.

Acceptance criteria

  • One reader produces the Playwright version every job's cache key is built from. No job reads
    it a second way.
  • That reader refuses a version that is not exact semver, and the refusal is tested.
  • The three jobs' cache keys still resolve to the same string, so one warmed entry serves both
    consumers.
  • scripts/ci-workflows.test.ts pins the single reader and drops the two-pin equality
    assertion, which has nothing left to decide.

Verification checklist

  • pnpm test:run scripts/ci-workflows.test.ts
  • .claude/skills/pr-prep/check.sh
  • Read the pull request's own Lint, Typecheck & Build and Browser lane logs: both
    Chromium steps must report a cache hit, which proves the keys still agree.
  • With the reader called directly, a package.json whose playwright pin is ^1.65.1 must
    make it exit non-zero rather than print a key fragment.

Notes

  • Found while implementing ci(gate): the gate job's Chromium cache is written where nothing can read it #459, which made one cache key depend on two of these readers. The
    equality pin there closes the key's half; this closes the hardening asymmetry and removes the
    pin.
  • The composite-action shape also answers a second finding from that run: read → restore →
    install → deps now exists three times across two files, with three comment blocks explaining one
    mechanism.

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
    • 23:13Z implement · attempt 1 · session · done
    • 23:13Z implement · attempt 1 · session
    • 21:28Z implement · attempt 1 · session · done
    • 21:28Z 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. sydevs-bot commented on Nov 22, 2026

    @sydevs-bot
    ContributorAuthor

    Handing this back. It cannot be built on main yet, because its anchors are #461's and #461 is open.

    Three criteria are unsatisfiable against b6d27ed:

    Building it anyway would rewrite the same lines of ci.yml, browser-cache.yml and ci-workflows.test.ts that #461 rewrites. That duplicates an open PR and conflicts with it.

    Re-run @sydevs-bot implement once #461 merges. No edit to this ticket is needed.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

  8. removed
    bot:working
    on Nov 22, 2026
  9. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 22, 2026
  10. Ardnived commented on Nov 22, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

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