Skip to content

Commit

Permalink
Update the changelog related documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Feb 17, 2023
1 parent 640f850 commit b15106b
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions doc/topics/development/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ How do I add a changelog entry
------------------------------

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 ``cve-<cve-number>.security``.
The file name should follow the syntax ``<issue #>.<type>.md``. If it is a security
fix then the following syntax will need to be used ``cve-<cve-number>.security.md``.

The types are in alignment with keepachangelog:

Expand All @@ -44,12 +44,12 @@ The types are in alignment with keepachangelog:


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
look like this: `changelog/1234.fixed.md`. 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
name (``<PR #>.<type>``).
name (``<PR #>.<type>.md``).

For a security fix your filename would look like this: changelog/cve-2021-25283.security.
For a security fix your filename would look like this: `changelog/cve-2021-25283.security.md`.

If your PR does not align with any of the types, then you do not need to add a
changelog entry.
Expand All @@ -72,10 +72,19 @@ This step is only used when we need to generate the changelog right before relea
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
You can run the `towncrier` tool directly or you can use `tools` to help run the command
and ensure towncrier is installed in a virtual environment. The instructions below
will detail both approaches.


Installing `tools`
..................

.. code-block: bash
python -m pip install -r requirements/static/ci/py3.10/tools.txt
If you want to see what output towncrier will produce before generating the change log
you can run towncrier in draft mode:

Expand All @@ -85,7 +94,7 @@ you can run towncrier in draft mode:
.. code-block:: bash
nox -e 'changelog(force=False, draft=True)' -- 3000.1
tools changelog update-changelog-md --draft 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:
Expand All @@ -96,17 +105,22 @@ confident the draft output looks correct you can now generate the changelog by r
.. code-block:: bash
nox -e 'changelog(force=False, draft=False)' -- 3000.1
tools changelog update-changelog-md 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.


.. code-block:: bash
nox -e 'changelog(force=True, draft=False)' -- 3000.1
towncrier --yes --version=3001
The `tools changelog update-changelog-md <version>` command will automatically add `--yes` if `--draft` is not passed.


.. _`SEP 01`: https://github.com/saltstack/salt-enhancement-proposals/pull/2
Expand Down

0 comments on commit b15106b

Please sign in to comment.