Skip to content

ci(release): list only CLI changes in CLI release notes - #694

Merged
aliasunder merged 10 commits into
worktree-release-checkout-latest-mainfrom
ci/cli-release-notes-filter
Oct 22, 2026
Merged

aliasunder merged 10 commits into
worktree-release-checkout-latest-mainfrom
ci/cli-release-notes-filter

Conversation

@aliasunder

@aliasunder aliasunder commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

The CLI release notes list every commit that touches cli/, so they include changes no CLI user gets: the release's own version bump, test-only commits, and commits that only reword comments (including the comment text of the .env templates in cli/src/env.ts).

A commit is now listed only when its changes under cli/ add or remove a line that none of these rules skips:

  • blank lines
  • lines in files under cli/src/__tests__/
  • the "version" line of cli/package.json (the release bump)
  • in .ts files, lines that start, after any indent, with #, //, /* or *: comments, and the .env templates' comment text. A # line shaped like a setting (# KEY=value) still counts, because the templates ship optional settings commented out for the user to uncomment

In other files, cli/README.md included, every non-blank line counts. Dependency changes in cli/package.json stay listed, and the "Published to npm" footer is unchanged. With no earlier CLI tag, the range is still the whole history, and the same rules decide which of its commits are listed.

  • .github/scripts/generate-cli-notes.sh: new script that prints the listed commits since the previous CLI tag, one - <subject> line each, newest first.
  • .github/workflows/cli_release.yml: the "Create GitHub release" step runs the script with bash instead of git log -- cli/.
  • src/__tests__/generate-cli-notes.test.ts: runs the real script under bash against a temporary git repository.
  • scripts/__tests__/lint-shell.test.ts: lists the new script among the shell scripts ShellCheck checks.
  • CONTRIBUTING.md: the release-notes section states the CLI rule.
  • AGENTS.md: the script-test conventions list the new test.

Test plan

🤖 Generated with Claude Code

The CLI release notes listed every commit that touched cli/, including
the release's own version bump, test-only changes, and commits that
only reworded comments or the .env template comments in cli/src/env.ts.

A commit is now listed only when its diff under cli/ adds or removes a
line that is not blank and not a comment. Files under cli/src/__tests__/
and the "version" line of cli/package.json are not counted; in .ts files,
lines starting with #, //, /*, * or */ are comments. The logic moves to
.github/scripts/generate-cli-notes.sh, tested against real git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aliasunder
aliasunder added this pull request to stack #695 October 21, 2026 23:11
Comment thread .github/scripts/generate-cli-notes.sh
Comment thread .github/scripts/generate-cli-notes.sh Outdated
Comment thread .github/scripts/generate-cli-notes.sh Outdated
Comment thread .github/scripts/generate-cli-notes.sh Outdated
Comment thread .github/workflows/cli_release.yml Outdated
Comment thread src/__tests__/generate-cli-notes.test.ts
@umm-actually

umm-actually Bot commented Oct 21, 2026

Copy link
Copy Markdown

Add generate-cli-notes.test.ts to AGENTS.md's script-test enumeration
Low severity · conventions · high confidence

AGENTS.md:1 — beyond the diff's line ranges, in code the changes touch or depend on.

AGENTS.md's test-conventions exception enumerates the release-script tests in src/tests/ as install-deps.test.ts, generate-notes.test.ts, and update-changelog.test.ts; this PR adds generate-cli-notes.test.ts under that same exception, leaving the enumeration stale.

Failure scenario: A contributor or agent checking AGENTS.md's list of src/tests/ script tests does not find generate-cli-notes.test.ts and 'fixes' its location — moving it next to the script or widening vitest's include paths — the exact outcome the same paragraph forbids.

Suggested fix
Extend the parenthetical list in AGENTS.md's test-conventions exception to include generate-cli-notes.test.ts.

umm-actually · z-ai/glm-5.3-flash

@umm-actually

umm-actually Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

umm-actually re-reviewed at c2d7655

1 new finding(s) posted (15 tracked finding(s) across all runs).


umm-actually · z-ai/glm-5.3-flash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/scripts/generate-cli-notes.sh
Comment thread src/__tests__/generate-cli-notes.test.ts
aliasunder and others added 4 commits October 21, 2026 20:03
A file name with a space gets a trailing tab in the diff header, and a
name with special characters is quoted, so neither matched the header
pattern. The path then kept the previous file's value: a comment-only
change to such a .ts file was listed, and a heading added to such an
.md file after a .ts comment was read as a .ts comment and left out.
The path now resets per file and the header pattern accepts both forms.

Also lists generate-cli-notes.test.ts beside the other release-script
tests in AGENTS.md, and says in CONTRIBUTING.md that in files other than
.ts every non-blank line counts.

Ship-Check: pr-review · claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generate-cli-notes.sh: one pathspec shared by git log and diff-tree;
  drop prefix flags diff-tree already defaults to (plumbing ignores
  diff.noprefix); state why merges are skipped, why renames are off,
  that the .ts rule reads only how a line starts, and what the describe
  fallback is for
- cli_release.yml: name --generate-notes, say how to create the release
  by hand, and when the existing-release skip is reached
- CONTRIBUTING.md: CLI bullet puts the counting rule after the skip
  list and covers moved files and which dependency bumps count
- AGENTS.md: list the shell-script test locations as items

Ship-Check: code-quality · claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The patch reader resets its hunk state at each file's diff line, so the
next file's headers are not read as changed lines. No test covered a
comment-only commit touching more than one file; removing the reset left
every test passing while such a commit was listed in the CLI notes.

Ship-Check: test-audit · claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/scripts/generate-cli-notes.sh
Comment thread CONTRIBUTING.md Outdated
Comment thread src/__tests__/generate-cli-notes.test.ts
Comment thread src/__tests__/generate-cli-notes.test.ts
- git log and git show pass --no-show-signature, so a log.showSignature
  setting no longer adds lines that break the hash loop (exit 128) or land
  in the notes when the release commands are run by hand.
- A whitespace-only line in a CRLF file counts as blank.
- The workflow runs the script with bash, like the server release scripts.
- Comments and CONTRIBUTING.md state that the rules still apply with no
  earlier tag and to commits a merge brings in, and that code lines
  starting like a comment (the bin.ts shebang) are skipped too.

Ship-Check: bug-check · claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/scripts/generate-cli-notes.sh
aliasunder and others added 2 commits October 21, 2026 20:54
…in CLI notes

A # line shaped like a setting (# KEY=value, the key in capitals) in a .ts
file now counts. The .env templates in cli/src/env.ts ship optional settings
commented out for the user to uncomment, so a commit that adds or renames one
changes what the CLI writes. Rewording a template's comment text is still left
out.

Ship-Check: bug-check · claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--no-renames and --text change no output (diff-tree detects no renames unless asked, and cli/ has no binary files), --no-show-signature guards a git setting no runner has, and the optional previous-tag argument is never passed. The notes are identical for all 55 CLI tags before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aliasunder

Copy link
Copy Markdown
Owner Author

Response to the PR-level finding:

  • #issuecomment-6328716924 (add generate-cli-notes.test.ts to AGENTS.md's script-test list): fixed in 4e0a53e; the list now names it beside generate-notes.test.ts and update-changelog.test.ts.

🔍 ship-check · pr-monitor · claude-opus-5-5

Comment thread src/__tests__/generate-cli-notes.test.ts
Comment thread src/__tests__/generate-cli-notes.test.ts
@aliasunder
aliasunder merged commit 0679830 into main Oct 22, 2026
18 checks passed
@aliasunder
aliasunder deleted the ci/cli-release-notes-filter branch October 22, 2026 02:09
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