Run fork PRs through visual regression; drop the manual CSS-hash baseline - #215
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
How to review
Focus on
.github/workflows/ci.yml:detect-css-changejob: builds base + PR CSS, compares hashes, sets the Chromatic trigger.chromaticjob: 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 thecheck:css-hash/update:css-hashnpm scripts.Before requesting review
npm run lint,npm run format, andnpm testpass locallyNotes for reviewers
No changeset: this is CI tooling and docs only, nothing in the published package changes (AGENTS.md public-artifact rule).