feat(bump): add commit filter pattern - #2078
Open
schlotter wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2078 +/- ##
==========================================
+ Coverage 98.19% 98.31% +0.11%
==========================================
Files 61 61
Lines 2829 2851 +22
==========================================
+ Hits 2778 2803 +25
+ Misses 51 48 -3 ☔ View full report in Codecov by Harness. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> commitizen-tools#2075
schlotter
force-pushed
the
feature/bump-support-filtering-commits
branch
from
August 25, 2026 14:13
110defc to
1e56d63
Compare
schlotter
marked this pull request as ready for review
August 25, 2026 14:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change adds support for filtering commits before Commitizen evaluates them for version bumps by introducing a new
bump_commit_filter_patternsetting.The new setting defaults to
.*, so existing projects keep the current behavior. When configured,cz bumpandcz version --next USE_GIT_COMMITSonly consider commits whose full message matches the filter pattern before applying the existing bump rules. This is particularly useful for monorepos where only a subset of commits should affect a package's version.The pull request also updates the related documentation and adds regression tests covering the new filtering behavior and fallback paths.
Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
Projects can opt into filtering commits used for bump calculation without changing the default behavior for existing users. With
bump_commit_filter_patternconfigured, unrelated commits are ignored beforebump_patternis applied, socz bumpandcz version --next USE_GIT_COMMITSderive the next version only from relevant commits.Steps to Test This Pull Request
bump_commit_filter_patternfor a subset of commit messages, for example^fix\(library-b\):.cz bump --dry-runorcz bump --get-nextand confirm that only matching commits affect the calculated increment.cz version --project --next USE_GIT_COMMITSand confirm it reports the version derived from the filtered commit set.Additional Context
Related discussion: #2075
Manual testing and validation performed during development included targeted pytest coverage for:
USE_GIT_COMMITSnext-version calculation with filters