commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

How to add link issue on changelog?

Open ftamhar opened this issue 3 years ago • 3 comments

Description

if my commit message is feat: add feat #1

in CHANGELOG.md it doesn't linked to the issue.

how to add link issue to #1 automaticaly with (eg) cz ch ?

I have search #396 but I can't understand how to do it.

Possible Solution

No response

Additional context

No response

Additional context

No response

ftamhar avatar Aug 11 '22 23:08 ftamhar

You can check the documentation here. https://commitizen-tools.github.io/commitizen/customization/#custom-changelog-generator.

You'll probably need to change the changelog_hook inside it

    def changelog_hook(self, full_changelog: str, partial_changelog: Optional[str]) -> str:
        """Executed at the end of the changelog generation

        full_changelog: it's the output about to being written into the file
        partial_changelog: it's the new stuff, this is useful to send slack messages or
                           similar

        Return:
            the new updated full_changelog
        """
        if partial_changelog:
            chat.room("#committers").notify(partial_changelog)
        if full_changelog:
            compliance.send(full_changelog)
        full_changelog.replace(' fix ', ' **fix** ')
        return full_changelog

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

In my local it's not possible because of dependency conflict on module chat (and this module is very big)

So my hope is from github/gitlab cicd. When I change tool.commitizen.name to (eg:)cz_latihan, it get error on cicd :( the error is Try running 'pip install cz_latihan'

I hope the default of cicd is creating a link to issue(s).

ftamhar avatar Aug 15 '22 06:08 ftamhar

Do you mean the chat we use in the example? I think that is not needed if you're to customize changelog. That was just an example of how to integrate it with chat.

Lee-W avatar Aug 16 '22 09:08 Lee-W

Since commitizen v3 the plugin system has greatly improved. The original question has been answered: create a custom commitizen package. https://commitizen-tools.github.io/commitizen/customization/#custom-changelog-generator

Feel free to open a new issue

woile avatar Apr 28 '23 13:04 woile