Skip to content

feat(changelog): modify changelog template to support changelog updates - #1045

Merged
codejedi365 merged 54 commits into
python-semantic-release:masterfrom
codejedi365:feat/updating-changelogs
Oct 7, 2024
Merged

codejedi365 merged 54 commits into
python-semantic-release:masterfrom
codejedi365:feat/updating-changelogs

Conversation

@codejedi365

@codejedi365 codejedi365 commented Oct 1, 2024 •

Copy link
Copy Markdown
Contributor

Purpose

  • Provide an implementation via Jinja templates to only update (rather than overwrite) a changelog

Rationale

How did you test?

Very thorough manual and automated testing

@codejedi365 codejedi365 self-assigned this Oct 1, 2024
@codejedi365
codejedi365 force-pushed the feat/updating-changelogs branch 12 times, most recently from 27aa45e to bb203ea Compare October 7, 2024 06:17
This feature adds a filter that will enable jinja templates to read a file
from the repository into memory to then use as output within the template.
The primary use for this is to read in a previous changelog file which then
the template can give the illusion of insertion as it re-writes the entire
file.
Adds a flag that can be passed to the templating environment to allow
for triggering an update mode of a changelog versions an initialization
mode. The usage is up to the template developer but for PSR it is used
to handle changelog generation vs changelog updating.
This adds a string that represents a filename to a previous changelog file
which can be read from inside the template context. The primary use is for
enabling the updating of a changelog through jinja templating.
… context

This adds a customizable string to the jinja templating context which allows users
to use the PSR configuration to pass a custom insertion flag into the templating
context. This is intended for use with initializing a changelog and then updating
it from that point forward.
It would be nice to maintain file streaming for better memory usage but it
prevents the ability to read the file contents previously from within the
template which is a desire in order to insert into a previous changelog.
In this case, the memory usage is likely not a problem for large text files.
Since this project is generally rendering non-html content such as RST or MD,
change the default of the jinja autoescape parameter to false instead of true.
When it was true, it would automatically convert any `&` ampersands to its
htmlentity equivalent `&` which is completely unnecessary and unreadable in
non-html documents.
By popular demand, the desire to only prepend new information to the changelog
is now possible given the `changelog.mode = update` configuration option.

Resolves: python-semantic-release#858, python-semantic-release#722
@codejedi365
codejedi365 force-pushed the feat/updating-changelogs branch from bb203ea to 65aacb2 Compare October 7, 2024 06:55
@codejedi365
codejedi365 force-pushed the feat/updating-changelogs branch from 65aacb2 to 81aabfb Compare October 7, 2024 07:12
@codejedi365
codejedi365 merged commit c18c245 into python-semantic-release:master Oct 7, 2024
@codejedi365
codejedi365 deleted the feat/updating-changelogs branch October 7, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant