Repository navigation
fix(ci): make the performance benchmark actually run, and fail loudly if it does not (#987) - #995
Merged
Merged
Conversation
… if it does not (#987) The job has reported success while producing nothing since roughly the Expo 55->56 upgrade. The comment it left on #990 was an empty code block. Three things had to be wrong for that: 1. No --config, so deno's config discovery walked out of packages/supabase into apps/ui-storybook-native/tsconfig.json and refused its `"jsx": "react-native"`. continue-on-error swallowed the exit code, and the `>` redirect still created an empty benchmark-results.txt — so the artifact and the comment were empty rather than missing, which is why nobody noticed. Any deno invocation from this repo without --config hits it; reproduced with a throwaway file in /tmp. 2. functions/api/__tests__/setup.ts:305 read `url.searchParams` after #932 replaced `new URL()` with `new URLSearchParams()` named `params`. completeMagicLinkAuth's "missing token or type" branch would have thrown a ReferenceError instead of logging and returning null. 3. It could not finish in the time the job had. Measured: 389s at the file's defaults, 180s with fewer requests per iteration — barely better, because Deno.bench keeps sampling until it is confident and simply took more samples — and 83s once the sample count itself is bounded with `n`. All four knobs are env-overridable; CI takes the bounded set, local runs keep the larger defaults. timeout-minutes 10 -> 15, since 83s is on an M4 Pro and the job also pays for checkout, install and `supabase start`. continue-on-error stays on the measurement: a slow benchmark should not block a PR. But "it ran and was slow" and "it never ran" are different states and only the first deserves to be quiet, so a new step fails the job when the results file is empty or missing. Verified with CI's env against a real stack: exit 0, 83s, 54 lines, all five summary rows carrying real figures. Not fixed here, and worth seeing before trusting the output: there are no tRPC benchmarks at all (all five are REST, so the rest-vs-trpc name has no other half), the run logs 30 auth 500s from the magic-link fixture, and the summary's "2.6 s" is one iteration of 20 requests rather than a per-request time. Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
📊 Performance Benchmark Results |
thinkclay
added a commit
that referenced
this pull request
Oct 6, 2026
…nto a PR comment (#997) #995 made the benchmark produce real figures, and the first comment it posted wrapped every one of them in raw escape codes: ^[[0m^[[38;5;245mREST: GET /v1/jobs: ^[[0m → Average response time: 84.36ms deno bench colourises even when stdout is a pipe, and benchmark-results.txt is pasted verbatim into the comment body. NO_COLOR=1 fixes it at the source, so the artifact is clean too. Verified locally with CI's env: 0 escape sequences in the output, summary rows unchanged. Co-authored-by: Claude Opus 5 <[email protected]>
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.
Closes #987.
The
Performance Benchmarksjob has been reporting success while producing nothing since roughly the Expo 55→56 upgrade. The comment it left on #990 — merged an hour ago — was literally this:Three separate things had to be wrong for that to be the outcome, and all three are fixed here.
1. deno was reading a tsconfig from a different app
The bench ran with no
--config, so deno's config discovery walked out ofpackages/supabaseand landed on a sibling:"jsx": "react-native"is correct for React Native and unsupported by deno.continue-on-error: trueswallowed the exit code, and the>redirect still created an emptybenchmark-results.txt— so the artifact and the comment were empty rather than absent, which is exactly why nobody noticed.Worth knowing beyond this job: any
denoinvocation from this repo without an explicit--confighits it. I reproduced it with a throwaway file in/tmp.2. A real
ReferenceErrorin a shared test fixtureWith the config fixed, the bench still would not compile:
Not a config artifact. #932 replaced
new URL()withnew URLSearchParams()namedparamsand left this line reading a binding that no longer exists — socompleteMagicLinkAuth's "missing token or type" branch, which is meant to log and returnnull, would have thrown instead. Fixed to[...params.keys()].3. It could not have finished inside the job timeout
This is the part #987 did not anticipate, and it took three measurements to get right:
n: 3)The middle row is the interesting one: cutting requests per iteration barely helped, because
Deno.benchkeeps sampling until it is statistically confident — it just took more samples. The knob that actually bounds total work isn, which is now set on all five benchmarks and env-overridable like the rest. Local runs keep the larger defaults; CI gets the bounded set.timeout-minutesalso goes 10 → 15. 83s is on an M4 Pro, and the job pays for checkout, pnpm install, the Supabase CLI andsupabase startout of the same budget.Silence is no longer an option
continue-on-error: truestays on the measurement — a slow benchmark should not block a PR. But "it ran and was slow" and "it never ran" are different states, and only the first deserves to be quiet, so a new step fails the job whenbenchmark-results.txtis empty or missing. That is the specific hole that let this last for months.Verification
Run with exactly the env CI now uses, against a real local stack:
Real figures where there were none.
biome lintanddeno fmt --checkclean on both touched files (they are deno-fmt style, not biome-formatted —biome checkwould rewrite them wholesale, so don't),pnpm prepushgreen.What I did not fix, and you should see before trusting these numbers
Making the benchmark run is what this PR does. Making its output worth reading is a different job, and three things stand in the way:
Deno.benchcalls and every one isREST:.rest-vs-trpc.bench.tsdescribes a comparison that either was never written or left with tRPC's retirement. The "vs" has no other half.isAuthError,status: 500,unexpected_failure) from the magic-link fixture, so some measurements are timing failure paths rather than the endpoint.So: this job will now produce numbers instead of an empty code block, and will shout if it ever stops. Whether it deserves ~4 minutes of CI on every
packages/supabasePR is a judgement I would rather leave with you than quietly settle — #987's option 3 (delete the job) is still defensible, and if you want that instead, this PR is a clean revert.🤖 Generated with Claude Code