Skip to content

ci: validate changelog fragment filenames#4586

Open
MikeGoldsmith wants to merge 1 commit into
open-telemetry:mainfrom
MikeGoldsmith:mike/changelog-fragment-validation
Open

ci: validate changelog fragment filenames#4586
MikeGoldsmith wants to merge 1 commit into
open-telemetry:mainfrom
MikeGoldsmith:mike/changelog-fragment-validation

Conversation

@MikeGoldsmith
Copy link
Copy Markdown
Member

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:

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 ## Unreleased entries pre-date towncrier and need folding into the first towncrier-generated release manually — towncrier build inserts 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 in opentelemetry-python-genai (open-telemetry/opentelemetry-python-genai#16).

Test plan

  • CI runs the new validation step on this PR (which has the Skip Changelog label, 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)
  • Confirm the existence check still gates on at least one fragment being added

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)
@MikeGoldsmith MikeGoldsmith requested a review from a team as a code owner May 15, 2026 08:53
@MikeGoldsmith MikeGoldsmith added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 15, 2026
@MikeGoldsmith MikeGoldsmith moved this to Ready for review in Python PR digest May 15, 2026
invalid=()
while IFS= read -r f; do
base=$(basename "$f")
if [[ ! "$base" =~ ^([0-9]+)\.(added|changed|deprecated|removed|fixed)$ ]]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?


This changelog is managed by towncrier and is compiled at release time.

The static "## Unreleased" section below pre-dates towncrier; its entries
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need these hunks since you have converted them already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants