Skip to content

feat: add commit statistics to the changelog #1151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ognis1205
Copy link
Contributor

@ognis1205 ognis1205 commented May 30, 2025

Description

This adds support for computing and exposing aggregated commit statistics:

  • Total number of commits
  • Duration (in days) between the first and last commit
  • Number of conventional commits
  • Link references and their counts
  • Days since the previous release

The data is accessible in templates using the {{ statistics }} variable.

Motivation and Context

This change is inspired by the cargo-smart-release tool, which provides similar release statistics.
Including commit statistics in the changelog offers better insight into the release scope and development activity.
This change addresses [FEATURE REQUEST #452] and makes the statistics available in a configurable way through templates.

How Has This Been Tested?

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.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…ventional count, unique links, and days since previous release

Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 12 lines in your changes missing coverage. Please review.

Project coverage is 42.62%. Comparing base (7148b2d) to head (6a24eef).

Files with missing lines Patch % Lines
git-cliff-core/src/release.rs 72.73% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1151      +/-   ##
==========================================
+ Coverage   42.06%   42.62%   +0.56%     
==========================================
  Files          21       21              
  Lines        1983     2025      +42     
==========================================
+ Hits          834      863      +29     
- Misses       1149     1162      +13     
Flag Coverage Δ
unit-tests 42.62% <72.73%> (+0.56%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
@ognis1205 ognis1205 force-pushed the feat/commit-statistics branch from c2cd21f to 24169d5 Compare May 30, 2025 18:05
ognis1205 added 5 commits May 31, 2025 03:22
…is present

Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
…ency

Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
…logging

Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
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