zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Possibility to add prefix to commit messages #388

Closed LvffY closed 1 year ago

LvffY commented 1 year ago

Hello

I would like to be able to more configure our release process by adding a prefix message to our commit messages. I know about extra-message configuration, but this add message at the end of the commit, here I want the message to be before the commit message

For example, I think about a prefix-message configuration that could be added in the configuration files.

That would lead to :

[zest.releaser]
prefix-message = [This is a message before]
extra-message = [This is a message after] ## Only for the example, not needed
[This is a message before] Preparing release 1.0.3.0

[This is a message after]

Do you think this could be done ? I'd be happy to submit a PR if you think this is useful.

reinout commented 1 year ago

I searched for extra_message in the code: implementing prefix_message will be easy. Just two places where you need to change anything (plus changelog/readme, of course).

A potential problem: the extra_message is separated from the actual message by two newline characters. Works fine for the [ci-skip] for which it was mainly intended.

What about your prefix? It looks like a prefix on the same line? Technically, it can be done of course. But what is your use case?

LvffY commented 1 year ago

@reinout My use case is the following :

I think we don't want to have a newline characters at the end of the prefix-message.

reinout commented 1 year ago

Clear. I think it is OK. And "prefix" sounds like there's no newline, so that's fine.

reinout commented 1 year ago

[JIRA-xxx] sounds a little bit like [JIRA-some-issue-number-that-changes-the-whole-time]. That's not something that's going to bite you? As prefix-message is probably going to be quite static?

LvffY commented 1 year ago

@reinout Yes this kind of messages (i.e. [JIRA-XXX] prefixed) is indeed quite dynamic. But this is more oriented for developers in my process.

What I will put for zest.releaser is more likely the [TOOLS] 🤖 prefix message. This prefix will be static.

Will you do it or do you want me to try it and submit a PR ?

And finally, do you have any idea about when it could be done ? Not hurry from my side, just for me to have an idea

reinout commented 1 year ago

Yes, a PR is fine. Should be quite an easy small one. It might be a bit of a scare to add a test for the new functionality, as I started the project (15 years ago or so) with doctests. It should be possible to get everything working by looking at https://zestreleaser.readthedocs.io/en/latest/developing.html, otherwise it is a documentation bug and we should fix it :-)

If there's a PR and we just have to press "merge", then we normally have a new release out within a day. Both @mauritsvanrees and me have email alerts on for this repo.