Conversation
Two Vercel projects build from this repo, so every push builds both. Most pushes cannot change one of them: #521, #534 and #536 each touched only `.stories.tsx` / `.storybook/` files and still rebuilt the whole Next.js app, and #534 did it for a single-file change. `ignoreCommand` in vercel.json points both projects at one script, which routes changed paths to the bundles that can see them. vercel.json is shared, so each project names itself with a VERCEL_IGNORE_SCOPE environment variable; a project without one builds every push exactly as it does today. It skips only what it can prove is unnecessary. Unrecognised paths count as affecting both bundles, so adding a directory never silently stops building it. The diff base is the project's last deployed commit rather than HEAD^ — Vercel builds only the head commit of a push, so HEAD^ sees the final commit alone and would skip a build whose earlier commits did change the bundle, leaving a stale preview on a PR under review. Where that SHA is missing, it builds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsUkHcqFckbNcdiVxunhrg
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @alukach's task in 3m 5s —— View job ✅ No blocking issues — safe to merge. Traced Two edge cases worth watching, neither a bug in this PR and neither blocking:
Docs Diff is CI/build-gating only — no user-facing flow from docs.source.coop and no shared decision from data.source.coop's 💰 Estimated review cost: $0.56 · 3m05s · 24 turns |
Why
Chasing the Vercel cost bump that starts around Aug 16. Build CPU Minutes were $3.81 of the $17.54 peak day (Aug 24), and a large share of those minutes were spent building bundles the diff could not change.
Two Vercel projects build from this repo — the app and the Storybook published at ui.source.coop — and
vercel.jsononly disables git deploys formain, so every push to every branch builds both. From the Storybook work in late August:.storybook/main.ts+ 3.stories.tsx.storybook/preview.tsx(one file).stories.tsxThat landed the same week PR volume peaked (8 PRs on Aug 24, 15 on Aug 28).
What
ignoreCommandinvercel.jsonpoints both projects atscripts/vercel-ignore-build.sh, which routes changed paths to the bundles that can actually see them.vercel.jsonis shared by both projects, so each names itself with aVERCEL_IGNORE_SCOPEvariable in its own Vercel project settings.It skips only what it can prove is unnecessary:
VERCEL_IGNORE_SCOPEbuilds every push, exactly as today.HEAD^. Vercel builds only the head commit of a push, soHEAD^sees the final commit alone — on a multi-commit push whose last commit is story-only it would skip a build whose earlier commits did change the bundle, leaving a stale preview on a PR under review. Where that SHA is missing or unresolvable, it builds.Deploying
This does nothing until both projects get their variable — that is deliberate, since the safe default is to build:
source-cooperative→VERCEL_IGNORE_SCOPE=appVERCEL_IGNORE_SCOPE=storybookTesting
bash scripts/vercel-ignore-build.sh --self-test— 13 routing cases, including story-only, route-only, component+story, docs-only, lockfile,public/, an unrecognised path, and an unknown scope.shellcheckis clean.Also exercised end-to-end against real commits in a scratch branch: a story-only push skips the app build and runs Storybook's; the inverse for a route-only push; a bogus or absent previous-deployment SHA builds. The multi-commit case above was a real defect caught by that test, not a hypothetical — a
HEAD^fallback skipped a build it should have run, which is why the fallback is gone.Docs
No UI change, so there are no stories to link. Checked both external repos: this touches build gating only, so nothing in
docs.source.coopusing-source/orabout-source/describes it, and it moves no decision shared with the data proxy — thedata.source.coopADRs on authorization, STS credentials, API keys and federation are untouched.CONTRIBUTING.mdgains a "Skipped builds" section, and the comment inui-deploy.yamlcalling PR previews "free" is corrected — they cost build minutes, which is how this went unnoticed.Not in scope
Three other cost findings from the same investigation, to follow separately: a missing
sitemap.xmlthatrobots.tsadvertises, an uncachedfeed.xmlthat scans every public product per request, andimages.remotePatternsset tohostname: "*".🤖 Generated with Claude Code
https://claude.ai/code/session_01RsUkHcqFckbNcdiVxunhrg