fix(generate): pass built-in changelog to manage-release by file to avoid E2BIG - #640
Merged
Merged
Conversation
…void E2BIG The generated manage-release composite action put the full release changelog on an Actions input, which GitHub exposes as an environment variable. Linux caps a single environment variable near 128KB (MAX_ARG_STRLEN), so a changelog above that fails the execve of the step's bash with E2BIG before the program runs. A real repository hit this once its accumulated built-in changelog reached about 135KB: the Manage Release step died and every downstream job cascaded. The built-in changelog window is bounded by design (base is the next env's current SHA, head is the source SHA), so the size is an inherent large-history case, not a windowing bug. The fix keeps the exact same content but stops routing it through an input: the Generate Changelog step writes the markdown to $RUNNER_TEMP/cascade-changelog.md and callers pass that path via a new changelog_file action input, which the action hands straight to cascade manage-release --changelog-file. Only a small fixed path transits the input; the content never touches the env or argv. This preserves byte-identical changelog output and works for same-job and cross-job SHA references. The custom-changelog reusable-workflow path runs on a separate runner and its output can only reach the finalize job as a cross-job workflow output, so it retains the content input as a documented residual. Adds unit coverage proving the built-in path no longer places changelog content on an input, a large-content regression on the CLI file read, and an e2e scenario exercising the file-reference path through orchestrate and publish. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Contributor
|
All PR Validation checks passed. |
…ference Regenerate cascade's own emitted workflows and manage-release action so the committed .github/ matches the generator after the changelog file-reference change. The built-in changelog now writes to $RUNNER_TEMP/cascade-changelog.md and the release/promote/orchestrate steps pass changelog_file instead of the changelog content, keeping large content off the env path. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
The built-in changelog no longer rides a $GITHUB_OUTPUT heredoc into a manage-release input; orchestrate and promote now write it to a file on the runner temp dir and pass the path via changelog_file. Update scenario 62 to assert the file-reference shape (the RUNNER_TEMP redirect and the changelog_file input) and lock the migration by forbidding the old heredoc and content-input forms. The PR-preview summary body heredoc is unchanged and its assertions stay as they were. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The generated
manage-releasecomposite action put the full release changelog on an Actions input, which GitHub exposes as an environment variable. Linux caps a single environment variable near 128KB (MAX_ARG_STRLEN), so a changelog above that fails theexecveof the step's bash withE2BIGbefore the program runs. A real repository hit this once its accumulated built-in changelog reached about 135KB: the Manage Release step died and every downstream job cascaded.Window finding
The built-in changelog window is bounded by design (base is the next environment's current SHA, head is the source SHA; root-commit fallback only on a first-ever deploy). The 135KB is an inherent large-history case, not a windowing bug, so the window is preserved rather than truncated (truncating would drop legitimately new entries).
Fix
Keep the exact same content but stop routing it through an input. The Generate Changelog step now writes the markdown to
$RUNNER_TEMP/cascade-changelog.md, and callers pass that path through a newchangelog_fileaction input, which the action hands straight to the already-existingcascade manage-release --changelog-file. Only a small fixed path transits the input; the content never touches the env or argv. The changelog output is byte-identical (samecascade generate-changelogcall, redirected to a file).Why not regenerate inside
manage-releasefromprevious_tag..sha: in promote, themanage-releaseshafor prerelease/publish is the release environment's SHA, which differs from the changelog head (the source SHA), so regenerating fromshawould change content. File reference preserves exact parity and works for both same-job (steps.X.outputs) and cross-job (needs.X.outputs) SHA references.The custom-changelog reusable-workflow path runs on a separate runner and its output can only reach the finalize job as a cross-job workflow output, so it retains the content input as a documented residual (it cannot be file-referenced without an artifact contract).
Verification
--changelog-fileread.go build ./...,go test ./...(3645 pass),go test ./... -race,golangci-lint run ./...all clean, plus thee2emodule builds and vets clean.CONTRIBUTING.md.