Skip to content

[Fix] Use stable base for stable release notes#496

Merged
samzong merged 1 commit into
mainfrom
fix/release-notes-stable-tag-base
May 14, 2026
Merged

[Fix] Use stable base for stable release notes#496
samzong merged 1 commit into
mainfrom
fix/release-notes-stable-tag-base

Conversation

@samzong
Copy link
Copy Markdown
Collaborator

@samzong samzong commented May 14, 2026

Summary

Fix release note range resolution so stable tags use the previous stable tag as the base, while prerelease tags continue to use the previous tag.

Type of change

  • [Feat] new feature
  • [Fix] bug fix
  • [UI] UI or UX change
  • [Docs] documentation-only change
  • [Refactor] internal cleanup
  • [Build] CI, packaging, or tooling change
  • [Chore] maintenance

Why is this needed?

Stable release notes for tags like v0.0.15 should summarize changes since the previous stable release, not only since the latest beta tag. Beta release notes should still use the previous prerelease tag.

What changed?

  • Added stable-tag detection for vX.Y.Z release refs.
  • Added a shared previous-tag resolver that excludes prerelease tags only for stable release refs.
  • Updated CLI help examples to show stable and prerelease range behavior.

Architecture impact

  • Owning layer: scripts
  • Cross-layer impact: none
  • Invariants touched from docs/architecture-invariants.md: none
  • Why those invariants remain protected: this only updates a release note helper script and does not affect application layers or runtime imports.

Linked issues

N/A

Validation

  • pnpm lint
  • pnpm test
  • pnpm build
  • pnpm check:ui-contract
  • Manual smoke test
  • Not run

Commands, screenshots, or notes:

node scripts/generate-release-notes.mjs --help
# Passed; help now documents stable and prerelease examples.

node scripts/generate-release-notes.mjs v0.0.15 > /tmp/clawwork-release-notes-v0.0.15-after-commit.md
# Passed; stderr showed range: v0.0.14..v0.0.15.
# Existing fallback warning: unresolved gh PR API lookup for #325.

node scripts/generate-release-notes.mjs v0.0.15-beta.4 > /tmp/clawwork-release-notes-v0.0.15-beta.4-after-commit.md
# Passed; stderr showed range: v0.0.15-beta.3..v0.0.15-beta.4.

pnpm exec prettier --check scripts/generate-release-notes.mjs
# Passed.

pnpm exec eslint scripts/generate-release-notes.mjs
# Exited 0 with warning: file ignored by eslint ignore pattern.

pre-commit hook
# Ran eslint --fix, prettier --write, and pnpm check:architecture successfully.

Screenshots or recordings

N/A. This change affects release note script behavior only.

Release note

  • No user-facing change. Release note is NONE.
  • User-facing change. Release note is included below.
NONE

Checklist

  • All commits are signed off (git commit -s)
  • The PR title uses at least one approved prefix: [Feat], [Fix], [UI], [Docs], [Refactor], [Build], or [Chore]
  • The summary explains both what changed and why
  • Validation reflects the commands actually run for this PR
  • Architecture impact is described and references any touched invariants
  • Cross-layer changes are explicitly justified
  • The release note block is accurate

Signed-off-by: samzong <samzong.lu@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

Hi @samzong,
Thanks for your pull request!
If the PR is ready, use the /auto-cc command to assign Reviewer to Review.
We will review it shortly.

Details

Instructions for interacting with me using comments are available here.
If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the accuracy of release note generation by refining how the base tag is resolved. By intelligently filtering out prerelease tags when generating notes for stable releases, the script now ensures that stable release notes correctly summarize changes since the last stable version rather than the most recent beta.

Highlights

  • Stable Tag Detection: Introduced a regex-based helper to identify stable release tags (vX.Y.Z) and distinguish them from prerelease tags.
  • Smart Range Resolution: Updated the release note generation script to use the previous stable tag as the base for stable releases, while maintaining standard behavior for prerelease tags.
  • CLI Documentation: Updated the help output for the release notes script to clearly demonstrate the difference in range behavior between stable and prerelease tags.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logic to distinguish between stable and pre-release tags when generating release notes by adding isStableTag and previousTag helper functions. The argument parsing logic has been refactored to utilize these helpers for determining the base tag. A security improvement was suggested to prevent potential command injection by escaping the head parameter when executing shell commands.


function previousTag(head) {
const prereleaseFilter = isStableTag(head) ? " --exclude 'v*-*'" : '';
return sh(`git describe --tags --abbrev=0${prereleaseFilter} ${head}^`, { allowFail: true });
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.

security-high high

The head parameter is interpolated directly into a shell command string, which is vulnerable to command injection if the input contains shell metacharacters (e.g., ;, &, |). Although this is a local script, it's safer to escape the argument. Since other parts of this script use JSON.stringify() for this purpose (e.g., line 196), it should be applied here as well.

Suggested change
return sh(`git describe --tags --abbrev=0${prereleaseFilter} ${head}^`, { allowFail: true });
return sh(`git describe --tags --abbrev=0${prereleaseFilter} ${JSON.stringify(head + '^')}`, { allowFail: true });

@samzong samzong merged commit d82c393 into main May 14, 2026
12 checks passed
@samzong samzong deleted the fix/release-notes-stable-tag-base branch May 14, 2026 06:00
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