Skip to content

Bugfix/release-body-limit#298

Merged
allohamora merged 2 commits into
masterfrom
bugfix/release-body-limit
Jul 7, 2026
Merged

Bugfix/release-body-limit#298
allohamora merged 2 commits into
masterfrom
bugfix/release-body-limit

Conversation

@allohamora

@allohamora allohamora commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Task

  • Add limit release notes size step

Summary by CodeRabbit

  • Bug Fixes

    • Added a safeguard so release notes stay within a manageable size.
    • When notes are too long, they’re automatically shortened and direct readers to the full changelog for the release.
  • Tests

    • Updated workflow tests to cover the new release-notes size limit step.

@allohamora allohamora requested a review from Copilot July 7, 2026 14:41
@github-actions github-actions Bot changed the title fix: add limit release notes size step Bugfix/release-body-limit Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@allohamora, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21e0b668-c4d3-4589-98f1-281a418722e1

📥 Commits

Reviewing files that changed from the base of the PR and between af595b2 and 0016e0c.

📒 Files selected for processing (4)
  • .github/workflows/release.yml
  • __tests__/unit/categories/js/release-workflow/preset/index.spec.ts
  • __tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts
  • src/categories/js/release-workflow/preset/default.preset.ts
📝 Walkthrough

Walkthrough

Adds a "Limit release notes size" step to the release workflow generation. After git-cliff generates release-notes.md, a character count check (excluding spaces) against a 125,000-character threshold triggers replacement of the file with a shortened message linking to CHANGELOG.md. Corresponding unit tests are updated.

Changes

Release Notes Size Limiting

Layer / File(s) Summary
Preset step implementation and generated workflow
src/categories/js/release-workflow/preset/default.preset.ts, .github/workflows/release.yml
Adds a "Limit release notes size" step after release notes generation that counts characters in release-notes.md and, if over MAX_CHARS (125000), overwrites it with a message linking to CHANGELOG.md.
Test expectations for new step
__tests__/unit/categories/js/release-workflow/preset/index.spec.ts, __tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts
Updates expected workflow YAML strings in unit tests to include the new step.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • allohamora/cli#271: Both PRs modify the src/categories/js/release-workflow preset/wiring, with this PR's new step applied on top of that structure.
  • allohamora/cli#275: Both PRs modify the GitHub release workflow's release notes/changelog generation via git-cliff.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the PR’s release notes size limit change, though it reads more like a branch name than a polished summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/release-body-limit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a safeguard to the release workflow so oversized generated release notes don’t exceed GitHub’s release body limit, preventing release creation failures.

Changes:

  • Add a “Limit release notes size” step that checks release-notes.md length and replaces it with a CHANGELOG link when it exceeds MAX_CHARS.
  • Apply the same step both to the shipped workflow (.github/workflows/release.yml) and the JS release-workflow preset generator.
  • Update unit tests to assert the new step is present in generated workflow/preset output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/categories/js/release-workflow/preset/default.preset.ts Adds the size-limiting step to the preset-generated release workflow content.
.github/workflows/release.yml Adds the size-limiting step to the repository’s actual release workflow.
__tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts Updates installer test fixture to include the new workflow step.
__tests__/unit/categories/js/release-workflow/preset/index.spec.ts Updates preset snapshot/expectations to include the new preset step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/categories/js/release-workflow/preset/default.preset.ts Outdated
Comment thread __tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts Outdated
Comment thread __tests__/unit/categories/js/release-workflow/preset/index.spec.ts Outdated
Comment thread .github/workflows/release.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

91-99: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Consider using env vars for the templated expressions to satisfy zizmor's template-injection hint.

${{ github.repository }} and ${{ steps.version.outputs.version }} are expanded directly into the shell script before execution. Actual risk here is low since version is either regex-validated or derived from git-cliff --bumped-version, and this matches the existing convention used throughout the rest of the workflow. Still, passing these through env vars is a trivial hardening that removes the residual risk flagged by static analysis.

🔒️ Suggested mitigation
       - name: Limit release notes size
+        env:
+          REPO: ${{ github.repository }}
+          VERSION: ${{ steps.version.outputs.version }}
         run: |-
           MAX_CHARS=125000
           CHARS=$(wc -m < release-notes.md | tr -d ' ')
           if [ "$CHARS" -gt "$MAX_CHARS" ]; then
           echo "Release notes are too large ($CHARS characters, max $MAX_CHARS). Linking to CHANGELOG.md instead."
-          echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for the full changelog." > release-notes.md
+          echo "Release notes are too large to display here. See [CHANGELOG.md](https://github.com/$REPO/blob/v$VERSION/CHANGELOG.md) for the full changelog." > release-notes.md
           fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 91 - 99, The “Limit release notes
size” step embeds templated GitHub expressions directly in the shell command,
which triggers the template-injection warning. Update this step to pass
github.repository and steps.version.outputs.version through env vars, then use
those variables inside the run script when building the CHANGELOG.md link,
keeping the logic in the same release-notes.md handling block.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 91-99: The “Limit release notes size” step embeds templated GitHub
expressions directly in the shell command, which triggers the template-injection
warning. Update this step to pass github.repository and
steps.version.outputs.version through env vars, then use those variables inside
the run script when building the CHANGELOG.md link, keeping the logic in the
same release-notes.md handling block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8646b34b-c7fd-4c0f-b210-113a73852f65

📥 Commits

Reviewing files that changed from the base of the PR and between 2357a98 and af595b2.

📒 Files selected for processing (4)
  • .github/workflows/release.yml
  • __tests__/unit/categories/js/release-workflow/preset/index.spec.ts
  • __tests__/unit/categories/js/release-workflow/release-workflow.installer.spec.ts
  • src/categories/js/release-workflow/preset/default.preset.ts

@allohamora allohamora merged commit 6dff2af into master Jul 7, 2026
4 checks passed
@allohamora allohamora deleted the bugfix/release-body-limit branch July 7, 2026 14:51
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.

2 participants