question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

changelog generation is not working as expected in case of cz_customize?

See original GitHub issue

Description

Maybe I’m missing something but I’m not able to generate a changelog properly with custom configurations (cz_customize).

Steps to reproduce

cz --debug changelog --dry-run

Current behavior

I’ve tried different configurations through cz_customize, although the customization related to commits seems ok, the changelog generation doesn’t work for me. I’m not able to generate a changelog as I do with the cz_conventional_commits. There is no filtering on the commits, no grouping by change_type as you can see below.

File: .cz.yaml

commitizen:
  name: cz_customize
  customize:
    message_template: "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
    example: 'feature: this feature enable customize through config file'
    schema: "<type>: <body>"
    schema_pattern: (build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\(\S+\))?!?:(\s.*)
    changelog_pattern: ^(feat|fix|chore|refactor|perf)(\(.+\))?(!)?
    change_type_order: ["BREAKING CHANGE", "feat", "fix", "refactor", "chore", "perf"]
    info_path: cz_customize_info.txt
    info: This is customized info
    questions:
    - type: list
      name: change_type
      choices:
      - value: feature
        name: 'feature: A new feature.'
      - value: bug fix
        name: 'bug fix: A bug fix.'
      message: Select the type of change you are committing
    - type: input
      name: message
      message: Body.
    - type: confirm
      name: show_message
      message: Do you want to add body message in commit?
cz --debug changelog --dry-run
## Unreleased


- feat(DL-4567): new feature test
- fix(DL-1234): qweqwe

Screenshots

image

Desired behavior

File: .cz.yaml

commitizen:
  name: cz_customize
  customize:
    message_template: "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
    example: 'feature: this feature enable customize through config file'
    schema: "<type>: <body>"
    schema_pattern: (build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\(\S+\))?!?:(\s.*)
    changelog_pattern: ^(feat|fix|chore|refactor|perf)(\(.+\))?(!)?
    change_type_order: ["BREAKING CHANGE", "feat", "fix", "refactor", "chore", "perf"]
    info_path: cz_customize_info.txt
    info: This is customized info
    questions:
    - type: list
      name: change_type
      choices:
      - value: feature
        name: 'feature: A new feature.'
      - value: bug fix
        name: 'bug fix: A bug fix.'
      message: Select the type of change you are committing
    - type: input
      name: message
      message: Body.
    - type: confirm
      name: show_message
      message: Do you want to add body message in commit?
cz --debug changelog --dry-run`
## Unreleased

### Feat

- **DL-4567**: new feature test

### Fix

- **DL-1234**: qweqwe

Screenshots image

Environment

Commitizen Version: 2.20.0 Python Version: 3.10.0 (default, Oct 12 2021, 22:37:59) [Clang 13.0.0 (clang-1300.0.29.3)] Operating System: Darwin

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Lee-Wcommented, Dec 24, 2021

Back to the time cz_customize was designed, it was not designed to have any default value. But there might be some default values accidentally added to cz_cutsomize. What’s in my mind now is to deprecate cz_customize and make the options in cz_* customizable

2reactions
woilecommented, Dec 23, 2021

Hey bruno, I copied your example, seems to be working well. You see that error because of the --debug flag. Which gives you extra information, but it is not returning an error (you can see the error code doing echo $? and you’ll see is still 0).

Let me know if that’s correct, otherwise we can continue exploring the issue.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

commitizen/CHANGELOG.md at master - GitHub
Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder: - commitizen/CHANGELOG.md at ...
Read more >
Changelog generation from Github issues? - Stack Overflow
You can try to use Github-Changelog-Generator. (I'm author of this project). It generates changelog from tags and merged pull-requests.
Read more >
commitizen Changelog - PyUp.io
**git**: test the git log parser behaves properly when the repository has no commits - **changelog**: fixes logic issue made evident by latest...
Read more >
How To Automatically Generate A Helpful Changelog From ...
In my opinion, it is worth the effort to introduce the Git commit convention and the changelog generation in projects. We as developers...
Read more >
A Beginner's Guide to Git — What is a Changelog and How to ...
Or if you are working on an open-source project, you can find a "CHANGELOG.md" file in the GitHub repository. This file aims to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found