Skip to content

fix: gen-release-notes improvements#191

Merged
jdx merged 6 commits into
mainfrom
fix/remove-llm-from-release-plz
Jan 19, 2026
Merged

fix: gen-release-notes improvements#191
jdx merged 6 commits into
mainfrom
fix/remove-llm-from-release-plz

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Jan 19, 2026

Summary

  • Use positional args ($1, $2) instead of usage spec environment variables in gen-release-notes - the env vars weren't being set correctly in GitHub Actions
  • Add validation for empty Claude output to ensure fallback to CHANGELOG.md works
  • Strip version header from PR body since PR title already has version

These fixes address issues discovered after the v1.9.0 release where LLM generation failed.

🤖 Generated with Claude Code


Note

Strengthens release automation and cleans PR body formatting.

  • gen-release-notes: add debug logging to stderr, capture Claude CLI stderr via a temp file, handle CLI failures explicitly, and validate non-empty model output before emitting
  • release-plz: strip the version header from unreleased changelog output (tail -n +3) for both dry-run display and PR body

Written by Cursor Bugbot for commit 70c799d. This will update automatically on new commits. Configure here.

jdx and others added 2 commits January 18, 2026 19:11
The usage spec environment variables (usage_version, usage_prev_version)
weren't being set correctly in the GitHub Actions environment. Switch to
using $1 and $2 positional arguments directly, consistent with mise.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The PR title already contains the version, so strip the redundant
version header (## [version] - date) from the PR body.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 19, 2026 01:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issues in the release notes generation script that were discovered during the v1.9.0 release. The changes ensure the script works properly in GitHub Actions by using positional arguments instead of environment variables, adds validation to prevent empty output, and removes redundant version headers from PR descriptions.

Changes:

  • Replaced USAGE spec environment variables with positional arguments in gen-release-notes
  • Added validation to ensure Claude returns non-empty output before using it
  • Removed version header from PR body to avoid duplication with PR title

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mise-tasks/gen-release-notes Switched from environment variables to positional args and added empty output validation
mise-tasks/release-plz Strips first two lines of unreleased notes to remove redundant version header

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

Comment on lines +60 to +63
# Validate we got non-empty output
if [[ -z $output ]]; then
echo "Error: Claude returned empty output" >&2
exit 1
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The error message indicates that the script will exit when Claude returns empty output, but the PR description mentions 'ensure fallback to CHANGELOG.md works.' The current implementation exits instead of falling back. Either update the error message to clarify there is no fallback, or implement the fallback logic described in the PR.

Suggested change
# Validate we got non-empty output
if [[ -z $output ]]; then
echo "Error: Claude returned empty output" >&2
exit 1
# Validate we got non-empty output, fall back to raw changelog if needed
if [[ -z $output ]]; then
echo "Warning: Claude returned empty output, falling back to raw changelog" >&2
output="$changelog"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread mise-tasks/release-plz
Comment thread mise-tasks/release-plz
# Get the unreleased notes for PR body
PR_BODY="$(git cliff --bump --unreleased --strip all)"
# Strip version header since PR title already has version
PR_BODY="$(git cliff --bump --unreleased --strip all | tail -n +3)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stripping two lines removes first section header

Medium Severity

The tail -n +3 command strips two lines from git cliff output, but according to cliff.toml, there's no blank line between the version header and the first section header. This means both the version line (e.g., ## [1.9.1] - date) AND the first section header (e.g., ### 🚀 Features) get stripped. The PR body ends up missing its first section header, starting with an orphaned bullet point instead of a properly formatted markdown section.

Fix in Cursor Fix in Web

jdx and others added 2 commits January 18, 2026 19:56
- Fall back to raw changelog when Claude returns empty output (Copilot)
- Make dry run output match actual PR body format (Cursor)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Log version, previous version, and changelog length before calling Claude
- Capture stderr from Claude CLI and display on failure
- Helps diagnose why LLM generation fails in CI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jdx jdx enabled auto-merge (squash) January 19, 2026 02:04
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread mise-tasks/gen-release-notes Outdated
Avoid polluting release notes output by redirecting stderr to a temp
file instead of merging with stdout (2>&1). This prevents Claude CLI
diagnostic messages from appearing in the release notes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jdx jdx merged commit 8059100 into main Jan 19, 2026
17 checks passed
@jdx jdx deleted the fix/remove-llm-from-release-plz branch January 19, 2026 02:47
jdx pushed a commit that referenced this pull request Jan 19, 2026
### 🐛 Bug Fixes

- gen-release-notes improvements by [@jdx](https://github.com/jdx) in
[#191](#191)

### 🔍 Other Changes

- exclude CHANGELOG.md from prettier by [@jdx](https://github.com/jdx)
in [#190](#190)
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