Skip to content

Add ability to create changelog on bump by default #290

Closed

Description

@janw

Description

I'd love for commitizen to configurable to have the --changelog flag set by default on bump. This would reduce friction in adopting commitizen by avoiding a missing updated changelog on version bumps.

Possible Solution

  1. Introduce a configuration flag à la update_changelog_on_bump (defaulting to False to mimic current behavior), that when set to True would have the same effect as providing the --changelog flag.
  2. Introduce a negated version for --changelog (e.g. --no-changelog) to disable changelog generation for one version bump.

If this is something the maintainers agree is a useful feature, I'd be happy to implement it and provide a PR for it. 👋

Activity

  1. Lee-W commented on Nov 4, 2020

    @Lee-W
    Member

    Hi, thanks for the suggestion. However, I'm a bit against this idea. I think when a user enters cz bump what they expect is bumping instead of bumping and generating the changelog at the same time.

  2. Lee-W commented on Nov 4, 2020

    @Lee-W
    Member

    Ah, I missed one detail. I think introducing update_changelog_on_bump to the configuration is great.

  3. janw commented on Nov 4, 2020

    @janw
    ContributorAuthor

    Yes, I'm not suggesting to always create a changelog but to keep the current default in place (no changelog) but to give an option to do it.

    I'm working on a project where our release cycle should contain a single commit for changelog update and version bumping. That's where I'd want to set that update_changelog_on_bump flag so we won't forget including the changelog.

  4. woile commented on Nov 4, 2020

    @woile
    Member

    I'm not very fond of this change, cz bump is clear enough on what work it does, if it's also creating the changelog it may generate confusion, it's less readable. Doing cz bump -c or cz bump --changelog can only be forgotten if manually done.

  5. janw commented on Nov 4, 2020

    @janw
    ContributorAuthor

    You are absolutely right, the ultimate goal should be to automate this step entirely in CI. Unfortunately, while adopting commitizen to a long-running project with a considerable amount of established processes it is not (immediately) feasible to automate this. Furthermore it might not be desired by all projects to bump versions every time when feat/fix commits are merged to the main branch. I can imagine a case in which a minor release is only created after multiple non-breaking feature merges for example. And in that case the bump execution would be done manually—unless you have a better idea for such scenarios?

  6. woile commented on Nov 4, 2020

    @woile
    Member

    unless you have a better idea for such scenarios?

    Most CI's have a manual trigger. Here's an example of github actions, Jenkins and gitlab-ci also support prompts or "buttons".

    I'm not sure, I totally think it makes a job less readable, but on the other hand if it helps adoption. I'll let @Lee-W decide.

  7. Lee-W commented on Nov 4, 2020

    @Lee-W
    Member

    @woile I think the users are supposed to know what they're doing when they add a new configuration. Thus, I'm okay with the idea of update_changelog_on_bump. But I'm not into the idea of --no-changelog. It will make the cz bump command a bit more confusing.

  8. Lee-W commented on Nov 4, 2020

    @Lee-W
    Member

    unless you have a better idea for such scenarios?

    I add the command cz bump --changelog to my makefile / tasks.py to solve this problem.

  9. janw commented on Nov 4, 2020

    @janw
    ContributorAuthor

    Thank you for both of your input here! I will adjust the (admittedly premature 😬) PR accordingly

  10. Lee-W commented on Nov 4, 2020

    @Lee-W
    Member

    This issue is closed by #293 . Thanks for your contribution 😃

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions