Skip to content

Commit a9030e2

Browse files
committed
[chloggen] Generate separate changelog for end users and Go API consumers
1 parent a2bc3eb commit a9030e2

15 files changed

+103
-16
lines changed

.chloggen/TEMPLATE.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Use this changelog template to create an entry for release notes.
2-
# If your change doesn't affect end users, such as a test fix or a tooling change,
3-
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
42

53
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
64
change_type:
@@ -18,3 +16,12 @@ issues: []
1816
# These lines will be padded with 2 spaces and then inserted directly into the document.
1917
# Use pipe (|) for multiline entries.
2018
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

.chloggen/chloggen-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: changelog
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Generate separate changelogs for end users and package consumers
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [24014]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [api]

.chloggen/config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The directory that stores individual changelog entries.
2+
# Each entry is stored in a dedicated yaml file.
3+
# - 'chloggen new' will copy the 'template_yaml' to this directory as a new entry file.
4+
# - 'chloggen validate' will validate that all entry files are valid.
5+
# - 'chloggen update' will read and delete all entry files in this directory, and update 'changelog_md'.
6+
# Specify as relative path from root of repo.
7+
# (Optional) Default: .chloggen
8+
entries_dir: .chloggen
9+
10+
# This file is used as the input for individual changelog entries.
11+
# Specify as relative path from root of repo.
12+
# (Optional) Default: .chloggen/TEMPLATE.yaml
13+
template_yaml: .chloggen/TEMPLATE.yaml
14+
15+
# The CHANGELOG file or files to which 'chloggen update' will write new entries
16+
# (Optional) Default filename: CHANGELOG.md
17+
change_logs:
18+
user: CHANGELOG.md
19+
api: CHANGELOG-API.md
20+
21+
# The default change_log or change_logs to which an entry should be added.
22+
# If 'change_logs' is specified in this file, and no value is specified for 'default_change_logs',
23+
# then 'change_logs' MUST be specified in every entry file.
24+
default_change_logs: [user]

.chloggen/heartbeat-while-startup.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ issues: [24411]
1818
# These lines will be padded with 2 spaces and then inserted directly into the document.
1919
# Use pipe (|) for multiline entries.
2020
subtext:
21+
22+
change_logs: [user, api]

.chloggen/k8sclusterreceiver-enable-disable-metrics.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ issues: [24568]
1818
# These lines will be padded with 2 spaces and then inserted directly into the document.
1919
# Use pipe (|) for multiline entries.
2020
subtext:
21+
22+
change_logs: [user, api]

.chloggen/mdatagen-avoid-reusing-resource-builder.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ note: Avoid reusing the same ResourceBuilder instance for multiple ResourceMetri
1313

1414
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
1515
issues: [24762]
16+
17+
change_logs: [user, api]

.chloggen/splunkhecreceiver-align-success-response.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ issues: [19219]
1717
# (optional) additional information to render under the primary note provided above;
1818
# these lines will be padded with two spaces and inserted directly into the document
1919
subtext: changes resp from plaintext "ok" to json {"text":"success", "code":0}
20+
21+
change_logs: [user, api]

.github/workflows/changelog.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ jobs:
4343
~/go/pkg/mod
4444
key: changelog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
4545

46-
- name: Ensure no changes to the CHANGELOG
46+
- name: Ensure no changes to the CHANGELOG.md or CHANGELOG-API.md
4747
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
4848
run: |
49-
if [[ $(git diff --name-only $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} ./CHANGELOG.md) ]]
49+
if [[ $(git diff --name-only $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} ./CHANGELOG*.md) ]]
5050
then
51-
echo "The CHANGELOG should not be directly modified."
51+
echo "CHANGELOG.md and CHANGELOG-API.md should not be directly modified."
5252
echo "Please add a .yaml file to the ./.chloggen/ directory."
5353
echo "See CONTRIBUTING.md for more details."
5454
echo "Alternately, add either \"[chore]\" to the title of the pull request or add the \"Skip Changelog\" label if this job should be skipped."
5555
false
5656
else
57-
echo "The CHANGELOG was not modified."
57+
echo "CHANGELOG.md and CHANGELOG-API.md were not modified."
5858
fi
5959
6060
- name: Ensure ./.chloggen/*.yaml addition(s)

CHANGELOG-API.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- This file is autogenerated. See CONTRIBUTING.md for instructions to add an entry. -->
2+
3+
# GO API Changelog
4+
5+
This changelog includes only developer-facing changes.
6+
If you are looking for user-facing changes, check out [CHANGELOG.md](./CHANGELOG.md).
7+
8+
<!-- next version -->

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Changelog
44

5+
Starting with version v0.83.0, this changelog includes only user-facing changes.
6+
If you are looking for developer-facing changes, check out [CHANGELOG-API.md](./CHANGELOG-API.md).
7+
58
<!-- next version -->
69

710
## v0.82.0

CONTRIBUTING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@ change. For instance:
1313

1414
## Changelog
1515

16+
### Overview
17+
18+
There are two Changelogs for this repository:
19+
20+
- `CHANGELOG.md` is intended for users of the collector and lists changes that affect the behavior of the collector.
21+
- `CHANGELOG-API.md` is intended for developers who are importing packages from the collector codebase.
22+
23+
### When to add a Changelog Entry
24+
1625
Pull requests that contain user-facing changes will require a changelog entry. Keep in mind the following types of users:
1726
1. Those who are consuming the telemetry exported from the collector
1827
2. Those who are deploying or otherwise managing the collector or its configuration
1928
3. Those who are depending on APIs exported from collector packages
2029
4. Those who are contributing to the repository
2130

22-
The changelog is primarily directed at the first three groups but it is sometimes appropriate to include important updates relevant only to the forth group.
31+
Changes that affect the first two groups should be noted in `CHANGELOG.md`. Changes that affect the third or forth groups should be noted in `CHANGELOG-API.md`.
2332

2433
If a changelog entry is not required, a maintainer or approver will add the `Skip Changelog` label to the pull request.
2534

@@ -45,11 +54,11 @@ No changelog entry:
4554

4655
### Adding a Changelog Entry
4756

48-
The [CHANGELOG.md](./CHANGELOG.md) file in this repo is autogenerated from `.yaml` files in the `./.chloggen` directory.
57+
The [CHANGELOG.md](./CHANGELOG.md) and [CHANGELOG-API.md](./CHANGELOG-API.md) files in this repo is autogenerated from `.yaml` files in the `./.chloggen` directory.
4958

5059
Your pull-request should add a new `.yaml` file to this directory. The name of your file must be unique since the last release.
5160

52-
During the collector release process, all `./.chloggen/*.yaml` files are transcribed into `CHANGELOG.md` and then deleted.
61+
During the collector release process, all `./chloggen/*.yaml` files are transcribed into `CHANGELOG.md` and `CHANGELOG-API.md` and then deleted.
5362

5463
**Recommended Steps**
5564
1. Create an entry file using `make chlog-new`. This generates a file based on your current branch (e.g. `./.chloggen/my-branch.yaml`)

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,19 @@ update-codeowners: gengithub generate
263263
FILENAME?=$(shell git branch --show-current)
264264
.PHONY: chlog-new
265265
chlog-new: $(CHLOGGEN)
266-
$(CHLOGGEN) new --filename $(FILENAME)
266+
$(CHLOGGEN) new --config $(CHLOGGEN_CONFIG) --filename $(FILENAME)
267267

268268
.PHONY: chlog-validate
269269
chlog-validate: $(CHLOGGEN)
270-
$(CHLOGGEN) validate
270+
$(CHLOGGEN) validate --config $(CHLOGGEN_CONFIG)
271271

272272
.PHONY: chlog-preview
273273
chlog-preview: $(CHLOGGEN)
274-
$(CHLOGGEN) update --dry
274+
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG) --dry
275275

276276
.PHONY: chlog-update
277277
chlog-update: $(CHLOGGEN)
278-
$(CHLOGGEN) update --version $(VERSION)
278+
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG) --version $(VERSION)
279279

280280
.PHONY: genotelcontribcol
281281
genotelcontribcol: $(BUILDER)

Makefile.Common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TOOLS_MOD_REGEX := "\s+_\s+\".*\""
3434
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"")
3535
TOOLS_BIN_DIR := $(SRC_ROOT)/.tools
3636
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(TOOLS_PKG_NAMES)))
37+
CHLOGGEN_CONFIG := .chloggen/config.yaml
3738

3839
.PHONY: install-tools
3940
install-tools: $(TOOLS_BIN_NAMES)

internal/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/jcchavezs/porto v0.4.0
1111
github.com/jstemmer/go-junit-report v1.0.0
1212
go.opentelemetry.io/build-tools/checkfile v0.10.0
13-
go.opentelemetry.io/build-tools/chloggen v0.9.0
13+
go.opentelemetry.io/build-tools/chloggen v0.11.0
1414
go.opentelemetry.io/build-tools/crosslink v0.9.0
1515
go.opentelemetry.io/build-tools/issuegenerator v0.9.0
1616
go.opentelemetry.io/build-tools/multimod v0.9.0

internal/tools/go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)