ci: validate changelog fragment filenames#4586
Open
MikeGoldsmith wants to merge 1 commit into
Open
Conversation
Extend the existing fragment-existence check so it also rejects fragments whose basename doesn't match <PR_NUMBER>.<type> (where type is one of added, changed, deprecated, removed, fixed). This catches typos in the PR number or in the fragment type that would otherwise render a wrong PR link, or be silently dropped, in the rendered changelog. Also note in the do-not-edit comment of each towncrier-managed CHANGELOG.md (root and the 4 independent packages) that the existing static "## Unreleased" entries pre-date towncrier and 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)
emdneto
approved these changes
May 15, 2026
| invalid=() | ||
| while IFS= read -r f; do | ||
| base=$(basename "$f") | ||
| if [[ ! "$base" =~ ^([0-9]+)\.(added|changed|deprecated|removed|fixed)$ ]]; then |
Member
There was a problem hiding this comment.
Can you put a comment in the towncrier config saying that in case of changes in the nomenclature of changelog files, we also need to update the CI logic here?
xrmx
reviewed
May 15, 2026
|
|
||
| This changelog is managed by towncrier and is compiled at release time. | ||
|
|
||
| The static "## Unreleased" section below pre-dates towncrier; its entries |
Contributor
There was a problem hiding this comment.
Do we still need these hunks since you have converted them already?
xrmx
approved these changes
May 15, 2026
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
Extends the existing fragment-existence check so each newly added changelog fragment is also validated by basename against
<PR_NUMBER>.<type>(where<type>∈added | changed | deprecated | removed | fixed). Catches two failure modes the existence check doesn't:4321.fixedon PR Update OpAMP client to have additional callback methods #4322) — the rendered changelog entry links to the wrong PR.4322.fix) — towncrier silently treats it as untyped on build.Also adds a one-line note to the do-not-edit comment in each towncrier-managed
CHANGELOG.md(root + the 4 independent packages:opamp-client,resource-detector-azure,propagator-aws-xray,sdk-extension-aws) flagging 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.Same fixes also being applied to
opentelemetry-python(open-telemetry/opentelemetry-python#5212) and originally caught inopentelemetry-python-genai(open-telemetry/opentelemetry-python-genai#16).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)