Repository navigation
www: request only the count files a run publishes, and survive a 5xx - #219
Conversation
Every Vercel deploy, production included, has been failing while prerendering: a request for a count file that does not exist (registry-* publishes no process count, build no count at all) came back from GitHub Pages as a 503 rather than a 404, and `cachedGet` threw on it. Fix at the source: `loadFixture` reads the run's manifest shard, which every caller already fetches, and requests only the count files it lists. The shard is passed to `loadScenario` as an option and fetched there when a caller has not. Make fetches robust too: `fetchRetrying` retries a 5xx twice with a short backoff, and a 5xx that outlasts the retries is returned from the cache like a 404 rather than thrown, so `probe` can treat optional data as missing (with a server-side warning) while required data (the index, a shard) still throws its `DataFetchError` and fails the build loudly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|
Reviewed and merging: this is the fix for every Vercel deploy failing since 2026-11-18 (production included), and this PR's own Vercel build passes.
One trade-off to know about (not new code, but its effect changes): benchmark result files are also read through 🤖 Generated with Claude Code |
Problem
Every Vercel deploy of the site, production included (main at 6146dbc, 2026-11-18 05:58; also #217 and #218), fails while prerendering:
Root cause
Two things combined:
loadFixture(apps/www/src/lib/load.ts) fetched a package-count and a process-count file for every (fixture, variation) it rendered, and relied on a 404 to say "none". Butregistry-*variations publish no process count andbuildpublishes no count at all (docs/METHODOLOGY.md). Eight requests per build were for files that are not there.cachedGet(apps/www/src/lib/data.ts) treated a 404 as missing but threw on anything else — and that throw is inside"use cache", so the prerender fails the page on it even though the only caller (probe) catches it. One 503 on an optional file fails the whole build.Fix
loadFixturenow reads the run's manifest shard (manifest/{date}.json, theDirectoryEntryevery caller already fetches) and requests only the count files itspackageCounts/processCountslist.loadScenariotakes the shard as anentryoption;report.tsandabout/components.tsxpass the one they have, and it is fetched when a caller does not. No special-casing ofregistryorbuildanywhere — the shard is the authority, as METHODOLOGY's "Discover, never enumerate" asks.fetchRetryingretries a 5xx up to two more times with a short backoff (250 ms, 500 ms), alongside the existing 429 handling.cachedGetlike a 404 (not thrown inside the cache);DataClientturns it into aDataFetchError.probe— which wraps every fetch a page can render without (count files,versions.json, summaries, chart-data) — reports it as missing and logs a server-sideconsole.warn. Data a page cannot render without (the index, a run's shard) is never probed, so itsDataFetchErrorstill throws and a real outage still fails the build instead of publishing an empty site.apps/www/test/report.test.ts: the trend-budget test now excludes the shown run's shard from the files it counts as the trend's (it is the shown run's, like its files and summary).Tests
New
apps/www/test/data.test.ts(mockedfetch):fetchRetryingretries a 5xx and returns the answer that follows; gives up after three attempts on a persistent 5xx; does not retry a 404.dataClient(): a persistent 503 on probed data isfailedwith one warning; a 404 isabsentwith no warning; a 503 ongetIndex()(required) rejects withDataFetchErrorafter its retries.loadScenariowith a shard listing package counts but no process counts forregistry-clean, and nothing forbuild: no process-count request forregistry-clean, no count request at all forbuild, both where the shard lists both, and the shard is fetched when the caller did not pass it.Verification
vlt installat the root (changedvlt-lock.json, not committed);vlr format:check,vlr lint:check,vlr typecheckclean at the root;cd apps/www && vlr test: 13 files, 277 tests pass.next buildagainsthttps://benchmarks-data.vlt.iowith everyfetchlogged (a--required preload appending status + URL),.next/cache/fetch-cachecleared before each run so nothing was served from the build cache. Five runs on this branch: all 40 pages generated every time, every request a 200, zero 404s or 5xx; two exited 0 (the other three were stopped after page generation by Next's unrelated "known security vulnerability" upgrade notice, which fires on alternate runs and is not acted on here).origin/mainthe same way: all 40 pages, 126×200 and 8×404 (it happened to get 404s rather than 503s this time, which is the flip described above).Requested URLs, before minus after — exactly the eight files that do not exist, and nothing added:
The 18 count files still requested are the ones the shard lists:
{astro,babylon,large,next,svelte,vue}-clean-{package,process}-count.jsonand*-registry-clean-package-count.json.Not changed
loadTrend's per-fixture package-count fallback for a run without a summary still relies on 404s — but every one of the 399 published dates has a summary, so that path never runs in production; left alone to keep this focused.🤖 Generated with Claude Code
Summary by CodeRabbit