fix: degrade version PR body when it exceeds GitHub's 65536-char limit#129
Merged
Conversation
Releasing many packages (or packages with large change summaries) could
produce a PR body over GitHub's 65536-character limit, failing the release:
pull request create failed: GraphQL: Body is too long
(maximum is 65536 characters) (createPullRequest)
`formatVersionPrBody` now renders progressively smaller bodies:
1. Full body with inline change summaries (unchanged behavior).
2. If too long, drop the per-change summaries but keep the version-bump
list, with a banner pointing to the Files changed tab / CHANGELOGs.
3. If still too long, hard-truncate with a notice.
|
The changes in this PR will be included in the next version bump.
|
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
Cutting a release of many packages (e.g. 30) fails when the generated version PR body exceeds GitHub's hard limit of 65536 characters:
Seen in the wild: https://github.com/Saeris/markdown/actions/runs/28017025913/job/82923786153
Fix
formatVersionPrBodynow renders progressively smaller bodies and returns the most detailed one that fits under a safe threshold (64000 chars, leaving headroom since GitHub's char count and JS string length can differ for multi-byte chars):CHANGELOG.md.This covers every call site (PR create + edit, version-PR and channel-PR paths) since they all route through this one function.
Tests
Added
test/core/ci-version-pr-body.test.tscovering all three tiers (under limit, large summaries → compact, thousands of packages → hard truncate).formatVersionPrBodyis now exported for testing.Full suite: 357 pass, 0 fail. Lint + format clean.