commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

CZ not bumping patch release

Open pete-leese opened this issue 2 years ago • 1 comments

Description

I have setup the following rules to bump versions based on our ways of working, however

When the bump_pattern and bump_pattern do not match, then it bumps a patch version.

Is this a bug or my lack of understanding, and if so, can anyone suggest a suitable that will bump as per the following:

Config .cz.yaml

  customize:
    bump_map:
      break: MAJOR
      feature: MINOR
      fix: PATCH
    bump_pattern: ^(break|feature|fix)?
    change_type_map:
      break: Breaking Change
      feature: Feature
      fix: Fix
    change_type_order:
    - break
    - feature
    - fix
    changelog_pattern: ^(break|feature|fix)?(!)?
    commit_parser: ^(?P<change_type>break|feature|fix):\s(?P<message>.*)?
    example: 'feature: this feature enable customize through config file'
    info: This is customized info
    info_path: cz_customize_info.txt
    message_template: '{{change_type}}:{% if show_message %} {{message}}{% endif %}'
    questions:
    - choices:
      - name: Breaking Change.
        value: break
      - name: 'feature: A new feature.'
        value: feature
      - name: 'bug fix: A bug fix against an existing feature'
        value: fix
      message: Select the type of change you are committing
      name: change_type
      type: list
    - message: Body.
      name: message
      type: input
    - message: Do you want to add body message in commit?
      name: show_message
      type: confirm
    schema: '<type>: <body>'
    schema_pattern: (break|fix|feat):(\s.*)
  name: cz_customize
  tag_format: v$version
  version: 0.16.0

Steps to reproduce

Apply cz.yaml config from description field.

follow steps in Current behaviour field below;

Current behavior

git commit -m "fix: this and that"

When I validate this locally, it always wants to bump a minor release and not a patch release as I was expecting.

cz bump --dry-run bump: version 0.16.0 → 0.17.0 tag to create: v0.17.0 increment detected: MINOR

Desired behavior

Commit message contains:

break = MAJOR release bump feature: MINOR release bump fix: PATCH release bump

Screenshots

No response

Environment

commitizen 2.27.0

pete-leese avatar May 30 '22 16:05 pete-leese

@pete-leese your .cz.yaml file does not have the commitizen: property

I can't to reproduce. My test is working normally

commitizen:
  customize:
    bump_map:
      break: MAJOR
      feature: MINOR
      fix: PATCH
    bump_pattern: ^(break|feature|fix)?
    change_type_map:
      break: Breaking Change
      feature: Feature
      fix: Fix
    change_type_order:
    - break
    - feature
    - fix
    changelog_pattern: ^(break|feature|fix)?(!)?
    commit_parser: ^(?P<change_type>break|feature|fix):\s(?P<message>.*)?
    example: 'feature: this feature enable customize through config file'
    info: This is customized info
    info_path: cz_customize_info.txt
    message_template: '{{change_type}}:{% if show_message %} {{message}}{% endif %}'
    questions:
    - choices:
      - name: Breaking Change.
        value: break
      - name: 'feature: A new feature.'
        value: feature
      - name: 'bug fix: A bug fix against an existing feature'
        value: fix
      message: Select the type of change you are committing
      name: change_type
      type: list
    - message: Body.
      name: message
      type: input
    - message: Do you want to add body message in commit?
      name: show_message
      type: confirm
    schema: '<type>: <body>'
    schema_pattern: (break|fix|feat):(\s.*)
  name: cz_customize
  tag_format: v$version
  version: 0.16.0
git log

commit ad5ba5f760ab6aa88dab6d8891e4c1ec5adf7c25 (HEAD -> master)
Author: Daniel  <[email protected]>
Date:   Fri Jul 1 23:52:27 2022 -0300

fix: this and that

bump: version 0.16.0 → 0.16.1
tag to create: v0.16.1
increment detected: PATCH

Environment

  • cz v2.27.0
  • python v3.8.10

danroxha avatar Jul 02 '22 03:07 danroxha

Thanks @dannRocha . @pete-leese Does @dannRocha responses answers your question? If not, please feel free and reopen it.

Lee-W avatar Aug 14 '22 06:08 Lee-W