Skip to content

fix: degrade version PR body when it exceeds GitHub's 65536-char limit#129

Merged
theoephraim merged 2 commits into
mainfrom
claude/stoic-joliot-0c2fea
Jun 23, 2026
Merged

fix: degrade version PR body when it exceeds GitHub's 65536-char limit#129
theoephraim merged 2 commits into
mainfrom
claude/stoic-joliot-0c2fea

Conversation

@theoephraim

Copy link
Copy Markdown
Member

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:

pull request create failed: GraphQL: Body is too long (maximum is 65536 characters) (createPullRequest)

Seen in the wild: https://github.com/Saeris/markdown/actions/runs/28017025913/job/82923786153

Fix

formatVersionPrBody now 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):

  1. Full body — inline per-change summaries (unchanged behavior).
  2. Compact — drops the per-change summaries but keeps the full version-bump list and diff links, with a banner pointing to the Files changed tab and each package's CHANGELOG.md.
  3. Hard truncate — last resort for an enormous number of packages, with a truncation notice.

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.ts covering all three tiers (under limit, large summaries → compact, thousands of packages → hard truncate). formatVersionPrBody is now exported for testing.

Full suite: 357 pass, 0 fail. Lint + format clean.

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

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @varlock/bumpy 1.15.1 → 1.15.2

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim merged commit e738734 into main Jun 23, 2026
5 checks passed
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