ci: introduce towncrier to generate changelog from fragments#4573
Merged
Conversation
Replace manual CHANGELOG.md editing with towncrier fragment-based changelog management. Each PR adds a small text file in .changelog/ instead of editing the changelog directly, eliminating merge conflicts. Root .changelog/ is used for coordinated releases (most packages). Per-package .changelog/ dirs are used for independently released packages (opamp-client, propagator-aws-xray, resource-detector-azure, sdk-extension-aws). Changes: - Add towncrier config to root pyproject.toml and 4 independent package pyproject.toml files - Add shared Jinja2 template at scripts/changelog_template.j2 - Replace sed-based changelog generation with towncrier build in all release workflows (coordinated + per-package) - Rewrite changelog CI to use towncrier check for fragment validation - Add do-not-edit comments and towncrier markers to all CHANGELOG.md files - Update CONTRIBUTING.md with changelog fragment guidance - Update RELEASING.md to reflect towncrier workflow - Add towncrier to dev dependencies Assisted-by: Claude Opus 4.6
xrmx
approved these changes
May 12, 2026
emdneto
approved these changes
May 12, 2026
7 tasks
aabmass
approved these changes
May 12, 2026
6 tasks
xrmx
pushed a commit
that referenced
this pull request
May 15, 2026
* migrate unreleased changelog entries to towncrier fragments Convert existing entries from ## Unreleased sections into towncrier fragment files, completing the migration started in #4573. Root CHANGELOG.md: 25 entries migrated to .changelog/ propagator-aws-xray: 2 entries migrated resource-detector-azure: 2 entries migrated sdk-extension-aws: 2 entries migrated opamp-client: 0 entries (section was empty) The ## Unreleased sections are removed since towncrier now manages changelog generation from fragment files at release time. GenAI package changelogs are not migrated as those packages are being moved out of this repo. Assisted-by: Claude Opus 4.6 * fix fragment PR number for sdk-extension-aws 3366.added → 3761.added (3366 was the issue, 3761 is the PR) Per review from @xrmx. Assisted-by: Claude Opus 4.6 --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
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.
Description
Replace manual
CHANGELOG.mdediting with towncrier fragment-based changelog management. Each PR adds a small text file in.changelog/instead of editing the changelog directly, eliminating merge conflicts.This mirrors the setup in the core repo (open-telemetry/opentelemetry-python#5187), extended with per-package support for independently released packages.
Coordinated packages (~62 packages): fragments go in root
.changelog/, compiled into rootCHANGELOG.mdat release time.Independently released packages (4 packages): each has its own
.changelog/dir and towncrier config, compiled into per-packageCHANGELOG.md.Independent packages:
opentelemetry-opamp-clientopentelemetry-propagator-aws-xrayopentelemetry-resource-detector-azureopentelemetry-sdk-extension-awsWhat changed
Core towncrier setup:
pyproject.toml: towncrier config with 5 fragment types (added,changed,deprecated,removed,fixed), pinnedtowncrier==25.8.0in CIscripts/changelog_template.j2: shared Jinja2 template for changelog outputCHANGELOG.md:<!-- changelog start -->marker added, do-not-edit commentPer-package setup (4 independent packages):
pyproject.toml: towncrier config pointing to shared templateCHANGELOG.md: marker + do-not-edit comment.changelog/directoryCI & workflows:
.github/workflows/changelog.yml: rejects direct CHANGELOG.md edits, validates fragments exist viagit diff, previews rendered changelog.github/workflows/prepare-release-branch.yml:sed→towncrier build.github/workflows/prepare-patch-release.yml: same + adds backport step to sync changelog to main.github/workflows/package-prepare-release.yml:sed→towncrier build --dir <package>.github/workflows/package-prepare-patch-release.yml: sameDocumentation:
CONTRIBUTING.md: changelog section with fragment guidance for both coordinated and independent packagesRELEASING.md: updated backporting sectionType of change
How Has This Been Tested?
towncrier build --draft --version Unreleasedat root — verified fragment parsing and outputtowncrier build --draft --version "1.2.0" --dir propagator/opentelemetry-propagator-aws-xray— verified per-package buildDoes This PR Require a Core Repo Change?
Checklist: