Repository navigation
fix(ci): skip the benchmark PR comment on forks, so fork PRs stop going red (#986) - #990
Merged
Merged
Conversation
…ng red (#986) A pull request from a fork gets a read-only GITHUB_TOKEN regardless of the `permissions: pull-requests: write` at the top of the workflow, so `github.rest.issues.createComment` throws "Resource not accessible by integration". With no guard and no continue-on-error that took the whole benchmark job down, and with it REST API Tests — every fork PR red for a step that only posts a comment. #972 surfaced it: a four-line SQL seed from an outside contributor, its own Run API Tests green, workflow red. Step outcomes for the same job on a fork (#972) and a same-repo branch (#973) differ in exactly one place, the comment step. Skipped rather than tolerated. continue-on-error would also stop it failing the build, but silently, and a step that cannot work on forks should say so. Upload Benchmark Results keeps the figures either way. Swept the other workflows for the same shape and this was the only one: dependabot-automerge is pull_request_target (base-repo token), apple-secret-rotate is workflow_dispatch, codecov already carries fail_ci_if_error: false and posts through its own app, and the lighthouse action is label-triggered with no githubToken. Verified the expression against both context shapes GitHub will supply: runs for a same-repo PR, skips for a fork. This branch is same-repo, so its own run exercises only the runs path; the skip path gets its real test on the next fork contribution, and the step being skipped is the one that was failing. Does not touch #987 — the benchmark this posts has never produced any output, which needs its own decision. Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
📊 Performance Benchmark Results |
thinkclay
added a commit
that referenced
this pull request
Oct 6, 2026
… if it does not (#987) (#995) 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]>
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 #986.
One
if:on one step.Why
A pull request from a fork gets a read-only
GITHUB_TOKENregardless of thepermissions: pull-requests: writeat the top of the workflow. Sogithub.rest.issues.createCommentthrowsand, with no guard and no
continue-on-error, takes the wholebenchmarkjob — and thereforeREST API Tests— down with it. Every fork PR has been showing red for a step that only posts a comment.#972 is the case that surfaced it: a four-line SQL seed from an outside contributor,
Run API Testsgreen, workflow red. Step-level outcomes for the same job, fork versus same-repo:Exactly one step differs.
Skipped, not tolerated
continue-on-error: truewould also stop it failing the build, but silently, and a step that is expected to be impossible on forks should say so. The numbers are preserved either way byUpload Benchmark Results, which runs unguarded.The rest of #986's acceptance
Swept, and this was the only one:
api-tests.yml:370— the step fixed here, the sole unguardedGITHUB_TOKENwrite.dependabot-automerge.yml—pull_request_target, which runs with the base repo's token and full permissions, so the fork restriction does not apply.apple-secret-rotate.yml—workflow_dispatchonly, never PR-triggered.codecov/codecov-action@v7in the same workflow — alreadyfail_ci_if_error: false, and it posts through the Codecov app rather thanGITHUB_TOKEN.treosh/lighthouse-ci-action@v12—pull_request: types: [labeled],uploadArtifacts: true, nogithubTokenpassed, so it posts nothing.Verification
The workflow parses and the step is intact:
And the expression evaluated against both context shapes GitHub will hand it:
pnpm prepushgreen.What this cannot prove from inside this repo is the fork case itself — this PR is a same-repo branch, so its own run exercises the
RUNSpath. TheSKIPSpath gets its real test on the next fork contribution, and the failing step is the one being skipped, so the downside of being wrong is the status quo.Not fixed here
#987 — the benchmark this step tries to post has never produced any output.
deno benchdies onapps/ui-storybook-native/tsconfig.json("jsx": "react-native", unsupported by deno),continue-on-error: trueswallows it, and the comment posted to #973 was an empty code block. Fixing the guard stops fork PRs going red; it does not make the benchmark real. Deliberately separate: this is a one-line CI correctness fix, that one needs a decision about whether the job should exist.🤖 Generated with Claude Code