Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pre-release seperated changelog #454

Conversation

nbrugger-tgm
Copy link

@nbrugger-tgm nbrugger-tgm commented Dec 5, 2021

Description

Adds 2 parameters :

  • --separate-pre-changelog : use a separate changelog for each type of pre-release
  • --separate-pre-releases : changes in the changelog will always relate to the latest release of the same pre-release type

(and their respective implementation)

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

When --separate-pre-releases is used entries (features and fixes) should appear in a release even if they technicaly belong to a pre release

When --separate-pre-changelog is used a changelog for each pre-release type should exist and be maintained by cz.

Steps to Test This Pull Request

(cz being my modified version)

mkdir test
cd test
git init
echo "{ \"commitizen\": { \"name\": \"cz_conventional_commits\", \"version\": \"0.1.0\",\"tag_format\": \"$version\",\"update_changelog_on_bump\": true } }" >> cz.json
touch f1
git add .
git commit -m "feat: 1"
cz bump

touch f2
git add .
git commit -m "feat: 2"
cz bump -pr beta
cz bump -pr rc --separate-pre-releases

touch fix
git add .
git commit -m "fix: 3"
cz bump --separate-pre-releases

Expected:

The CHANGELOG.md should look like this:

## 0.3.0
### Feat
* 2
### Fix
* 3

## 0.3.0rc0
### Feat
* 2

## 0.3.0b0
### Feat
* 2

## 0.2.0
### Feat
* 1

Additional context

This issue is kind of a draft, as i found no guidance of how to contribute.

While the PR template tells me what to do i do now know how. I cannot execute the above testcases as when i run python3 __main__.py the imports use my local installation of comittizen (using venv and also not using venv) instead of my modified code. I also do not rly know what how to write or execute test cases. do i need to remove my local installation and do something like pip install my repo?

I would love to contribute hight quality (well tested and documented etc) but as there is no documentation of how to contribute, I am a little stuck. (i followed the instructions in docs/contributing.md)

If you would be so kind to provide some basic information and feedback i would check all the requirements.

(Some of this issues might be related to my very little development experience in python as i never dealt with package management etc. but I think a person should be able to contribute without greater knowledge about the eco-system)

Adresses issues

@yajo
Copy link
Contributor

yajo commented Dec 29, 2022

I'd appreciate it if this behavior could be configured in the .cz.toml file. Is it so?

@nbrugger-tgm
Copy link
Author

I'd appreciate it if this behavior could be configured in the .cz.toml file. Is it so?

Hi, well no. It would be very nice indeed to have this as config keys. As you see I opened this pr over a year ago and didn't progressed with it since I don't know how (read 'Additional Context' from the pr description) I was guessing that this change isn't welcome or that the maintainers do not have the time to help in such situations. My changes are not unit tested just "use tested". And if I am completely honest I am not eager to do this atm, since I 1. don't rly like python and 2. Therefore have a suboptimal to no python dev setup and no knowledge how to write the tests how to execute them (like layed out in Additional Context)

But this said the implementation, while being untested seemed rather complete to me. I would love to see that someone takes it over since at this point after 1 year of no reply I probably know less about my own code than the maintainers - since they at least know the language and the environment

@nbrugger-tgm
Copy link
Author

This is a failed attempt by me. I am not good enough with python. The feature was now implemented by proper devs :')

Their implementation does not cover everything but it is a start -better than the mess that i created

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

Successfully merging this pull request may close these issues.

3 participants