fix(ci): stream release file contents to jq via --rawfile#107
Merged
Conversation
The signed-release script was building the GraphQL fileChanges array by piping the running JSON through `jq --arg c "$CONTENT"` once per file, where `$CONTENT` was the base64-encoded body of that file. As soon as a single file's base64 form exceeded Linux's per-argument ARG_MAX (~128 KB) — which `pnpm-lock.yaml` does on its own — jq died with `Argument list too long` and the entire release step exited 126. Spill each file's base64 into a temp file and pass it via `jq --rawfile c <file>` instead of `--arg c <string>`. Accumulate the JSON arrays directly in the additions/deletions temp files (in-place via `mv`) so we never round-trip a multi-megabyte blob through a shell variable. Stage 3 already consumed those files via `--slurpfile`; it now just reuses them rather than receiving them through `$ADDITIONS` / `$DELETIONS` indirection. The EXIT trap is hoisted up so the new content tempfile is cleaned even on failure paths. The previous fix in 742d06e addressed only the GraphQL-payload assembly; this addresses the per-file accumulation that runs before it.
`packages/remotion-video` was deleted from the workspace some time ago (neither `packages/` nor `pnpm-workspace.yaml` reference it anymore), but its importer entry and ~1180 lines of transitive deps (Remotion 4.0.290 plus its esbuild platform binaries) were still pinned in `pnpm-lock.yaml`. `pnpm install --frozen-lockfile` accepts that state, so CI never noticed; a plain `pnpm install` regenerates this exact diff every time. Pure prune — no version bumps, no new packages.
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.
Summary
Release run 25061014445 died at
lerna-signed-release.sh:192withjq: Argument list too long. The per-file loop passed each file's base64 body throughjq --arg c "$CONTENT";pnpm-lock.yamlalone is ~885 KB encoded, ~6.7× Linux's per-argumentARG_MAX. The previous slurpfile fix (742d06e) only covered Stage 3's payload assembly.Commits
fix(ci): stream release file contents to jq via --rawfile— spill each file's base64 to a temp file and read it via--rawfile; accumulate the additions/deletions arrays in temp files in-place. Stage 3 already consumed those files via--slurpfile. EXIT trap covers all four temp files.chore(deps): prune removed remotion-video workspace from lockfile— incidental cleanup.packages/remotion-videowas deleted long ago but ~1180 lines of stale entries remained inpnpm-lock.yaml;--frozen-lockfiletolerated it, plainpnpm installregenerates the prune.Test plan
--dry-runagainst the same 3-package, 7-file changeset the failing CI run produced — additions array builds without error, tree-SHA round-trip matches.mainis the only end-to-end signal; dry-run exits before the GraphQL mutation. Body shape unchanged from before.