ci: validate changelog fragment filenames#5212
Open
MikeGoldsmith wants to merge 2 commits into
Open
Conversation
Add a workflow step that rejects fragments whose basename doesn't match <PR_NUMBER>.<type> (where type is one of added, changed, deprecated, removed, fixed). This catches typos in either the PR number or the fragment type before they produce a misleading PR link in the rendered changelog. towncrier check verifies a fragment exists; it doesn't enforce naming. Also note in the do-not-edit comment of the root CHANGELOG.md that the existing static "## Unreleased" entries must be folded into the first towncrier-built release manually — towncrier inserts new release blocks above that section without merging. Assisted-by: Claude Opus 4.7 (1M context)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CI step that validates each newly added changelog fragment's basename against
<PR_NUMBER>.<type>(where<type>∈added | changed | deprecated | removed | fixed). Catches two failure modes thattowncrier checkdoesn't:4321.fixedon PR Logs SDK: ConsoleLogExporter prints severity number as object, not a number #4322) — the rendered changelog entry links to the wrong PR.4322.fix) — towncrier silently treats it as untyped on build.Both currently slip through because
towncrier checkonly verifies that a fragment was added, not what it's called.Also adds a one-line note to the do-not-edit comment in the root
CHANGELOG.mdflagging that the existing static## Unreleasedentries pre-date towncrier and need folding into the first towncrier-generated release manually —towncrier buildinserts new release blocks above that section rather than merging into it.Same fixes ported back from
opentelemetry-python-genaiPR open-telemetry/opentelemetry-python-genai#16 where they were originally caught.Test plan
Skip Changeloglabel, so the workflow as a whole skips — verification of the validation itself is via a follow-up PR that intentionally adds a bad fragment, or by inspection of the workflow logic)towncrier checkstill gates on fragment existence