Skip to content

Run fork PRs through visual regression; drop the manual CSS-hash baseline - #215

Merged
abbybowman merged 2 commits into
mainfrom
chore/fork-vr-live-css-hash
Aug 30, 2026
Merged

Run fork PRs through visual regression; drop the manual CSS-hash baseline#215
abbybowman merged 2 commits into
mainfrom
chore/fork-vr-live-css-hash

Conversation

@abbybowman

Copy link
Copy Markdown
Contributor

What this PR does

External fork PRs could not run visual regression and had no way to resolve the resulting failed check. This enables approval-gated Chromatic on fork PRs and replaces the manually-refreshed CSS-hash baseline with a live base-vs-PR comparison, so no one hand-maintains a baseline anymore.

Type of change

  • Tooling or CI (no effect on published CSS)

How to review

Focus on .github/workflows/ci.yml:

  • detect-css-change job: builds base + PR CSS, compares hashes, sets the Chromatic trigger.
  • chromatic job: same-repo condition removed; the "DO NOT remove that Setting" comment documents the fork-approval safety gate.

Companion GitHub Setting (already enabled): Actions > General > Fork pull request workflows > "Require approval for all outside collaborators". This is the safety mechanism that gates fork code's access to the Chromatic token; the token can only upload snapshots (verified against Chromatic docs), so worst-case exposure is burned budget, resettable from the dashboard.

Deleted with no replacement needed: scripts/check-css-hash.sh, scripts/css-output-hash.txt, and the check:css-hash / update:css-hash npm scripts.

Before requesting review

  • npm run lint, npm run format, and npm test pass locally

Notes for reviewers

No changeset: this is CI tooling and docs only, nothing in the published package changes (AGENTS.md public-artifact rule).

Fork PRs can now run Chromatic. The job no longer requires a same-repo branch; approved fork runs get the token and run VR, gated by the repo Setting that requires maintainer approval for outside-collaborator fork workflows.

Replace the committed css-output-hash.txt baseline with a detect-css-change job that diffs freshly built base vs PR CSS. This removes the manual baseline refresh (which fork contributors could not perform and which generated a stream of "refresh CSS output hash" commits) and stays correct against a PR's merge-base even as main moves.
…udience

Correct the setup step from npm install to npm ci so a local build matches the lockfile and CI. Document the detect-css-change trigger and fold the contributor-facing visual-regression note into a "PR checks and visual regression" section.

Reorganize CONTRIBUTING.md so maintainer-only material stops interrupting the contributor flow: move the "Upgrading USWDS" runbook to ARCHITECTURE.md (beside the USWDS integrity gates it describes), leaving a one-line pointer.
@abbybowman
abbybowman merged commit 10943bc into main Aug 30, 2026
10 checks passed
@abbybowman
abbybowman deleted the chore/fork-vr-live-css-hash branch August 30, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant