Skip to content

Commit 49a9377

Browse files
committed
Generate separate changelog for end users and Go API consumers
1 parent 3089ea8 commit 49a9377

File tree

9 files changed

+93
-15
lines changed

9 files changed

+93
-15
lines changed

.chloggen/TEMPLATE.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Use this changelog template to create an entry for release notes.
2+
13
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
24
change_type:
35

@@ -14,3 +16,10 @@ issues: []
1416
# These lines will be padded with 2 spaces and then inserted directly into the document.
1517
# Use pipe (|) for multiline entries.
1618
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
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: [8153]
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]

CHANGELOG-API.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- This file is autogenerated. See CONTRIBUTING.md for instructions to add an entry. -->
2+
3+
# Go API Changelog
4+
5+
<!-- next version -->

CONTRIBUTING.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,28 +505,39 @@ prior to inclusion in a stable release of the specification.
505505

506506
## Changelog
507507

508+
### Overview
509+
510+
There are two Changelogs for this repository:
511+
512+
- `CHANGELOG.md` is intended for users of the collector and lists changes that affect the behavior of the collector.
513+
- `CHANGELOG-API.md` is intended for developers who are importing packages from the collector codebase.
514+
515+
### When to add a Changelog Entry
516+
508517
An entry into the changelog is required for the following reasons:
509518

510519
- Changes made to the behaviour of the component
511520
- Changes to the configuration
512521
- Changes to default settings
513522
- New components being added
523+
- Changes to exported elements of a package
514524

515525
It is reasonable to omit an entry to the changelog under these circuimstances:
516526

517527
- Updating test to remove flakiness or improve coverage
518528
- Updates to the CI/CD process
529+
- Updates to internal packages
519530

520531
If there is some uncertainty with regards to if a changelog entry is needed, the recomendation is to create
521532
an entry to in the event that the change is important to the project consumers.
522533

523534
### Adding a Changelog Entry
524535

525-
The [CHANGELOG.md](./CHANGELOG.md) file in this repo is autogenerated from `.yaml` files in the `./.chloggen` directory.
536+
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.
526537

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

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

531542
**Recommended Steps**
532543
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: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -534,22 +534,23 @@ crosslink: $(CROSSLINK)
534534
$(CROSSLINK) --root=$(shell pwd) --prune
535535

536536

537-
FILENAME?=$(shell git branch --show-current).yaml
537+
FILENAME?=$(shell git branch --show-current)
538538
.PHONY: chlog-new
539-
chlog-new: $(CHLOG)
540-
$(CHLOG) new --filename $(FILENAME)
539+
chlog-new: $(CHLOGGEN)
540+
$(CHLOGGEN) new --config $(CHLOGGEN_CONFIG) --filename $(FILENAME)
541541

542542
.PHONY: chlog-validate
543-
chlog-validate: $(CHLOG)
544-
$(CHLOG) validate
543+
chlog-validate: $(CHLOGGEN)
544+
$(CHLOGGEN) validate --config $(CHLOGGEN_CONFIG)
545545

546546
.PHONY: chlog-preview
547-
chlog-preview: $(CHLOG)
548-
$(CHLOG) update --dry
547+
chlog-preview: $(CHLOGGEN)
548+
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG) --dry
549549

550550
.PHONY: chlog-update
551-
chlog-update: $(CHLOG)
552-
$(CHLOG) update --version $(VERSION)
551+
chlog-update: $(CHLOGGEN)
552+
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG) --version $(VERSION)
553+
553554

554555
.PHONY: builder-integration-test
555556
builder-integration-test: $(ENVSUBST)

Makefile.Common

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ TOOLS_BIN_DIR := $(PWD)/.tools
1414
TOOLS_MOD_REGEX := "\s+_\s+\".*\""
1515
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"" | grep -vE '/v[0-9]+$$')
1616
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(shell echo $(TOOLS_PKG_NAMES))))
17+
CHLOGGEN_CONFIG := .chloggen/config.yaml
1718

1819
ADDLICENSE := $(TOOLS_BIN_DIR)/addlicense
1920
APIDIFF := $(TOOLS_BIN_DIR)/apidiff
2021
CHECKDOC := $(TOOLS_BIN_DIR)/checkdoc
21-
CHLOG := $(TOOLS_BIN_DIR)/chloggen
22+
CHLOGGEN := $(TOOLS_BIN_DIR)/chloggen
2223
CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
2324
ENVSUBST := $(TOOLS_BIN_DIR)/envsubst
2425
GOIMPORTS := $(TOOLS_BIN_DIR)/goimports

internal/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/mikefarah/yq/v4 v4.34.2
1313
github.com/pavius/impi v0.0.3
1414
go.opentelemetry.io/build-tools/checkdoc v0.9.0
15-
go.opentelemetry.io/build-tools/chloggen v0.9.0
15+
go.opentelemetry.io/build-tools/chloggen v0.11.0
1616
go.opentelemetry.io/build-tools/crosslink v0.9.0
1717
go.opentelemetry.io/build-tools/multimod v0.9.0
1818
go.opentelemetry.io/build-tools/semconvgen v0.9.0

internal/tools/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ go.opentelemetry.io/build-tools v0.9.0 h1:P6WstNx1gmj3bMFJFrJThuxFQlKztxOSCPR/2h
652652
go.opentelemetry.io/build-tools v0.9.0/go.mod h1:ZoM+TLPhEhTi09/nI9YKPlU563ocHoWrQXD994N5dMc=
653653
go.opentelemetry.io/build-tools/checkdoc v0.9.0 h1:Jk0MggS4gUJrRlq4XKSV4hmIyDU/TwQJyCy4GrXzMqM=
654654
go.opentelemetry.io/build-tools/checkdoc v0.9.0/go.mod h1:3dQZFtq1x9RrKDM3RWGo1BQjZxH67zUrKmsjLegWttc=
655-
go.opentelemetry.io/build-tools/chloggen v0.9.0 h1:sHdl6T5NTlGhRwy7du4APkd2GZEamI4DfBitdKlzxGU=
656-
go.opentelemetry.io/build-tools/chloggen v0.9.0/go.mod h1:zuYbAo3TkrHo3C7lCrM5dHWSS50BDr0UfRYtyBFv2dQ=
655+
go.opentelemetry.io/build-tools/chloggen v0.11.0 h1:PYbfjzw/4pHNfwH0kCAMolvmdorMVGxSSFY8A9097fw=
656+
go.opentelemetry.io/build-tools/chloggen v0.11.0/go.mod h1:zuYbAo3TkrHo3C7lCrM5dHWSS50BDr0UfRYtyBFv2dQ=
657657
go.opentelemetry.io/build-tools/crosslink v0.9.0 h1:LOeJzMxsxBG2qMKeO22fRs91QvDfY+BA5pF1skTjbx0=
658658
go.opentelemetry.io/build-tools/crosslink v0.9.0/go.mod h1:VaSi2ahs+r+v//m6OpqTkD5siSFVta9eTHhKqPsfH/Q=
659659
go.opentelemetry.io/build-tools/multimod v0.9.0 h1:Im9PCGhfmKQC2XR0aTYzADNiOZLk9QEQgibDhadH+i0=

0 commit comments

Comments
 (0)