A Go tool that fills the upstream changelog section in CHANGELOG.md during a release.
make chlog-update (via chloggen) generates a new version section with placeholder comments.
This tool fetches the upstream .chloggen/*.yaml entry files from the upstream "prepare release" PRs,
filters them to components included in this distribution, and replaces those placeholders with real content.
# Upstream release: fill placeholders with content from the upstream PRs
GITHUB_TOKEN=$(gh auth token) ./bin/changelog-generator \
https://github.com/open-telemetry/opentelemetry-collector/pull/14515 \
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/45836
# Multi-version upgrade: pass all upstream PR URLs
GITHUB_TOKEN=$(gh auth token) ./bin/changelog-generator \
https://github.com/open-telemetry/opentelemetry-collector/pull/14515 \
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/45836
# Distro-only release (no upstream bump): removes the upstream placeholder section entirely
GITHUB_TOKEN=$(gh auth token) ./bin/changelog-generator
# Dry-run: print the generated pieces to stdout without modifying any files
GITHUB_TOKEN=$(gh auth token) ./bin/changelog-generator -dry-run \
https://github.com/open-telemetry/opentelemetry-collector/pull/14515 \
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/45836| Flag | Default | Description |
|---|---|---|
-manifest |
manifest.yaml |
Path to manifest.yaml |
-config |
internal/changelog-generator/config.yaml |
Path to allow/denylist config |
-changelog |
CHANGELOG.md |
Path to CHANGELOG.md |
-dry-run |
false |
Print to stdout without modifying files |
go build -o ./bin/changelog-generator ./internal/changelog-generator-
make chlog-update VERSION="vX.Y.Z"runschloggen, which consumes distro.chloggen/*.yamlentries and writes a new version section intoCHANGELOG.mdusingsummary.tmpl. The template includes named placeholder comments (<!-- upstream-version -->,<!-- upstream-collector-versions -->,<!-- upstream-breaking-changes -->,<!-- upstream-other-changes -->) wrapped in<!-- upstream-start -->/<!-- upstream-end -->boundary markers. -
This tool then fills those placeholders:
- Reads
manifest.yamlto build the set of included upstream component IDs. - For each supplied PR URL, fetches
.chloggen/*.yamlfiles from the PR's base commit via the GitHub Contents API (entries live at the base because the PR deletes them on merge), and readsversions.yamlfrom the head commit to determine the upstream release version. - Filters entries against the component set and the allow/denylist from
config.yaml. - Renders filtered entries into the four placeholder slots and removes the boundary markers.
- When no PR URLs are provided, removes the entire
<!-- upstream-start -->…<!-- upstream-end -->block.
- Reads
# Always include entries for these component identifiers (exact or prefix match).
allowlist:
- "pkg/ottl"
- "all" # entries with component "all" affect every component
# Always exclude. Denylist takes precedence over allowlist and manifest components.
# Supports glob suffix (*) for prefix matching.
denylist:
- "internal/*"
- "cmd/*"- To add a shared package: add it to
allowlist(e.g.pkg/newpackage). - To suppress a component even if it's in
manifest.yaml: add it todenylist.
Component IDs are derived from manifest.yaml gomod paths:
manifest.yaml gomod |
Upstream component ID |
|---|---|
go.opentelemetry.io/collector/receiver/otlpreceiver |
receiver/otlp |
.../receiver/filelogreceiver |
receiver/filelog |
.../processor/resourcedetectionprocessor |
processor/resourcedetection |
.../extension/storage/filestorage |
extension/filestorage |
The type suffix is stripped from the last path segment (e.g. filelogreceiver → filelog).
The tool is wrapped by .github/workflows/upstream-changelog.yml, which:
- Runs
make chlog-updateto consume distro entries and write the scaffold. - Runs this tool to fill the upstream placeholders.
- Bumps
dist.versioninmanifest.yamlandOTEL_UPSTREAM_VERSIONinMakefile. - Opens a PR labelled
Skip Changelogfor human review.
Actions → "Generate Upstream Changelog" → Run workflow
Inputs:
core_pr_url (required) upstream core "prepare release" PR URL
contrib_pr_url (required) upstream contrib "prepare release" PR URL
extra_pr_urls (optional) comma-separated additional PR URLs for multi-version upgrades
dist_version (optional) e.g. 0.46.0 — auto-bumps minor version if omitted
cd internal/changelog-generator
go test ./...GITHUB_TOKEN not set / 403 errors
export GITHUB_TOKEN=$(gh auth token)"no valid upstream versions found"
Each PR must have a versions.yaml at its head commit with a valid semver. The tool reads the
version from module-sets.beta.version (core) or module-sets.contrib-base.version (contrib).
Entry not appearing in output
Run with -dry-run and check the info: lines on stderr. If a component is missing, add it to
allowlist in config.yaml.