Skip to content

feat(bump): implements ignore_bump_*#1853

Open
namwoam wants to merge 5 commits intocommitizen-tools:masterfrom
namwoam:improve-bump-pattern
Open

feat(bump): implements ignore_bump_*#1853
namwoam wants to merge 5 commits intocommitizen-tools:masterfrom
namwoam:improve-bump-pattern

Conversation

@namwoam
Copy link
Contributor

@namwoam namwoam commented Feb 7, 2026

Description

This PR will let user select commits that shouldn't be bump version. Solve #1772

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected Behavior

Steps to Test This Pull Request

Steps to reproduce the behavior:

  1. Add a test file test.txt
  2. commit "feat: this should not be bumped"
    suppose got the following git log:
commit e302cb4f2c626099b4a9c8cf881b0bb5906b7356
Author: andre.liang <namwoam@gmail.com>
Date:   Sat Feb 7 21:33:10 2026 +0800

    feat: add a new test file, this should not be bumped
  1. configure either ignore_bump_rev_list=["e302cb4f2c626099b4a9c8cf881b0bb5906b7356"] or ignore_bump_author_list=["andre.liang"] to ignore this commit from version bump calculation.
  2. run cz bump will produce:
[NO_COMMITS_TO_BUMP]
The commits found are not eligible to be bumped

Additional Context

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.00%. Comparing base (573ffda) to head (486d9a0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1853   +/-   ##
=======================================
  Coverage   97.99%   98.00%           
=======================================
  Files          60       60           
  Lines        2692     2702   +10     
=======================================
+ Hits         2638     2648   +10     
  Misses         54       54           

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

@namwoam namwoam marked this pull request as ready for review February 7, 2026 14:09
@namwoam
Copy link
Contributor Author

namwoam commented Feb 7, 2026

Hello @bearomorphism , this PR is ready. Please help me rename this PR to feat: implements ignore_bump_*, I don't have the permission to do that.

@bearomorphism
Copy link
Collaborator

I remember the author can edit the PR title and description. That is strange

@namwoam namwoam changed the title [WIP] Improve bump pattern feat: implements ignore_bump_* Feb 8, 2026
@namwoam namwoam changed the title feat: implements ignore_bump_* feat(bump): implements ignore_bump_* Feb 8, 2026
@bearomorphism bearomorphism requested a review from Copilot February 8, 2026 04:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for excluding specific commits from version bump detection, allowing users to avoid bumps triggered by selected revisions or authors (addresses issue #1772).

Changes:

  • Extend bump increment detection to skip commits by revision (ignore_bump_rev_list) or author (ignore_bump_author_list).
  • Wire new config settings through the cz bump command into the increment finder.
  • Add tests and user documentation for the new configuration options.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
commitizen/bump.py Adds ignore-by-rev/author filtering while scanning commits for bump keywords.
commitizen/commands/bump.py Reads ignore lists from config and passes them into bump.find_increment.
commitizen/defaults.py Extends Settings typing to include the new config keys.
tests/test_bump_find_increment.py Adds unit tests covering rev-based and author-based ignore behavior.
docs/config/bump.md Documents the new ignore_bump_* configuration options with examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


if ignore_bump_author_list and commit.author in ignore_bump_author_list:
logger.debug(
f"Skipping commit {commit.rev} as its author '{commit.author}' is in ignore_bump_author_list"
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The debug log message on this line exceeds the configured formatter/linter max line length (88 in pyproject.toml). Please wrap/reformat the string (or split it across lines) to avoid CI formatting/lint failures.

Suggested change
f"Skipping commit {commit.rev} as its author '{commit.author}' is in ignore_bump_author_list"
"Skipping commit %s as its author '%s' is in ignore_bump_author_list",
commit.rev,
commit.author,

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to check what logger actually does

Comment on lines +219 to +224
Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options.

## `ignore_bump_rev_list`

- Type: `list`
- Default: `[]`
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

This sentence reads like meta commentary about the doc rewrite rather than user-facing documentation. Please remove it (or replace it with content that describes the settings) so the config page stays focused and professional.

Suggested change
Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options.
## `ignore_bump_rev_list`
- Type: `list`
- Default: `[]`
## `ignore_bump_rev_list`
- Type: `list`
- Default: `[]`
- Type: `list`
- Default: `[]`

Copilot uses AI. Check for mistakes.

See [`--version-scheme`](../commands/bump.md#-version-scheme).

Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options.
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

Comment on lines +29 to +30
ignore_bump_rev_list: list[str] | None = None,
ignore_bump_author_list: list[str] | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need these new parameters to be optional?

@woile
Copy link
Member

woile commented Feb 8, 2026

I don't get this PR, it doesn't have any test reproducing the issue mentioned in the original ticket.
How are authors related to this?

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.

3 participants