Skip to content

Fix changelog template splitting multi-line entries into duplicate bullets (#69454)#69458

Merged
dwoz merged 1 commit into
saltstack:3008.xfrom
dwoz:fix/issue-69454
Jun 17, 2026
Merged

Fix changelog template splitting multi-line entries into duplicate bullets (#69454)#69458
dwoz merged 1 commit into
saltstack:3008.xfrom
dwoz:fix/issue-69454

Conversation

@dwoz

@dwoz dwoz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the towncrier-based changelog generator, which has been splitting every multi-line
changelog fragment into one bullet per source line and appending the [#NNNN] issue link
to every single bullet. The template is replaced with a single-bullet render that uses
Jinja's indent(2) filter so wrapped fragments stay one bullet with the link appended
once. Already-published broken entries in CHANGELOG.md, pkg/rpm/salt.spec and
pkg/debian/changelog are also cleaned up.

What issues does this PR fix or reference?

Fixes #69454

Previous Behavior

A fragment such as changelog/69031.fixed.md, wrapped at ~72 columns, rendered in
CHANGELOG.md as:

- Fixed two distinct bugs in the `salt.engines.redis_sentinel` engine that [#69031](https://github.com/saltstack/salt/issues/69031)
- together prevented it from being usable. `start()` no longer raises [#69031](https://github.com/saltstack/salt/issues/69031)
- `AttributeError: 'dict_values' object has no attribute 'pop'` on Python 3 [#69031](https://github.com/saltstack/salt/issues/69031)
...

Eight bullets, each with the same duplicated [#69031] link, sentences sheared in half
at the source line breaks. Repeated for every multi-line fragment in the
v3008.0/v3008.1 release notes and across pkg/rpm/salt.spec and pkg/debian/changelog.

New Behavior

- Fixed two distinct bugs in the `salt.engines.redis_sentinel` engine that
  together prevented it from being usable. `start()` no longer raises
  `AttributeError: 'dict_values' object has no attribute 'pop'` on Python 3
  ...
  working unchanged. [#69031](https://github.com/saltstack/salt/issues/69031)

One top-level bullet, continuation lines indented under it (Markdown reads them as part
of the same list item), and the issue link appended exactly once at the end.

Fragments that intentionally include Markdown-style nested sub-bullets ( - item) are
unaffected: their indentation is preserved verbatim and they continue to render as a
nested sub-list under the single top-level bullet.

Scope of the diff

  1. changelog/.template.jinja — replace the per-line loop introduced in
    808241d3154d with a single-bullet indent(2) render.
  2. tests/pytests/unit/changelog/test_template.py — new TDD-verified unit
    tests covering single-line, multi-line wrapped, multi-fragment, and
    nested-sub-bullet cases. The multi-line test fails on the unmodified
    template (8 top-level bullets where 1 is expected) and passes with the
    fix.
  3. CHANGELOG.md, pkg/rpm/salt.spec, pkg/debian/changelog — 118
    already-published broken multi-bullet entries consolidated back into
    single bullets. Original sentence content is preserved verbatim; only
    the broken line breaks between adjacent same-link bullets are stitched
    back together. Affected release sections: 3008.1, 3008.0,
    3008.0rc4, 3008.0rc3, 3008.0rc2, 3008.0rc1, 3006.25.

Merge requirements satisfied?

  • Docs (no documented behavior change; only the rendered output of an internal tool)
  • Changelog (changelog/69454.fixed.md)
  • Tests written/updated (tests/pytests/unit/changelog/test_template.py)

Commits signed with GPG?

Yes

…bullets

The towncrier template at changelog/.template.jinja was splitting every
multi-line fragment on `\n`, emitting a `- ` bullet per source line, and
appending the issue link to each line. A fragment that wrapped at 72
columns came out as N broken bullets all tagged with the same
[#NNNN] link.

Render `text` once as a single bullet with `| indent(2)` so continuation
lines are indented under the bullet, with the issue link appended once
at the end. Fragments that include Markdown-style nested sub-bullets
(`  - foo`) continue to render correctly because the indentation is
preserved verbatim.

Also clean up the already-published broken entries in CHANGELOG.md,
pkg/rpm/salt.spec, and pkg/debian/changelog (118 entries across the
3008.0rc1/rc2/rc3/rc4, 3008.0, 3008.1, and 3006.25 sections) by merging
each broken multi-bullet run back into a single bullet with one link.
Original sentence content is preserved verbatim; only the line breaks
between the broken bullet fragments are stitched back together.

Fixes saltstack#69454
@dwoz dwoz requested a review from a team as a code owner June 16, 2026 07:44
@dwoz dwoz added this to the Argon v3008.1 milestone Jun 16, 2026
@dwoz dwoz added the test:full Run the full test suite label Jun 16, 2026
dwoz added a commit that referenced this pull request Jun 17, 2026
Defensive backport from #69458 (3008.x). The 3006.x changelog template
already rendered single-line correctly, but lacked the `| indent(2)`
filter so wrapped multi-line fragments did not get their continuation
lines indented under the bullet. Apply the same one-line template
hardening from #69458 (`{{ text | indent(2) }}`) and copy the five
regression tests so a future merge-forward or hand-edit cannot
reintroduce the per-line bullet split bug reported in #69454.

No CHANGELOG.md / pkg/rpm/salt.spec / pkg/debian/changelog cleanup is
needed on 3006.x: the broken pattern was never released here.
@dwoz dwoz merged commit 375b272 into saltstack:3008.x Jun 17, 2026
488 of 493 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant