From ad1b844c1015be90ed8d1a96541f47fd85e8c29b Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Tue, 8 Sep 2026 15:24:59 -0700 Subject: [PATCH 1/2] ci(chromatic): rebaseline main on lockfile bumps The root lockfile matches neither `lib/**` nor `docs/stories/**`, so an in-range bump of a rendering dependency changed the stories with no Chromatic build on the PR or on main. The next PR touching `lib/**` then diffed against a stale baseline and wore the dependency's pixel change as its own. Push trigger only, so the cost is one run per lockfile merge rather than a full run on every dependency PR. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GD8aAjqaoKVbWGwYdQ3BYZ --- .github/workflows/chromatic.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 09e5b4f6..c1073e32 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -7,6 +7,14 @@ on: paths: - 'lib/**' - 'docs/stories/**' + # The lockfile is the root's, so an in-range bump of a rendering dependency + # reaches the stories while matching neither glob above. Here it refreshes + # the baseline against the commit that moved the dependency, so the pixel + # change is attributed there rather than surfacing inside the next + # unrelated `lib/**` PR and being accepted as that PR's. Deliberately not + # on `pull_request`: a dependency change is global, so TurboSnap cannot + # narrow it and every dependency PR would bill a full run. + - 'pnpm-lock.yaml' pull_request: types: [opened, synchronize, reopened, ready_for_review] paths: From aa297b5d6b91271da8f67c31d4a7134cad46d637 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Tue, 8 Sep 2026 15:38:41 -0700 Subject: [PATCH 2/2] ci(chromatic): add a manual rebaseline and cover the aliased packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two gaps of the same shape as the lockfile one, from review of #597. Nothing fires on this PR's own merge: a commit touching only `.github/workflows/chromatic.yml` matches no push glob, and there was no dispatch, so the fix could not reach the bumps already on main. Adds `workflow_dispatch`. `lib/.storybook/main.ts` aliases `dor`, `remote-lib-common`, and `dor-lib-common` to source, so they sit in the story dependency graph the same way `lib/src` does — 20, 45, and 2 importing files in `lib/src` respectively — while matching neither glob. Push-only, like the lockfile: measured against 60 days of main, they add 2 builds, since they nearly always change alongside `lib/**`. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GD8aAjqaoKVbWGwYdQ3BYZ --- .github/workflows/chromatic.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index c1073e32..f5487a9a 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -15,11 +15,23 @@ on: # on `pull_request`: a dependency change is global, so TurboSnap cannot # narrow it and every dependency PR would bill a full run. - 'pnpm-lock.yaml' + # `lib/.storybook/main.ts` aliases these three to source, putting them in the + # story dependency graph exactly as `lib/src` is: `Wall` reaches all three, + # and `PocketWall.stories.tsx` imports `remote-lib-common` directly. Push-only + # for the reason above; they nearly always change alongside `lib/**`, so the + # marginal build count is close to zero. + - 'dor/**' + - 'remote-lib-common/**' + - 'dor-lib-common/**' pull_request: types: [opened, synchronize, reopened, ready_for_review] paths: - 'lib/**' - 'docs/stories/**' + # Manual rebaseline. No glob catches every rendering input, and a commit editing + # these globs — this file — matches none of them, so without a dispatch the only + # way to refresh main's baseline is to wait for an unrelated qualifying commit. + workflow_dispatch: permissions: contents: read