Skip to content

Bump Increments PATCH Version on ci Commit #1772

Description

@Clockwork-Muse

Description

I've just received a patch bump on a CI commit, when neither the preceding nor succeeding CI commit resulted in a bump at all.

This is possibly the same cause as #695, as the auto-generated messages from dependabot includes "matching" messages in some cases in the body.

Steps to reproduce

  1. Have a .cz.toml file:
    [tool.commitizen]
    name = "cz_conventional_commits"
    tag_format = "v$version"
    version_scheme = "semver2"
    version_provider = "scm"
    annotated_tag = true
    breaking_change_exclamation_in_title = true
  2. Have a series of the following commit messages:
  3. Run cz --no-raise 21 bump --get-next, and observe that it outputs a version bump

(I'm sorry, this is a private repo, so I can't point you at a repo itself)

Current behavior

It unexpectedly issued a new bump version.

If a changelog is generated, eg with cz changelog v<new version> --file-name <some file name>, it outputs a changelog without a list of changes:

## v0.2.1 (2026-01-05)

Desired behavior

No version bump

Screenshots

No response

Environment

Commitizen Version: 4.11.0
Python Version: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]
Operating System: Linux

Activity

  1. Clockwork-Muse commented on Jan 5, 2026

    @Clockwork-Muse
    Author

    Side note: looking at my logs, I'm also getting patch commits for chore messages, but I'm not sure whether that's intended?

  2. bearomorphism commented on Jan 7, 2026

    @bearomorphism
    Collaborator

    Sounds strange, at least it does not happen on our project github action. We have merged a few ci / build commits recently but we didn't observed this.

    Can you share the commit log? I am not entirely sure what your attached markdown files mean. Which commit(s) triggered the undesired behavior?

    It would be easier for us to debug if we have the commits.

  3. Clockwork-Muse commented on Jan 7, 2026

    @Clockwork-Muse
    Author

    Previous messages as (the relevant portion of the) git.log.

    The middle commit, ada7086fe63e0b17e4b5e2f617d52585176f33f4, was considered to have a patch bump

  4. bearomorphism commented on Jan 8, 2026

    @bearomorphism
    Collaborator

    Thanks!

  5. namwoam commented on Jan 31, 2026

    @namwoam
    Contributor

    @bearomorphism I will take on this issue.

  6. bearomorphism commented on Feb 8, 2026

    @bearomorphism
    Collaborator

    @namwoam could you share the root cause of the unexpected behavior in this issue?

  7. woile commented on Feb 8, 2026

    @woile
    Member

    Can you share the output of git log --decorate? Thanks

  8. namwoam commented on Feb 8, 2026

    @namwoam
    Contributor

    Hello @bearomorphism @woile

    In the git log, line 91 contains the following commit message:

    fix: update <code>@actions/artifact</code> to ^5.0.0 for Node.js 24
    

    Based on the logic in bump.py, this message matches the pattern ^((BREAKING[\-\ ]CHANGE|\w+)(\(.+\))?!?):
    defined in defaults.py

    As a result, because the message contains the fix keyword, it is interpreted as a patch bump.

    That said, it’s difficult to anticipate every edge case where the regex might produce unintended matches. For this reason, it seems more robust to allow users to explicitly control which commits should NOT trigger a version bump.

    Additionally, requiring users to list every commit (potentially hundreds) generated by tools like Dependabot in pyproject.toml is not very practical. Allowing users to ignore all commits from a specific author seems to be a better solution.

  9. woile commented on Feb 8, 2026

    @woile
    Member

    As a result, because the message contains the fix keyword, it is interpreted as a patch bump.

    Nothing wrong here, it works as expected

    Additionally, requiring users to list every commit (potentially hundreds) generated by tools like Dependabot in pyproject.toml is not very practical

    If you don't want commits from dependabot to be part of the bump, just change dependabot.

    Allowing users to ignore all commits from a specific author seems to be a better solution.

    I disagree, it just creates confusion.

    Without a full log, we cannot tell if there's a bug or not, but, looking at the title, if there was a fix commit, then a PATCH is expected, and it worked well.

  10. bearomorphism commented on Feb 9, 2026

    @bearomorphism
    Collaborator

    As a result, because the message contains the fix keyword, it is interpreted as a patch bump.

    So it's by design. The new feature in #1853 is not necessary.

  11. bearomorphism commented on Feb 9, 2026

    @bearomorphism
    Collaborator

    @Clockwork-Muse I am closing this issue since everything is working as expected here. Feel free to reopen this issue if you think further discussion is needed. Thanks!

  12. Clockwork-Muse commented on Feb 9, 2026

    @Clockwork-Muse
    Author

    @bearomorphism - I don't have permission to re-open the issue.

    The problem here is that that isn't the (start of the) commit message, it's about halfway down the body of the message. The actual start of the commit message is indeed "ci:", on line 11, which is why I was expecting to be the determining factor.

    The message causing the bump to be chosen is from the changelog of the dependency dependabot is bumping not from commits in my repo. It's dependabot showing its work, and it looks like this in the UI:

    Image

    The decorated log reveals only whitespace differences, plus the tag that got attached from a release, but nothing otherwise substantive.

  13. reopened this on Feb 10, 2026
  14. Lee-W commented on Feb 10, 2026

    @Lee-W
    Member

    I just re-open the issue for further discussion

  15. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Triage from #1964: Already assigned and reopened — leaving in place. Logging here for tracking.

  16. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Verification update (re #1964)

    Reproduced against current master (4.15.1):

    Bulleted body (e.g., - fix: addresses CVE-... inside a ci: commit body) does NOT trigger a false-positive bump — the leading - prevents the regex match.

    Unbulleted body line that starts at column 0 with a conventional-commit form (e.g., fix: update @actions/artifact to ^5.0.0 for Node.js 24 inside another commit's body) DOES still trigger a false-positive PATCH bump:

    bump: version 0.1.0 → 0.1.1
    tag to create: v0.1.1
    increment detected: PATCH
    

    The body line is also picked up by the changelog and rendered as a ### Fix entry.

    Verdict: STILL VALID. Root cause: in commitizen/bump.py::find_increment, the bump_pattern is matched against every line of commit.message.split("\n"), including the body. Any line that happens to start with feat/fix/etc. counts as a bumpable commit type — even if it's just text in the body of a ci: or merge-commit.

    Possible fixes:

    1. Anchor the search to commit titles only (only check commit.title, not the body).
    2. Or, only check body lines when the title's type is something like revert/merge where body parsing makes sense.
    3. Or, use re.fullmatch on each line so a line like "fix: update X" doesn't match if there's any prefix/whitespace — but this is fragile.

    (1) feels safest. Worth coordinating with whoever's already assigned (@namwoam) so we don't double up.

  17. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Update (re #1964 triage)

    @namwoam — pinging in case you're still active on this. Given the thread has been quiet since February, I went ahead and put up #1983 so the fix doesn't sit. If you'd rather take it over, please say the word and I'll close mine.

    Re-reading the screenshot @Clockwork-Muse attached (the dependabot PR description, which becomes the commit body):

    dependabot PR

    The b5b1a91 fix: update @actions/artifact to ^5.0.0 for Node.js 24 punycode fix line is dependabot quoting an upstream commit from actions/upload-artifact's changelog — it's NOT a fix: commit in @Clockwork-Muse's repo. The actual repo commit is ci: bump actions/upload-artifact from 5 to 6 (#23).

    My earlier triage closed this as "by design", which was wrong. The Conventional Commits spec puts the type only in the title. Scanning every body line for type-prefixed text is what conflicts with the spec, and what produces this kind of false positive on auto-generated commits.

    The fix in #1983: find_increment matches the type only against commit.title. The body is still scanned, but only for BREAKING CHANGE: / BREAKING-CHANGE: footers (which the spec puts in the body / footer). Existing tests for both forms (title + body BREAKING CHANGE) still pass; the new regression test reproduces the dependabot scenario.

    Sorry for the previous closure, @Clockwork-Muse. Verified end-to-end with your exact reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions