Skip to content

[CLI] Fix changelog output format#905

Merged
egorikftp merged 2 commits into
mainfrom
buf/cli/changelog
Feb 26, 2026
Merged

[CLI] Fix changelog output format#905
egorikftp merged 2 commits into
mainfrom
buf/cli/changelog

Conversation

@egorikftp

@egorikftp egorikftp commented Feb 26, 2026

Copy link
Copy Markdown
Member

📝 Changelog

If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs:

@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown

Walkthrough

Removed the CLI subsection from the root DEVELOPMENT.md and added tools/cli/DEVELOPMENT.md with CLI build and changelog tasks. Bumped cli version from 1.1.0 to 1.1.1 in gradle/cli.versions.toml. Added a 1.1.1 Unreleased entry to tools/cli/CHANGELOG.md. ChangelogCommand now strips the "## Unreleased" header, uses the filtered changelog for both full and truncated outputs, and detects release headers by lines starting with "## ". Tests were updated to assert the output does not contain "## Unreleased".

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[CLI] Fix changelog output format' directly reflects the main change: fixing the changelog output command to remove the 'Unreleased' section and handle a new format.
Description check ✅ Passed The PR description includes the changelog template with the CLI changelog checkbox marked as checked, indicating the author updated the relevant changelog as required.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch buf/cli/changelog

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tools/cli/DEVELOPMENT.md (1)

3-5: Optional docs clarity: specify execution context.

Consider explicitly stating these commands are run from the repository root to avoid confusion when reading this file inside tools/cli/.

✍️ Suggested doc tweak
 ## CLI
 
-Build CLI: `./gradlew buildCLI`
+Run from repository root:
+
+- Build CLI: `./gradlew buildCLI`
 
-Changelog: `./gradlew patchChangelog`
+- Changelog: `./gradlew patchChangelog`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/DEVELOPMENT.md` around lines 3 - 5, The two CLI commands listed
(Build CLI: `./gradlew buildCLI` and Changelog: `./gradlew patchChangelog`) lack
context about where to run them; update DEVELOPMENT.md to explicitly state these
commands must be executed from the repository root (e.g., add a short note like
"Run from the repository root:" before the commands or prefix each command with
"(from repo root) ./gradlew ...") so readers viewing tools/cli/ know the correct
execution context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommand.kt`:
- Line 30: The logic that detects release headers uses
lines[index].trimStart().startsWith("## "), which also matches "## Unreleased"
and causes an off-by-one in release counting; update the predicate in the
header-detection logic (the spot using lines[index].trimStart().startsWith("##
")) to only treat headers as releases when they are a real version header (e.g.,
match a version pattern like semantic versioning) or explicitly exclude
"Unreleased" (and apply the same stricter check in the related block handling
lines 37-41), so the count only includes actual versioned releases.

---

Nitpick comments:
In `@tools/cli/DEVELOPMENT.md`:
- Around line 3-5: The two CLI commands listed (Build CLI: `./gradlew buildCLI`
and Changelog: `./gradlew patchChangelog`) lack context about where to run them;
update DEVELOPMENT.md to explicitly state these commands must be executed from
the repository root (e.g., add a short note like "Run from the repository root:"
before the commands or prefix each command with "(from repo root) ./gradlew
...") so readers viewing tools/cli/ know the correct execution context.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08289c2 and 8841eab.

📒 Files selected for processing (5)
  • DEVELOPMENT.md
  • gradle/cli.versions.toml
  • tools/cli/CHANGELOG.md
  • tools/cli/DEVELOPMENT.md
  • tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommand.kt
💤 Files with no reviewable changes (1)
  • DEVELOPMENT.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommand.kt`:
- Line 17: The code in ChangelogCommand.kt currently only strips the "##
Unreleased" header via changelog.replace("## Unreleased\n", ""), leaving the
Unreleased content in place; change the logic that builds filteredChangelog to
remove the entire Unreleased section by replacing the range from the "##
Unreleased" header up to (but not including) the next "## " header or
end-of-file. Use a Regex replacement on the changelog string (e.g., matching
"(?s)## Unreleased\\b.*?(?=(\\n##\\s)|\\z)") or equivalent substring indexing so
filteredChangelog contains no Unreleased entries. Ensure you update the
reference to filteredChangelog in the rest of the function accordingly.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5be36aa and 2f370a6.

📒 Files selected for processing (3)
  • tools/cli/CHANGELOG.md
  • tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommand.kt
  • tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommandTest.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • tools/cli/CHANGELOG.md
  • tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/command/ChangelogCommandTest.kt

@egorikftp egorikftp merged commit 9e57581 into main Feb 26, 2026
3 checks passed
@egorikftp egorikftp deleted the buf/cli/changelog branch February 26, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant