Add news fragments#

This guide shows you how to add a news fragment to the package a change belongs to. It also shows how to check the fragments before you push.

Find where the fragment goes#

Make your change first. Then ask repoplone which parts of the repository need a fragment.

uvx repoplone changelog check

The command compares your branch with origin/main, including uncommitted and untracked files. It prints a table with one row per area: each package, and the repository itself. For each area missing a fragment, it names the news folder to add it to.

Missing a news fragment:
- fake.distribution: add one to backend/news/

To compare with another branch, pass it with --compare-with.

uvx repoplone changelog check --compare-with origin/1.x

Write the fragment#

Create a file in that news folder, named after the issue and the type of change.

echo 'Fix the search results order. @yourhandle' > backend/news/42.bugfix

The name has two parts. The first part is the issue number. For a change without an issue, use + and a short slug, such as +search-order.bugfix. The second part is the type of change. The valid types are the ones the area’s towncrier configuration lists, such as feature, bugfix, or internal.

The content is the changelog entry. Write one or two sentences in the present tense, and end with the handle of the author, as Plone projects do.

Preview the changelog#

Show the changelog that the next release would write.

uvx repoplone changelog preview

The draft shows the new version, with one section per package and one for the repository. It writes nothing.

Check again#

Run the check once more.

uvx repoplone changelog check

It exits with 0 and prints Every area that changed has a news fragment. when every area that changed has its fragment.

See also