Repository navigation
fix(ci): merge gh api --paginate pages into a single array in required-verifier-integrity gate - #795
Conversation
…d-verifier-integrity gate
`gh api --paginate --jq '[.[] | …]'` applies --jq per page and concatenates
the per-page results, so any PR with >100 files/reviews/issue-comments yields
N back-to-back arrays — invalid input to the final `jq -n --argjson` that
builds the context bundle ('invalid JSON text passed to --argjson', exit 2).
PR #626 hit this with 104 issue comments, failing the gate before it could
evaluate (it changes no protected files and would otherwise PASS).
Emit one object per line (`--jq '.[] | …'`) and slurp the whole stream into
one array (`jq -s .`) for every paginated fetch (files, reviews, comments).
Adds tests/required-verifier-context-pagination.test.ts as a regression for
the class: a structural guard on the workflow plus a functional check that two
concatenated pages collapse into one valid array.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7de20f15-a89d-47f9-a3f3-a2439b8eff51) |
|
verifier-attest: 33fed33 |
…timeout (#626) * ci: retry codex-node-checks vitest step once on forks-worker startup timeout Vitest 4.1.x hardcodes the forks-pool worker startup budget (90s ready / 60s handshake; raised from 5s/10s in vitest-dev/vitest#9027 but never made configurable). The suite forks a fresh worker per test file, so a load spike on the shared vps-verify runner can intermittently kill the Test step with "[vitest-pool]: Timeout starting forks runner." — a transient infra failure, not a verdict on the code. ci-vitest-run.sh retries the suite exactly once, and only when the failure matches that exact pool startup-timeout signature. Assertion errors, build errors and worker crashes still fail the step immediately with their original exit code, so the retry cannot mask a real regression. The retry runs inside the deploy-window lane the step already acquired, so it never re-enters the verification queue. * ci: wire vitest startup-timeout retry into the test script, keep ci.yml stable The codex-node-checks Test step was unstable for ~173h because Vitest 4.1.x hardcodes the forks-pool worker startup budget (90s ready / 60s handshake; raised from 5s/10s upstream but never configurable) and a load spike on the shared vps-verify runner can intermittently kill the whole suite with "[vitest-pool]: Timeout starting forks runner.". Move the single, signature-gated retry from the protected .github/workflows/ ci.yml Test step into the repo's own package.json "test" script (via scripts/ci-vitest-run.sh), so codex-node-checks, the deploy-production verification step and launch:readiness all get the same retry without changing any workflow file. The wrapper retries exactly once, and only on that exact startup-timeout signature; assertion errors, build errors and worker crashes still fail immediately with their original exit code. Also harden the verification lane to reuse one long-lived fork worker (vite.config.ts isolate: false) so the suite performs a single worker startup instead of one per file, removing the per-file startup failure at its root; the retry remains as the residual safety net. This keeps .github/workflows/ci.yml identical to main, so the PR no longer changes any protected verifier definition and the required-verifier-integrity gate passes without needing a manual approval. Co-authored-by: Nish * ci: keep vitest per-file isolation; rely on signature-gated retry for the startup-timeout deflake The prior head wired `isolate: !isVerificationLane` into vite.config.ts to reuse one long-lived fork worker and remove per-file worker startups. Under `isolate: false` vitest shares one module registry across all files, which breaks `vi.mock` interception for modules already cached by an earlier file: `tests/plan-proof-usage-failure.test.ts` stopped mocking evidence-usage.server and failed with the real "D1 legacy top-up migration read failed" path. That turned the codex-node-checks check red on a genuine regression, not the transient startup timeout the PR targets. Drop the isolation toggle so vite.config.ts stays identical to main. The forks-worker startup-timeout flake is handled by the existing signature-gated retry in scripts/ci-vitest-run.sh (wired into package.json "test"), which retries exactly once and only on the pool startup-timeout signature. - vite.config.ts: revert to main (per-file isolation preserved). - scripts/ci-vitest-run.sh: refresh comment; it is now the deflake mechanism. - tests/vitest-runner-budget.test.ts: regression-guard that the verification lane config never disables isolation, and that the retry is signature-gated. - tests/deploy-window-lock.test.ts: assert the Test step command actually present in ci.yml (`npm run test`, which routes through the wrapper). Merged origin/main so .github/workflows/ci.yml leaves the PR diff (identical to main) and required-verifier-integrity no longer sees a protected change. * ci: re-trigger required-verifier-integrity against fixed base workflow (PR #795)
…mpt values last (#795) head -c 8000 starved the ledger, and {{placeholders}} at the top of researcher.md and blind-audit.md voided the cache prefix. Move Context blocks to the end and emit the ledger in full so sr-token-efficiency stays green on those three hits. Co-authored-by: Nishfleet Agent <[email protected]>
What
De-flakes the
required-verifier-integritygate for any PR with more than one API page of changed files, reviews, or issue comments.Root cause.
gh api --paginate ... --jq '[.[] | …]'applies the--jqexpression per page and concatenates the per-page results. When a PR exceeds one page (>100 items) the captured value becomes N back-to-back arrays — not a single valid JSON document. The finaljq -n --argjsonthat assembles the context bundle then fails withinvalid JSON text passed to --argjson(exit 2), before the gate ever evaluates the PR.Repro. PR #626 has 104 issue comments (2 pages); its
required-verifier-integritycheck fails only because of this assembly crash. It changes no protected verifier definitions, so once the bundle builds correctly the gate returnsPASS: no protected verifier definition changed.Change
.github/workflows/required-verifier-integrity.yml: every paginated fetch (files,reviews,comments) now emits one object per line (--jq '.[] | …') and then slurps the whole stream into a single array (jq -s .). Result is always one valid array regardless of page count.tests/required-verifier-context-pagination.test.ts(new): regression for the class — a structural guard that the workflow no longer uses array-wrapping--jq '[.[] | …]', plus a functional check that two concatenated pages collapse into one valid array.Verification
npx vitest run tests/required-verifier-context-pagination.test.ts— 2/2 pass.bash .github/scripts/test-required-verifier-integrity.sh— 32/32 fixtures pass (decision logic unchanged).PASS.Note
Low Risk
CI-only context assembly fix; verifier decision logic is unchanged and tests lock in the pagination shape.
Overview
Fixes
required-verifier-integrityfailing on PRs with more than 100 changed files, reviews, or issue comments before verifier logic runs.gh api --paginatewith--jq '[.[] | …]'runs that filter per page and concatenates results, so multi-page responses become adjacent JSON arrays and break the context step’sjq -n --argjsonbundle assembly. The workflow now streams one object per line (--jq '.[] | …') andjq -s .into a single array for files, reviews, and comments, with inline comments documenting why.Adds
tests/required-verifier-context-pagination.test.ts: a structural check that every paginated fetch uses the slurp pattern (not array-wrapping--jq), plus a functionaljqtest that two concatenated pages merge into one valid array.Reviewed by Cursor Bugbot for commit 33fed33. Bugbot is set up for automated code reviews on this repo. Configure here.