Skip to content

ci: introduce towncrier to generate changelog from fragments#4573

Merged
aabmass merged 7 commits into
open-telemetry:mainfrom
honeycombio:mike/towncrier
May 12, 2026
Merged

ci: introduce towncrier to generate changelog from fragments#4573
aabmass merged 7 commits into
open-telemetry:mainfrom
honeycombio:mike/towncrier

Conversation

@MikeGoldsmith
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith commented May 12, 2026

Description

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.

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 root CHANGELOG.md at release time.

Independently released packages (4 packages): each has its own .changelog/ dir and towncrier config, compiled into per-package CHANGELOG.md.

Independent packages:

  • opentelemetry-opamp-client
  • opentelemetry-propagator-aws-xray
  • opentelemetry-resource-detector-azure
  • opentelemetry-sdk-extension-aws

Note: GenAI packages are already in [exclude_release] and are being moved out of this repo — no towncrier setup added for them.

What changed

Core towncrier setup:

  • pyproject.toml: towncrier config with 5 fragment types (added, changed, deprecated, removed, fixed), pinned towncrier==25.8.0 in CI
  • scripts/changelog_template.j2: shared Jinja2 template for changelog output
  • CHANGELOG.md: <!-- changelog start --> marker added, do-not-edit comment

Per-package setup (4 independent packages):

  • Each package's pyproject.toml: towncrier config pointing to shared template
  • Each package's CHANGELOG.md: marker + do-not-edit comment
  • Each package gets a .changelog/ directory

CI & workflows:

  • .github/workflows/changelog.yml: rejects direct CHANGELOG.md edits, validates fragments exist via git diff, previews rendered changelog
  • .github/workflows/prepare-release-branch.yml: sedtowncrier build
  • .github/workflows/prepare-patch-release.yml: same + adds backport step to sync changelog to main
  • .github/workflows/package-prepare-release.yml: sedtowncrier build --dir <package>
  • .github/workflows/package-prepare-patch-release.yml: same

Documentation:

  • CONTRIBUTING.md: changelog section with fragment guidance for both coordinated and independent packages
  • RELEASING.md: updated backporting section

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • towncrier build --draft --version Unreleased at root — verified fragment parsing and output
  • towncrier build --draft --version "1.2.0" --dir propagator/opentelemetry-propagator-aws-xray — verified per-package build
  • Both produce correctly formatted output with PR links and categories

Does This PR Require a Core Repo Change?

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

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
@MikeGoldsmith MikeGoldsmith requested a review from a team as a code owner May 12, 2026 10:54
@MikeGoldsmith MikeGoldsmith added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 12, 2026
Comment thread RELEASING.md Outdated
Copy link
Copy Markdown
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

One small comment

Comment thread .github/workflows/prepare-patch-release.yml
- Remove towncrier explanation sentence from RELEASING.md (per @xrmx)
- Add changelog backport step to prepare-patch-release.yml to sync
  changelog from release branch to main (per @emdneto, matching core)

Assisted-by: Claude Opus 4.6
@MikeGoldsmith MikeGoldsmith moved this to Ready for merge in Python PR digest May 12, 2026
@aabmass aabmass enabled auto-merge (squash) May 12, 2026 17:22
@aabmass aabmass merged commit a651600 into open-telemetry:main May 12, 2026
752 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for merge to Done in Python PR digest May 12, 2026
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>
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: Done

Development

Successfully merging this pull request may close these issues.

4 participants