-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Adds towncrier, a tool for changelog generation #9803
base: master
Are you sure you want to change the base?
Conversation
Example output from
Note that in an actual release, the |
27f63d4
to
8cc2210
Compare
This lets us generate a categorized changelog automagically from text snippets in the new newsfragments directory. The suffix of each of these plaintext files determines the category (fix, doc, misc, etc). More info at https://towncrier.readthedocs.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an approach like this is definitely promising! Thanks for playing with it.
If you want to keep working on this, in addition to my inline comments, I think we might want to:
- Consider adding a gitignore file to stop git from deleting the newsfragments directory.
- Update any dev docs like our PR template instructing people how to use the new system.
- Make sure the newsfragments and
CHANGELOG.md
are currently in sync withmaster
before this is merged.
I'd suggest we wait to do this until we're about ready to merge this to do this last one, but I'm saying it now to help you/I remember.
package = "certbot" | ||
directory = "newsfragments" | ||
filename = "CHANGELOG.md" | ||
template = "tools/changelog_template.jinja" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this template? I had to run pip install -U towncrier
in my virtual environment to get it to work, but after doing that and comparing the output of towncrier build --draft
, it doesn't seem to be having an effect? Is this what you're seeing too?
towncrier build | ||
git add certbot/CHANGELOG.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd need want further changes in this file right? At first I thought we just might to add --yes
to build to automatically delete newsfragments, but I think it's more than that.
The changelog is essentially modified twice in this script as the script is in master
. We first fix up the running .dev0
changelog for the release and then we add the running changelog for our next release in the section of the script I'm commenting on here.
I think we'd essentially want to delete everything here and then use towncrier
for the first set of changelog modifications right? This is totally doable, but I think it takes some refactoring as those changelog modifications are currently done before the version number is updated and our release instructions tell you to deactivate the virtual environment before running the release so the person doing the release probably doesn't have towncrier
installed.
If you decide to play with this more, you can do test releases by following the release instructions where you can set RELEASE_GPG_KEY
to some random key rather than using the trusted key.
@@ -198,15 +198,7 @@ while ! git commit --gpg-sign="$RELEASE_GPG_KEY" -m "Release $version"; do | |||
done | |||
git tag --local-user "$RELEASE_GPG_KEY" --sign --message "Release $version" "$tag" | |||
|
|||
# Add master section to CHANGELOG.md | |||
header=$(head -n 4 certbot/CHANGELOG.md) | |||
body=$(sed s/nextversion/$nextversion/ tools/_changelog_top.txt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, I think we can also delete tools/_changelog_top.txt
🎉
This lets us generate a categorized changelog automagically from text snippets in the new newsfragments directory. The suffix of each of these plaintext files determines the category (fix, doc, misc, etc).
More info at https://towncrier.readthedocs.io
Fixes #8272