fix(ci): trim GitHub commit API response in upload_benchmarks to avoid E2BIG on large merge commits - #25077
Merged
Conversation
…d E2BIG on large merge commits
`ci3/upload_benchmarks` passes the whole `GET /repos/.../commits/{sha}` response to jq via
`--argjson info "$commit_info"`. That endpoint returns a `files[]` array with every changed file's
patch, so for a merge-queue commit merging a large PR the response is large (353KB for #25056's
merge commit) — past Linux's 128KB per-argv-element cap (`MAX_ARG_STRLEN`), which makes execve
fail with E2BIG. The shell reports:
./ci3/upload_benchmarks: line 49: /usr/bin/jq: Argument list too long
##[error]Process completed with exit code 126.
The bench-upload step then fails the ci check and the PR is dequeued from the merge queue. The
regression hits any PR big enough for its merge commit's API response to exceed ~128KB — merge-train
PRs first, but any full-CI-mode run on a comparably large PR too.
The sibling jq call in `append_and_push()` already avoids this by passing large inputs via
`--slurpfile` (with a comment spelling out the 128KB cap); this call site was missed.
Fix: pipe the API response through `jq -c '{commit, author, committer, html_url}'` before assigning
to $commit_info. That's the exact set of top-level fields the downstream jq reads (via
`$info.commit.*`, `$info.author.login`, `$info.committer.login`, `$info.html_url`), so output is
byte-identical for normal commits and stays well below the argv limit for large ones.
Whitelist-shape rather than `del(.files, .stats)` blacklist: guaranteed bounded regardless of what
GitHub adds to the response later.
nchamo
marked this pull request as ready for review
August 1, 2026 13:46
The top-level trim still carried commit.verification.payload (repeats the full message; 92% of the 128KB argv cap observed on a real next commit), so a long merge-train message could re-trigger E2BIG. Whitelist the exact leaf fields, cut the message to its first line at the source, and pass the result to jq as a file so nothing large can reach argv at all. Adds a regression test that serves an oversized API response through a fake curl; it fails against both the original script and the top-level trim, and exercises the previously untested API-success path.
Contributor
|
Pushed bd7df55 to finish this off. The top-level trim was correct but still argv-bound: the retained
Verified red/green: the test fails with |
charlielye
approved these changes
Aug 3, 2026
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
Aug 5, 2026
BEGIN_COMMIT_OVERRIDE fix(pxe): validate a BoundedVec against its storage array on deserialization (AztecProtocol#25035) chore: add disclaimers on poc contracts (AztecProtocol#24975) chore: begin nr constant cleanup (AztecProtocol#25014) fix(txe): authorize sync_state utility calls in inlined contexts (AztecProtocol#25034) refactor(stdlib): a function's return type is a single optional AbiType (AztecProtocol#25066) feat(pxe): hash-pinned node read cache (AztecProtocol#24969) feat(noir-projects): publish compiled protocol artifacts to npm (AztecProtocol#25075) fix(ci): trim GitHub commit API response in upload_benchmarks to avoid E2BIG on large merge commits (AztecProtocol#25077) END_COMMIT_OVERRIDE
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.
What
ci3/upload_benchmarkspasses the wholeGET /repos/.../commits/{sha}response tojqvia--argjson info "$commit_info". That endpoint returns afiles[]array with every changed file's patch, so for a merge-queue commit merging a large PR the response is large — 353KB for #25056's merge commit — past Linux's 128KB per-argv-element cap (MAX_ARG_STRLEN), which makesexecvefail with E2BIG:The
Upload benchmarksstep has nocontinue-on-error, so this fails the requiredcicheck and the PR is dequeued from the merge queue. It hits any PR whose merge commit's API response exceeds ~128KB, on every merge-queue attempt and on anyci-fullrun.Observed on #25056, run 30681807033 (job
91320195476, 2026-08-01 04:03:07): step 9Upload benchmarksfails on the line above. #25056's three earlier merge-queue attempts on 2026-07-30 failed in step 6Run, before the upload step — this is the one confirmed occurrence so far, not a repeated one.Introduced by
1048a26e20(2026-07-20), which reachednexton 2026-07-30 as516cb5962b(#24806) — a fresh regression, not a chronic condition.Fix
Pipe the API response through
jq -c '{commit, author, committer, html_url}'before assigning to$commit_info. That's the exact set of top-level fields the downstreamjqreads — via$info.commit.{author,committer,message},$info.author.login,$info.committer.login,$info.html_url— so the output is byte-identical for normal commits and drops the 353KB case to 5.7KB. Whitelist-shape rather than adel(.files, .stats)blacklist, so it stays bounded regardless of what GitHub adds to the response later.Notes
jqcall inappend_and_push()already avoids this by passing large inputs via--slurpfile(with a comment spelling out the 128KB cap); this call site was missed.commitobject carriescommit.messagepluscommit.verification.payload, which repeats the message verbatim. Worst real case onnexttoday is67a22248a6, whose response trims from 1.34MB to 120,812 bytes — 92% of the 131,072-byte cap. A longer merge-train commit message would break it again. Moving the trimmed body to a temp file read with--slurpfile, asappend_and_push()does, would close this by construction.curl -sffailure → empty stdin →jqerrors → the pipe exits non-zero →if !triggers →commit_info='{}'(unchanged behavior).ci3/upload_benchmarks_teststill passes, but note it never exercises the API-success path (every case uses a fabricated sha, so curl 404s into the fallback) — it passes against the unfixed script too, so it does not guard this fix.Refs #25056.
Created by claudebox · group:
slackbot· requested by Nico Chamo · Slack thread