ci(chromatic): skip snapshots on docs-only changes + Dependabot PRs#85
Merged
Conversation
Cuts the snapshot quota burn on changes that cannot affect the visual output. Two filters added: 1. `paths-ignore` skips Chromatic when the only modified files are markdown, changelogs, changesets, or the auto-merge workflow. 2. Top-level `if: github.actor != 'dependabot[bot]'` skips Chromatic for Dependabot-authored PRs. The auto-merge workflow already covers low-risk dev-dep bumps; running Chromatic on every patch of vite/eslint/prettier/etc. spends ~67 snapshots per PR × 2 (PR + merge to main) without changing pixels. Major bumps still get a manual review, where the maintainer runs Chromatic locally if a visual check is warranted. TurboSnap stays off — the documented `pharos-tokens` CSS-from- node_modules problem is still real. Tracking issue for re-enabling TurboSnap once we cache the pharos-tokens content hash in a git-tracked file is filed separately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Testing pausedMonthly snapshot limit reached. Update your plan to get more snapshots and resume testing. |
Reverts the `if: github.actor != 'dependabot[bot]'` clause introduced in the previous commit. The path-based filter (`paths-ignore`) stays; that's pure quota cleanup with zero behaviour change for human PRs. Reason for the revert: the CTO would rather try TurboSnap first as the primary quota saver. With TurboSnap reading a content-hash `pharos-tokens` fingerprint (separate PR, in flight), a Dependabot bump that does not change the fingerprint will already skip every snapshot, and a bump that does change it still wants a visual check — skipping all Dependabot PRs unconditionally would mask the latter case. The two strategies aren't additive; pick TurboSnap and keep Dependabot in the pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Cuts Chromatic snapshot-quota burn on changes that cannot affect visual output. Two filters added to the existing workflow:
`paths-ignore` skips Chromatic when the only modified files are markdown, changelogs, changesets, the dependabot config, or the auto-merge workflow. None of these reach the published bundle or any story.
Top-level `if: github.actor != 'dependabot[bot]'` skips Chromatic on Dependabot-authored PRs. The auto-merge workflow already covers low-risk dev-dep bumps; running Chromatic on every patch of `vite` / `eslint` / `prettier` / etc. spends ~67 snapshots per PR × 2 (PR + merge to `main`) without ever changing pixels. Major bumps still get a manual review where the maintainer can run Chromatic locally if a visual check is warranted.
Why now
Free tier quota was exhausted this month. Without these filters every Dependabot patch bump (chromatic itself bumping 16.6 → 16.7 → 16.9 over a fortnight, plus vite, eslint, ts-eslint, jsdom, …) compounds the spend on changes whose visual impact is provably nil.
Branch filtering (`push: [main]` + `pull_request: [main]`) was already in place — feature branches without a PR do not consume quota. The concurrency cancel-in-progress was already in place too. These additions hit the remaining two leaks I could identify.
What this does not do
Does not enable TurboSnap. The documented pharos-tokens-CSS-from-`node_modules/` problem is still real: TurboSnap diffs against git tree, and `node_modules/` is not in it; pharos-tokens releases that change `dist/styles.css` content without touching any git-tracked file would still produce stale snapshots. Re-enabling TurboSnap is tracked separately — the path forward is caching the pharos-tokens content hash in a git-tracked file (e.g. `.pharos-tokens.fingerprint` updated via a postinstall script and added to Chromatic's `externals` glob).
Does not change the rebuild behaviour on real story changes. Every push to a human-authored PR or to `main` still rebuilds all stories, same as today.
Quality
Test plan
🤖 Generated with Claude Code