Skip to content

chore: fix changelog's group variable and properly handle commits newline#441

Closed
divineniiquaye wants to merge 1 commit intouni-stack:mainfrom
divineniiquaye:changelog
Closed

chore: fix changelog's group variable and properly handle commits newline#441
divineniiquaye wants to merge 1 commit intouni-stack:mainfrom
divineniiquaye:changelog

Conversation

@divineniiquaye
Copy link
Contributor

@divineniiquaye divineniiquaye commented Mar 6, 2026

The changelog.sh produces an error when run, and when you check CHANGELOG.md, multiple commits under a group newlines are not properly handled.

ERROR git_cliff                 > Template render error:
Variable `grouped[group]` not found in context while rendering 'body': the evaluated version was `grouped."🚀 Features"`. Maybe the index is out of bounds?

This PR fixes it.

Summary by CodeRabbit

  • Chores
    • Optimized changelog generation process by streamlining how commits are grouped and filtered.
    • Improved changelog output formatting for a more compact and cleaner presentation.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

The change refactors changelog group rendering logic in a configuration file by replacing precomputed map-based grouping with per-group filtering within a loop, while also making the output format more compact by removing unnecessary line continuation characters.

Changes

Cohort / File(s) Summary
Changelog Configuration
packages/uniwind/cliff.toml
Refactored commit group iteration from precomputed map lookup to per-group filtering loop with predefined order. Simplified output formatting by consolidating multi-line commit entries into more compact single-line representations with optional author and PR number lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • chore: changelog order #435: Both PRs modify the changelog grouping and ordering logic in packages/uniwind/cliff.toml, with each introducing different approaches to iterating and rendering commit groups while maintaining predefined sort order.

Poem

🐰 The changelog hops along so fine,
With groups that filter line by line,
No more maps to weigh us down,
Just compact lines throughout the town! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is directly related to the main changes: fixing the group variable error and handling commit newlines in the changelog template, which matches the core issues described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

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 `@packages/uniwind/cliff.toml`:
- Around line 19-29: The Jinja trim markers ({%- and -%}) around the per-group
loop are removing newlines and collapsing Markdown; update the loop tags so they
do not trim surrounding whitespace (remove the leading/trailing hyphens on the
`{% for commit in group_commits %}`, the `{% if commit.remote.pr_title %}`, the
corresponding `{% endif %}`/`{% endfor %}` tags and the closing `-%}` on the
group block) so newlines are preserved after `### {{ group }}` and after the
last bullet; ensure the block that renders `{{ commit_message | split(pat="\n")
| first | trim }}` remains intact but is wrapped by non-trimming `{% ... %}`
tags to preserve Markdown line breaks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0478151d-6842-42f7-ae10-859898807260

📥 Commits

Reviewing files that changed from the base of the PR and between dd5f432 and a5e9136.

📒 Files selected for processing (1)
  • packages/uniwind/cliff.toml

@Brentlok
Copy link
Contributor

Brentlok commented Mar 6, 2026

fixed in #442

@Brentlok Brentlok closed this Mar 6, 2026
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