Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9255eac
ci: add chloggen and workflows for changelog generation
agarvin-nr Jul 7, 2026
73f59ff
chore: exclude check of config and template yaml
agarvin-nr Jul 7, 2026
5e84dcb
chore: exempt additional prefixes
agarvin-nr Jul 7, 2026
2d78772
chore: fix makefile and finish adding filename to make chlog-new
agarvin-nr Jul 7, 2026
fbe9856
chore: add trailing newline after chlog next version marker
agarvin-nr Jul 8, 2026
e9eca46
chore: add changelog entry to contributing md
agarvin-nr Jul 8, 2026
9a6b8ec
chore: relax restrictions on chlog-exempt prefixes to allow for chore…
agarvin-nr Jul 8, 2026
5f54e27
docs: slight reordering for doc clarity
agarvin-nr Jul 8, 2026
a0abc94
chore: include docs changes to changelog
agarvin-nr Jul 8, 2026
86758f5
chore: add changelog entry on ci-bump-component-version
agarvin-nr Jul 8, 2026
1e0b043
chore: automatically populate changelog on version bump pr
agarvin-nr Jul 8, 2026
74e30ad
chore: remove non-user-facing components from config and update readme
agarvin-nr Jul 9, 2026
e86cb3f
chore: add github release token and change component distribution
agarvin-nr Jul 9, 2026
6b36720
chore: fix extra echo issue and strip comments from version bump chlo…
agarvin-nr Jul 9, 2026
6279c76
chore: remove act exclusion from add_changelog_entry
agarvin-nr Jul 9, 2026
d1ad6be
chore: extract release notes and pass to goreleaser for release process
agarvin-nr Jul 9, 2026
b8dad2f
chore: remove unused changelog section
agarvin-nr Jul 9, 2026
c9f41a4
chore: add changelog entry for prs which predate these changes
agarvin-nr Jul 9, 2026
62078fb
chore: simplify component selection while generating changelogs
agarvin-nr Jul 9, 2026
c357bac
chore: tweak chloggen template
agarvin-nr Jul 9, 2026
9f2455f
chore: re-add useful components
agarvin-nr Jul 9, 2026
d98aa8c
chore: strip emojis from changelogs
agarvin-nr Jul 9, 2026
90577b3
chore: clarify chloggen component names
agarvin-nr Jul 9, 2026
fea2f7c
chore: add clarifying comment to template
agarvin-nr Jul 9, 2026
6a0bdd5
chore: remove comment reference to changelog-api.md
agarvin-nr Jul 9, 2026
7973252
chore: remove leftover unused code
agarvin-nr Jul 9, 2026
fd6757f
chore: remove unnecessary changes
agarvin-nr Jul 9, 2026
1a4c14d
chore: some small changes
agarvin-nr Jul 9, 2026
93d9f05
chore: make ci_bump_nrdot_version act-friendly
agarvin-nr Jul 9, 2026
7fc83a2
chore: install go for release-bump-version-pr script
agarvin-nr Jul 9, 2026
3e5787e
chore: add check to validate gha hashes uniform (expect failure)
agarvin-nr Jul 9, 2026
3307625
chore: rename new test (still expect failure)
agarvin-nr Jul 9, 2026
b202fcb
chore: fix misaligned commit hashes
agarvin-nr Jul 9, 2026
c4d34df
chore: add clarifying comment
agarvin-nr Jul 9, 2026
428a316
chore: separate version bump chlog gen into script for testing
agarvin-nr Jul 9, 2026
0931577
chore: chmod +x
agarvin-nr Jul 9, 2026
f3f1d12
chore: tiny formatting changes
agarvin-nr Jul 9, 2026
5fc4534
chore: remove [chore] from exempt since it is not allowed under linte…
agarvin-nr Jul 9, 2026
f523b9b
chore: expand on changelog debug helper message
agarvin-nr Jul 9, 2026
a0c8d59
chore: create initial PR as draft before chlog entry is made
agarvin-nr Jul 9, 2026
68f750a
chore: add trailing newline
agarvin-nr Jul 9, 2026
6797a8f
chore: add validation step to generate version bump script
agarvin-nr Jul 10, 2026
6e69111
chore: remove leading and trailing whitespace from extracted release …
agarvin-nr Jul 10, 2026
bcb8f69
chore: remove some irrelevant checklist items
agarvin-nr Jul 10, 2026
4fb49ed
chore: go mod tidy tools
agarvin-nr Jul 10, 2026
37d172b
chore: install chloggen as dependencies and remove make install-tools…
agarvin-nr Jul 10, 2026
a840cb0
chore: add janky translation layer
agarvin-nr Jul 10, 2026
8bb0997
chore: create wrapper around chloggen to allow for custome change types
agarvin-nr Jul 13, 2026
3a6a268
chore: chmod +x chloggen wrapper
agarvin-nr Jul 13, 2026
224dcdb
chore: change confusing helper message on change_type not inferred
agarvin-nr Jul 13, 2026
90ca848
chore: update template comments
agarvin-nr Jul 13, 2026
193e5d2
chore: add icons for print clarity
agarvin-nr Jul 13, 2026
69fa422
chore: fix existing chlog entry, remove docs from components
agarvin-nr Jul 13, 2026
833bda6
chore: minor wording change
agarvin-nr Jul 13, 2026
0656c6c
chore: code comments
agarvin-nr Jul 13, 2026
3d46f47
chore: code comments
agarvin-nr Jul 13, 2026
1d400de
chore: allow chloggen-wrapper to infer change type for generate-versi…
agarvin-nr Jul 13, 2026
153d8b5
chore: use more verbose change_type
agarvin-nr Jul 13, 2026
f0396d6
chore: update header
agarvin-nr Jul 13, 2026
c466abc
chore: add clarifying comment
agarvin-nr Jul 13, 2026
f710005
chore: remove chlog entry that was incluided in prior release
agarvin-nr Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .chloggen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Changelog folder

This repo uses `chloggen` to manage its changelog files. You can find the source code for the tool [here](https://github.com/open-telemetry/opentelemetry-go-build-tools/tree/main/chloggen).

Here is a quick explanation of the `config.yaml` file for chloggen:

```yaml
# The directory that stores individual changelog entries.
# Each entry is stored in a dedicated yaml file.
# - 'chloggen new' will copy the 'template_yaml' to this directory as a new entry file.
# - 'chloggen validate' will validate that all entry files are valid.
# - 'chloggen update' will read and delete all entry files in this directory, and update 'changelog_md'.
# Specify as relative path from root of repo.
# (Optional) Default: .chloggen
entries_dir: .chloggen

# This file is used as the input for individual changelog entries.
# Specify as relative path from root of repo.
# (Optional) Default: .chloggen/TEMPLATE.yaml
template_yaml: .chloggen/TEMPLATE.yaml

summary_template: .chloggen/summary.tmpl

# The CHANGELOG file or files to which 'chloggen update' will write new entries
# (Optional) Default filename: CHANGELOG.md
change_logs:
user: CHANGELOG.md

# The default change_log or change_logs to which an entry should be added.
# If 'change_logs' is specified in this file, and no value is specified for 'default_change_logs',
# then 'change_logs' MUST be specified in every entry file.
default_change_logs: [user]
```
18 changes: 18 additions & 0 deletions .chloggen/TEMPLATE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use this changelog template to create an entry for release notes.

# One of 'feature', 'bug_fix', 'docs'. Inferred from conventional commit tag if PR created before `make chlog-new`.
change_type:

# Mandatory. One of: distributions, distributions/nrdot-collector, distributions/nrdot-collector-experimental, examples
component:

# Mandatory. Put the PR number here. Inferred from PR number if PR created before `make chlog-new`.
issues: []

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note:

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
12 changes: 12 additions & 0 deletions .chloggen/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
change_logs:
user: CHANGELOG.md
default_change_logs:
- user
entries_dir: .chloggen
template_yaml: .chloggen/TEMPLATE.yaml
summary_template: .chloggen/summary.tmpl
components:
- distributions
- distributions/nrdot-collector
- distributions/nrdot-collector-experimental
- examples
Comment on lines +8 to +12

@agarvin-nr agarvin-nr Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding this list to the config enforces that only these components may be added to each entry. If this is too restrictive, we could instead omit this section entirely (then users would still be mandated to add some "component" to their changelog, but would be free to choose whatever.)

48 changes: 48 additions & 0 deletions .chloggen/summary.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- define "entry" -}}
- `{{ .Component }}`: {{ .Note }} (
{{- range $i, $issue := .Issues }}
{{- if $i }}, {{ end -}}
#{{ $issue }}
{{- end -}}
)

{{- if .SubText }}
{{ .SubText | indent 2 }}
{{- end }}
{{- end }}
## {{ .Version }}

{{- if .Enhancements }}

### Features

{{- range $i, $change := .Enhancements }}
{{- if eq $i 0}}
{{end}}
{{ template "entry" $change }}
{{- end }}
{{- end }}

{{- if .BugFixes }}

### Bug Fixes

{{- range $i, $change := .BugFixes }}
{{- if eq $i 0}}
{{end}}
{{ template "entry" $change }}
{{- end }}
{{- end }}

{{- if .NewComponents }}

### Docs

{{- range $i, $change := .NewComponents }}
{{- if eq $i 0}}
{{end}}
{{ template "entry" $change }}
{{- end }}
{{- end }}

<!-- previous-version -->
115 changes: 115 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This action requires that any PR targeting the main branch should add a
# yaml file to the ./.chloggen/ directory. If a CHANGELOG entry is not required,
# or if performing maintenance on the Changelog, add the "Skip Changelog" label,
# or prefix the pull request title with any of the following: "chore",
# "build", "ci", "refactor", "style", "test".

name: changelog

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, edited]
branches:
- main

permissions:
contents: read

env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2

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.

curious what this is about? Is there some kind of link validation in chloggen?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a great question - I took most of this workflow from the components repo and missed this. I just did some research and found that it's an environment variable used to set cache download timeout in actions/cache. In this instance, it seems it's used to configure actions/setup-go (which uses the same cache mechanism via toolkit/cache.)

The default timeout is 10 minutes. I imagine this would be a lot more relevant for repos with bigger caches than releases (like our components repo or upstream contrib), but we're probably safe to remove this from here if need be.


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
changelog:
runs-on: ubuntu-24.04
if: ${{ github.actor != 'dependabot[bot]' }}
env:
PR_HEAD: ${{ github.event.pull_request.head.sha }}

steps:
- name: Check if changelog exempt
id: check
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
run: |
CHLOG_EXEMPT_PREFIXES=('chore' 'build' 'ci' 'refactor' 'style' 'test')
for prefix in "${CHLOG_EXEMPT_PREFIXES[@]}"; do
if [[ "$PR_TITLE" == "$prefix"* ]]; then
echo "Title has exempt prefix '$prefix'; changelog not required."
echo "exempt=true" >> "$GITHUB_OUTPUT"
exit 0
fi
done

CHLOG_EXEMPT_LABELS=('Skip Changelog' 'dependencies')
for label in "${CHLOG_EXEMPT_LABELS[@]}"; do
if echo "$PR_LABELS" | grep -qF "\"$label\""; then
echo "PR has exempt label '$label'; changelog not required."
echo "exempt=true" >> "$GITHUB_OUTPUT"
exit 0
fi
done

echo "No exempt prefix or label; changelog required."
echo "exempt=false" >> "$GITHUB_OUTPUT"

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
# Fetch complete history unless the PR is changelog-exempt.
fetch-depth: ${{ steps.check.outputs.exempt == 'true' && '1' || '0' }}
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"

- name: Ensure no changes to CHANGELOG.md
if: ${{ steps.check.outputs.exempt != 'true' }}
run: |
if [[ "$(git diff --name-only "$(git merge-base origin/main "$PR_HEAD")" "$PR_HEAD" ./CHANGELOG*.md)" ]]
then
echo "CHANGELOG.md should not be directly modified."
echo "Please add a .yaml file to the ./.chloggen/ directory."
echo "Alternately, add the \"Skip Changelog\" label or prefix the pull request title with any of the following: \"chore\", \"build\", \"ci\", \"refactor\", \"style\", or \"test\"."
false
else
echo "CHANGELOG.md was not modified."
fi

- name: Ensure ./.chloggen/*.yaml addition(s)
if: ${{ steps.check.outputs.exempt != 'true' }}
run: |
excluded_yamls=(config.yaml TEMPLATE.yaml)
chloggen_yamls="$(git diff --diff-filter=AM --name-only "$(git merge-base origin/main "$PR_HEAD")" "$PR_HEAD" ./.chloggen)"
if [[ 1 -gt "$(echo "$chloggen_yamls" | grep \\.yaml | grep -vc -f <(printf '/%s$\n' "${excluded_yamls[@]}"))" ]]
then
echo "No changelog entry was added or changed in the ./.chloggen/ directory."
echo "Please add or edit an existing .yaml file in the ./.chloggen/ directory."
echo "See CONTRIBUTING.md for more details."
echo "Alternately, add \"chore:\" to the title of the pull request or add the \"Skip Changelog\" label if this job should be skipped."
false
else
echo "A changelog entry was added to the ./.chloggen/ directory."
fi

- name: Validate ./.chloggen/*.yaml changes
run: |
make chlog-validate \
|| { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; }

# In order to validate any links in the yaml file, render the config to markdown
- name: Render .chloggen changelog entries
if: ${{ steps.check.outputs.exempt != 'true' }}
run: make chlog-preview > changelog_preview.md
- name: Link Checker
if: ${{ steps.check.outputs.exempt != 'true' }}
id: lychee
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml"
failIfEmpty: false
3 changes: 3 additions & 0 deletions .github/workflows/ci-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
- name: Tidy go.mod files
run: go mod tidy

- name: Validate GitHub Actions hashes match
run: ./scripts/validate-actions-hashes.sh

- name: Ensure goreleaser up to date
run: make check

Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/ci-bump-component-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
token: ${{ secrets.RELEASE_TOKEN }}

- name: Import GPG key
if: ${{ !env.ACT }}
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7
with:
gpg_private_key: ${{ secrets.OTELCOMM_BOT_GPG_PRIVATE_KEY_BASE64 }}
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
fi

- name: Commit Component Version Bump
if: steps.bump_component_versions.outputs.has_changes == 'true'
if: ${{ !env.ACT && steps.bump_component_versions.outputs.has_changes == 'true' }}
run: |
# Check if branch exists remotely
if git ls-remote --heads origin ${{ env.branch }} | grep -q ${{ env.branch }}; then
Expand Down Expand Up @@ -134,11 +135,31 @@ jobs:

echo "Updated PR #$pr_number"
else
echo "Creating new PR..."
echo "Creating new draft PR..."

@agarvin-nr agarvin-nr Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

chloggen mandates that there is at least one value entered into the issues field of each entry, which is meant to represent either an issue number (which we don't use) or pull request number.

For our auto-generated PRs, we cannot generate a passing changelog before we have a PR number, which means we must create a PR beforehand. This leads to the following issue:

  1. This workflow opens a PR
  2. CI runs against initial PR and fails
  3. This workflow adds changelog entry
  4. CI runs against workflow and passes

The CI run in step 2 will always fail, either because of the lack of changelog, or because it was cancelled by the CI run at 4. I don't think this would affect the release process, but my idea here was to mark it as a draft PR here, then mark it as 'ready' after the changelog is added so we don't get emailed until it's ready.

gh pr create \
--draft \
--title "$pr_title" \
--body "$pr_body" \
--repo "${{ github.repository }}" \
--base main \
--head "${{ env.branch }}"
fi

# Changelog entry must be added after PR is created, so that its PR number may be added
- name: Add changelog entry
id: add_changelog_entry
if: ${{ steps.bump_component_versions.outputs.has_changes == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
./scripts/generate-version-bump-chlog.sh -c "${{ env.current_beta_core }}" -n "${{ env.next_beta_core }}"

- name: Commit changelog entry
if: ${{ !env.ACT && steps.bump_component_versions.outputs.has_changes == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
git add .chloggen/
git commit -S -m "chore: add changelog entry for otel component version bump"
git push origin ${{ env.branch }}
gh pr ready "${{ env.branch }}" --repo "${{ github.repository }}"
13 changes: 13 additions & 0 deletions .github/workflows/release-bump-version-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
fetch-depth: 0

- name: Import GPG key
if: ${{ !env.ACT }}
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7
with:
gpg_private_key: ${{ secrets.OTELCOMM_BOT_GPG_PRIVATE_KEY_BASE64 }}
Expand All @@ -31,6 +32,12 @@ jobs:
git_commit_gpgsign: true
git_config_global: true

- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "~1.26"
check-latest: true

- name: Bump NRDOT version
id: bump
run: |
Expand All @@ -39,7 +46,13 @@ jobs:
echo "old_version=${old_version}" >> $GITHUB_OUTPUT
echo "branch=nrdot-release/${{ inputs.new_version }}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: chloggen
run: |
make chlog-update
- name: Commit and push
if: ${{ !env.ACT }}
run: |
branch="${{ steps.bump.outputs.branch }}"
git switch -c "${branch}"
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/release-draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,30 @@ jobs:
go-version: "~1.26"
check-latest: true

- name: Extract release notes
run: |
release_notes_file="${RUNNER_TEMP}/release-notes.md"

# Grab changelog from between version markers, then remove leading / trailing whitespace and print to temp file.
awk 'inside && /<!-- previous-version -->/{exit} inside{print} /<!-- next version -->/{inside=1}' CHANGELOG.md \
| awk 'NF{content=1} content{buf=buf $0 ORS} END{sub(/\n+$/,"\n",buf); printf "%s",buf}' > "$release_notes_file"

if [ ! -s "$release_notes_file" ]; then
echo "Error: no user-facing changes found between version markers in CHANGELOG.md; aborting release." >&2
exit 1
fi

echo "release_notes_file=$release_notes_file" >> "$GITHUB_ENV"
echo "Release notes:"
cat "$release_notes_file"

- name: Draft Release From Root Config
id: goreleaser
uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7
with:
distribution: goreleaser-pro
version: "2.15.4"
args: --clean --timeout 2h
args: --clean --timeout 2h --release-notes="${{ env.release_notes_file }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
Expand Down
27 changes: 0 additions & 27 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,7 @@ release:
- [ ] Any new artifact type is attached to the draft release (we filter on upload for expected file types)
- [ ] Docker images for each distro have been published to ECR
### Publish Checklist
- [ ] Checklist has been reviewed and all items are complete.
- [ ] Draft header has been removed.
- [ ] Docker images for each distro have been published to docker hub and tagged as latest
- [ ] Slack notifications have been sent to appropriate channels
- [ ] PR has been generated to update docs in [docs.newrelic.com](https://github.com/newrelic/docs-website/pulls)
###### !!! REMOVE THIS HEADER BEFORE PUBLISHING !!!
changelog:
sort: asc
use: github
format: "{{ .Message }}"
groups:
- title: Features
regexp: "^.*(feat:|feat\\/|feat(\\([^\\)]*\\)):).*"
order: 0
- title: Bug Fixes
regexp: "^.*(fix:|fix\\/|fix(\\([^\\)]*\\)):).*"
order: 1
- title: Docs
regexp: "^.*(docs:|docs\\/|docs(\\([^\\)]*\\)):).*"
order: 2
filters:
exclude:
- "^ci"
- "^test"
- "^chore"
- "^refactor"
- "^style"
- "^perf"
- "^build"
- "^revert"
- "^deps"
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- This file is autogenerated. See CONTRIBUTING.md for instructions to add an entry. -->

<!-- next version -->
Loading
Loading