Skip to content

feat(template): add group_by_scope filter#1547

Merged
orhun merged 4 commits into
orhun:mainfrom
Noai-oss:feat/add_group_by_scope_filter
Jul 12, 2026
Merged

feat(template): add group_by_scope filter#1547
orhun merged 4 commits into
orhun:mainfrom
Noai-oss:feat/add_group_by_scope_filter

Conversation

@Noai-oss

@Noai-oss Noai-oss commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Motivation and Context

fixes #1247

Implemented group_by_scope filter for release array, it will map the scope together. it's also support release-0.1.0's semver version with prefix arg

How Has This Been Tested?

  {% for version, releases in releases | group_by_scope(scope="minor",prefix="v") %}
    {% if version %}
      ## {{ version }}
    {% else %}
      ## Unreleased
    {% endif %}
    {% set_global commits = [] %}
    {% for release in releases %}
      {% set_global commits = commits | concat(with=release.commits) %}
    {% endfor %}
    {% for group, commits in commits | group_by(attribute="group") %}
      ### {{ group }}
    {% endfor %}
  {% endfor %}

Screenshots / Logs (if applicable)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (if applicable).
  • I have formatted the code with rustfmt.
    • cargo +nightly fmt --all
  • I checked the lints with clippy.
    • cargo clippy --tests --verbose -- -D warnings
  • I have added tests to cover my changes.
  • All new and existing tests passed.
    • cargo test

@welcome

welcome Bot commented Jun 1, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.72340% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.30%. Comparing base (772e01d) to head (892f9be).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
git-cliff-core/src/template.rs 78.73% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1547      +/-   ##
==========================================
+ Coverage   48.65%   49.30%   +0.65%     
==========================================
  Files          26       26              
  Lines        2288     2335      +47     
==========================================
+ Hits         1113     1151      +38     
- Misses       1175     1184       +9     
Flag Coverage Δ
unit-tests 49.30% <78.73%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@orhun

orhun commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Hey @Noai-oss - this actually looks good! I see that this is a draft - what is missing from the implementation?

@orhun orhun added this to the 2.14.0 milestone Jul 11, 2026
@Noai-oss Noai-oss force-pushed the feat/add_group_by_scope_filter branch from 892f9be to 4be9ba5 Compare July 12, 2026 16:20
@Noai-oss Noai-oss marked this pull request as ready for review July 12, 2026 16:20
@Noai-oss Noai-oss requested a review from orhun as a code owner July 12, 2026 16:20
@Noai-oss Noai-oss force-pushed the feat/add_group_by_scope_filter branch from 4be9ba5 to 3c9fd7c Compare July 12, 2026 16:28
@Noai-oss

Copy link
Copy Markdown
Contributor Author

Hey @Noai-oss - this actually looks good! I see that this is a draft - what is missing from the implementation?

Hi, apologies for the delayed PR update.
Since the last revision, I removed the attribute parameter and now access .version directly. I also replaced the previous heuristic version-detection logic with an explicit prefix parameter to reduce ambiguity, which was one of my concerns with the earlier implementation.
I’ve pushed these changes and marked the PR as ready for review. Thank you for your patience.

@orhun orhun changed the title feat(templating): Implemented group_by_scope filter feat(template): add group_by_scope filter Jul 12, 2026

@orhun orhun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, thanks!!!

@orhun orhun merged commit dd5f305 into orhun:main Jul 12, 2026
108 of 109 checks passed
@welcome

welcome Bot commented Jul 12, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! ⛰️

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.

Support grouping changelog entries by minor version instead of per patch tag

3 participants