With the addition of SEP 01 the keepachangelog format was introduced into
our CHANGELOG.md file. The Salt project is using the towncrier tool to manage
the CHANGELOG.md file. The reason this tool was added to manage the changelog
was because we were previously managing the file manually and it would cause
many merge conflicts. This tool allows us to add changelog entries into separate
files and before a release we simply need to run
for it to compile the changelog correctly.
To add a changelog entry you will need to add a file in the changelog directory.
The file name should follow the syntax
<issue #>.<type>. If it is a security
fix then the following syntax will need to be used
The types are in alignment with keepachangelog:
any features that have been removed
any features that will soon be removed
any changes in current existing features
any bug fixes
any new features added
any fixes for a cve
For example if you are fixing a bug for issue number #1234 your filename would
look like this: changelog/1234.fixed. The contents of the file should contain
a summary of what you are fixing. If there is a legitimate reason to not include
an issue number with a given contribution you can add the PR number as the file
For a security fix your filename would look like this: changelog/cve-2021-25283.security.
If your PR does not align with any of the types, then you do not need to add a changelog entry.
This step is only used when we need to generate the changelog right before releasing. You should NOT run towncrier on your PR, unless you are preparing the final PR to update the changelog before a release.
You can run the towncrier tool directly or you can use nox to help run the command and ensure towncrier is installed in a virtual environment. The instructions below will detail both approaches.
If you want to see what output towncrier will produce before generating the change log you can run towncrier in draft mode:
towncrier --draft --version=3001
nox -e 'changelog(force=False, draft=True)' -- 3000.1
Version will need to be set to whichever version we are about to release. Once you are confident the draft output looks correct you can now generate the changelog by running:
nox -e 'changelog(force=False, draft=False)' -- 3000.1
After this is run towncrier will automatically remove all the files in the changelog directory.
If you want to force towncrier to automatically remove all the files in the changelog directory without asking you to type yes, you can set force to True.
nox -e 'changelog(force=True, draft=False)' -- 3000.1