introducing towncrier
to generate changelog from fragments
#4382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #4307
Hopefully, also Fix #4309
Description
Towncrier is a tool adopted in some well-known python projects to generate release notes from fragments. In otel-python we are always dealing with
CHANGELOG.md
conflicts during rebases, specially after releases. So, this can help us with it since now we have a changelog entry for each PR in the.changelog
directory. This is similar tochloggen
adopted inopentelemetry-collector
.How it works:
Creating a Changelog Fragment:
.changelog
directory in the format<PR_NUMBER>.<CATEGORY>
, where<CATEGORY>
can beadded
,changed
,fixed
, etc.#1234
fixing a bug would create a file named./.changelog/1234.fixed
containing a short description of the change.Releasing:
towncrier build --yes
. This command:.changelog
directory.CHANGELOG.md
with the generated content.The configuration is pretty simple and we can customize the changelog as we want using jinja templates and also customize the category names.
I tested the changes using https://github.com/nektos/act:
act -W '.github/workflows/changelog.yml' --eventpath event.json
If you checkout this branch and run
towncrier build --yes --version=1.30.0/0.51b0
The generated changelog for this branch will be: