Skip to content

fix(changelog): include non-leading release metadata - #1472

Open
yangfan-yf-yf wants to merge 1 commit into
python-semantic-release:masterfrom
yangfan-yf-yf:agent/changelog-nonleading-release-metadata
Open

fix(changelog): include non-leading release metadata#1472
yangfan-yf-yf wants to merge 1 commit into
python-semantic-release:masterfrom
yangfan-yf-yf:agent/changelog-nonleading-release-metadata

Conversation

@yangfan-yf-yf

@yangfan-yf-yf yangfan-yf-yf commented Jul 25, 2026

Copy link
Copy Markdown

Purpose

Fixes #1471. The default changelog templates omit a breaking-change description or release notice when it belongs to a commit that is not the first commit in its category.

Rationale

The existing dotted attribute path 1.0 selects only index 0 from each category. The templates now flatten every category's commit list before filtering for breaking_descriptions and release_notices.

How did you test?

  • Added a regression fixture where a newer ordinary commit precedes both a breaking commit and a release-notice commit in their respective categories.
  • Verified the default Markdown and reStructuredText changelogs both include the omitted sections and descriptions.
  • Ran pytest tests/unit/semantic_release/changelog/test_default_changelog.py -q: 34 passed.
  • Ran Ruff format and lint checks on the changed tests.
  • Ran pytest tests/unit/semantic_release/changelog -m unit -q: 139 passed, 15 skipped; 7 pre-existing Windows newline expectation failures remain in test_release_notes.py, outside this change's code path.

How to Verify

  1. Run pytest tests/unit/semantic_release/changelog/test_default_changelog.py -k nonleading -vv.
  2. Confirm both md and rst cases pass.

PR Completion Checklist

  • Reviewed and followed the Contributor Guidelines.
  • Validation pipeline succeeds.
  • Commit follows the Conventional Commits standard.
  • Appropriate unit tests added.
  • No end-to-end test is needed because this is isolated default-template rendering behavior covered at the unit layer.
  • No documentation change is needed.

@yangfan-yf-yf
yangfan-yf-yf marked this pull request as ready for review July 25, 2026 08:16
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.

Breaking Changes / release-notices section only inspects the newest commit per type bucket, silently dropping other breaking commits

1 participant