Skip to content

fix(generate): pass built-in changelog to manage-release by file to avoid E2BIG - #640

Merged
joshua-temple merged 3 commits into
mainfrom
fix/manage-release-changelog-e2big
Jul 19, 2026
Merged

fix(generate): pass built-in changelog to manage-release by file to avoid E2BIG#640
joshua-temple merged 3 commits into
mainfrom
fix/manage-release-changelog-e2big

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

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.

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 new changelog_file action input, which the action hands straight to the already-existing cascade 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 (same cascade generate-changelog call, redirected to a file).

Why not regenerate inside manage-release from previous_tag..sha: in promote, the manage-release sha for prerelease/publish is the release environment's SHA, which differs from the changelog head (the source SHA), so regenerating from sha would 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

  • New unit tests prove the built-in release, promote, and orchestrate-finalize paths pass the changelog by file and no longer place content on an input (red before, green after).
  • A CLI regression exercises a 200KB --changelog-file read.
  • A new e2e scenario runs the file-reference path through orchestrate and publish.
  • Byte-identical baseline goldens regenerated; the only change is the changelog wiring.
  • go build ./..., go test ./... (3645 pass), go test ./... -race, golangci-lint run ./... all clean, plus the e2e module builds and vets clean.
  • Docs updated (generated-workflows reference) and a code-quality standard added to CONTRIBUTING.md.

…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>
@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown
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>
@joshua-temple
joshua-temple merged commit 04a1238 into main Jul 19, 2026
21 checks passed
@joshua-temple
joshua-temple deleted the fix/manage-release-changelog-e2big branch July 19, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant