Skip to content

Commit 5127427

Browse files
authored
add multimod release strategy (#544)
* add update-otel make target * add push-tags make target * docs: add release instructions * docs: format release instructions * pull upstream collector repository * docs: remove automated step
1 parent 5713a36 commit 5127427

File tree

8 files changed

+227
-37
lines changed

8 files changed

+227
-37
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
bin/
22
.tools/
3+
.release/
34
_build/
45

56
### IntelliJ IDEA ###
67
.idea/
78
*.iws
89
*.iml
9-
*.ipr
10+
*.ipr

Makefile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ gogovulncheck:
7676
goporto:
7777
$(MAKE) $(FOR_GROUP_TARGET) TARGET="porto"
7878

79+
.PHONY: remove-toolchain
80+
remove-toolchain:
81+
$(MAKE) $(FOR_GROUP_TARGET) TARGET="toolchain"
82+
7983
# Build a collector based on the Elastic components (generate Elastic collector)
8084
.PHONY: genelasticcol
8185
genelasticcol: $(BUILDER)
@@ -111,3 +115,44 @@ otelsoak-validate: genelasticcol
111115
.PHONY: otelsoak-run
112116
otelsoak-run: genelasticcol
113117
./loadgen/cmd/otelsoak/otelsoak --config ./loadgen/cmd/otelsoak/config.example.yaml $(ARGS)
118+
119+
120+
# Clones the upstream opentelemetry-collector repository in a temporal .release
121+
# directory. If the directory already exists,
122+
UPSTREAM_REPO_URL := https://github.com/open-telemetry/opentelemetry-collector.git
123+
RELEASE_REPO_DIR := $(SRC_ROOT)/.release/opentelemetry-collector
124+
$(RELEASE_REPO_DIR):
125+
echo "Cloning repository into $@..."; \
126+
mkdir -p $@; \
127+
git clone $(UPSTREAM_REPO_URL) $@ ; \
128+
129+
.PHONY: update-otel
130+
update-otel: $(MULTIMOD) $(RELEASE_REPO_DIR)
131+
@(echo "Pulling upstream $(RELEASE_REPO_DIR)..."; cd $(RELEASE_REPO_DIR); git pull origin main)
132+
$(MULTIMOD) sync -s=true -o $(RELEASE_REPO_DIR) -m stable --commit-hash "$(OTEL_STABLE_VERSION)"
133+
git add . && git commit -s -m "[chore] multimod update stable modules" ; \
134+
$(MULTIMOD) sync -s=true -o $(RELEASE_REPO_DIR) -m beta --commit-hash "$(OTEL_VERSION)"
135+
git add . && git commit -s -m "[chore] multimod update beta modules" ; \
136+
$(MAKE) gotidy
137+
$(MAKE) -B install-tools
138+
$(MAKE) genelasticcol
139+
$(MAKE) gogenerate license-update
140+
# Tidy again after generating code
141+
$(MAKE) gotidy
142+
$(MAKE) remove-toolchain
143+
git add . && git commit -s -m "[chore] mod and toolchain tidy" ; \
144+
145+
COMMIT?=HEAD
146+
MODSET?=edot-base
147+
REMOTE?[email protected]:elastic/opentelemetry-collector-components.git
148+
.PHONY: push-tags
149+
push-tags: $(MULTIMOD)
150+
$(MULTIMOD) verify
151+
set -e; for tag in `$(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \
152+
echo "pushing tag $${tag}"; \
153+
git push ${REMOTE} $${tag}; \
154+
done;
155+
156+
.PHONY: clean
157+
clean:
158+
rm -r $(dir $(RELEASE_REPO_DIR))

Makefile.Common

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ PORTO := $(TOOLS_BIN_DIR)/porto
2727
BUILDER := $(TOOLS_BIN_DIR)/builder
2828
LICENSER := $(TOOLS_BIN_DIR)/go-licenser
2929
CHLOGGEN := $(TOOLS_BIN_DIR)/chloggen
30+
MULTIMOD := $(TOOLS_BIN_DIR)/multimod
3031

3132
.PHONY: install-tools
3233
install-tools: $(TOOLS_BIN_NAMES)
@@ -86,3 +87,7 @@ porto: $(PORTO)
8687
.PHONY: govulncheck
8788
govulncheck: $(GOVULNCHECK)
8889
$(GOVULNCHECK) ./...
90+
91+
.PHONY: toolchain
92+
toolchain:
93+
$(GOCMD) get toolchain@none

docs/release.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Releasing opentelemetry-collector-components
2+
3+
1. Determine the version number that will be assigned to the release. It should
4+
match the latest upstream release version (`OTEL_VERSION`).
5+
6+
2. Open a PR to the repository to use the newly released OpenTelemetry Collector Core version by doing the following:
7+
- Ensure your local repository is up-to-date with upstream and create a new Git branch named `release/<release-series>` (e.g. `release/v0.85.x`)
8+
- Manually update core and contrib collector module versions in
9+
`../distributions/elastic-components/manifest.yaml`
10+
- Manually update the version to be released in the [versions.yaml file](../versions.yaml)
11+
- Run `make genelasticcol`
12+
- Commit the changes
13+
- Run `make update-otel OTEL_VERSION=vX.Y.Z OTEL_STABLE_VERSION=vA.B.C`
14+
- If there is no new stable version released in the core collector, use the current stable module version in contrib as `OTEL_STABLE_VERSION`.
15+
- If you were unable to run `make update-otel` before releasing core, fix any errors from breaking changes.
16+
- Commit the changes
17+
- Open the PR
18+
🛑 **Do not move forward until this PR is merged.** 🛑
19+
20+
3. Make sure you are on the `release/<release-series>` branch. Tag the module groups with the new release version by running:
21+
22+
⚠️ If you set your remote using `https`, you need to include `REMOTE=https://github.com/elastic/opentelemetry-collector-components.git` in each command. ⚠️
23+
24+
- Run `make push-tags`.
25+
26+
If you encounter an error when running `make push-tags` like:
27+
28+
```
29+
Load key "~/.ssh/id_ed25519": incorrect passphrase supplied to decrypt private key error: unable to sign the tag
30+
```
31+
32+
It’s likely because Git is trying to sign a tag using an SSH key that requires a passphrase.
33+
34+
✅ Solution: Run the following commands to decrypt your SSH key and make it available for Git tag signing:
35+
36+
```bash
37+
eval "$(ssh-agent -s)"
38+
ssh-add <YOUR_SSH/GPG_KEY_PATH>
39+
make push-tags
40+
```

internal/tools/go.mod

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/golangci/golangci-lint v1.64.8
99
github.com/jcchavezs/porto v0.7.0
1010
go.opentelemetry.io/build-tools/chloggen v0.22.0
11+
go.opentelemetry.io/build-tools/multimod v0.22.0
1112
go.opentelemetry.io/collector/cmd/builder v0.124.0
1213
go.opentelemetry.io/collector/cmd/mdatagen v0.124.1-0.20250422204809-07f18639a341
1314
golang.org/x/vuln v1.1.4
@@ -16,6 +17,7 @@ require (
1617
require (
1718
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
1819
4d63.com/gochecknoglobals v0.2.2 // indirect
20+
dario.cat/mergo v1.0.0 // indirect
1921
github.com/4meepo/tagalign v1.4.2 // indirect
2022
github.com/Abirdcfly/dupword v0.1.3 // indirect
2123
github.com/Antonboom/errname v1.0.0 // indirect
@@ -26,7 +28,9 @@ require (
2628
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
2729
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect
2830
github.com/Masterminds/semver/v3 v3.3.0 // indirect
31+
github.com/Microsoft/go-winio v0.6.2 // indirect
2932
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
33+
github.com/ProtonMail/go-crypto v1.1.5 // indirect
3034
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
3135
github.com/alexkohler/nakedret/v2 v2.0.5 // indirect
3236
github.com/alexkohler/prealloc v1.0.0 // indirect
@@ -48,18 +52,24 @@ require (
4852
github.com/charithe/durationcheck v0.0.10 // indirect
4953
github.com/chavacava/garif v0.1.0 // indirect
5054
github.com/ckaznocha/intrange v0.3.0 // indirect
55+
github.com/cloudflare/circl v1.6.0 // indirect
5156
github.com/curioswitch/go-reassign v0.3.0 // indirect
57+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
5258
github.com/daixiang0/gci v0.13.5 // indirect
53-
github.com/davecgh/go-spew v1.1.1 // indirect
59+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5460
github.com/denis-tingaikin/go-header v0.5.0 // indirect
61+
github.com/emirpasic/gods v1.18.1 // indirect
5562
github.com/ettle/strcase v0.2.0 // indirect
5663
github.com/fatih/color v1.18.0 // indirect
5764
github.com/fatih/structtag v1.2.0 // indirect
5865
github.com/firefart/nonamedreturns v1.0.5 // indirect
59-
github.com/fsnotify/fsnotify v1.7.0 // indirect
66+
github.com/fsnotify/fsnotify v1.8.0 // indirect
6067
github.com/fzipp/gocyclo v0.6.0 // indirect
6168
github.com/ghostiam/protogetter v0.3.9 // indirect
6269
github.com/go-critic/go-critic v0.12.0 // indirect
70+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
71+
github.com/go-git/go-billy/v5 v5.6.2 // indirect
72+
github.com/go-git/go-git/v5 v5.14.0 // indirect
6373
github.com/go-logr/logr v1.4.2 // indirect
6474
github.com/go-logr/stdr v1.2.2 // indirect
6575
github.com/go-toolsmith/astcast v1.1.0 // indirect
@@ -74,6 +84,7 @@ require (
7484
github.com/gobwas/glob v0.2.3 // indirect
7585
github.com/gofrs/flock v0.12.1 // indirect
7686
github.com/gogo/protobuf v1.3.2 // indirect
87+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
7788
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
7889
github.com/golangci/go-printf-func-name v0.1.0 // indirect
7990
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
@@ -91,15 +102,16 @@ require (
91102
github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect
92103
github.com/hashicorp/go-version v1.7.0 // indirect
93104
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
94-
github.com/hashicorp/hcl v1.0.0 // indirect
95105
github.com/hexops/gotextdiff v1.0.3 // indirect
96106
github.com/inconshreveable/mousetrap v1.1.0 // indirect
107+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
97108
github.com/jgautheron/goconst v1.7.1 // indirect
98109
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
99110
github.com/jjti/go-spancheck v0.6.4 // indirect
100111
github.com/json-iterator/go v1.1.12 // indirect
101112
github.com/julz/importas v0.2.0 // indirect
102113
github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect
114+
github.com/kevinburke/ssh_config v1.2.0 // indirect
103115
github.com/kisielk/errcheck v1.9.0 // indirect
104116
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
105117
github.com/knadh/koanf/maps v0.1.2 // indirect
@@ -119,7 +131,6 @@ require (
119131
github.com/ldez/usetesting v0.4.2 // indirect
120132
github.com/leonklingele/grouper v1.1.2 // indirect
121133
github.com/macabu/inamedparam v0.1.3 // indirect
122-
github.com/magiconair/properties v1.8.6 // indirect
123134
github.com/maratori/testableexamples v1.0.0 // indirect
124135
github.com/maratori/testpackage v1.1.1 // indirect
125136
github.com/matoous/godox v1.1.0 // indirect
@@ -129,7 +140,6 @@ require (
129140
github.com/mgechev/revive v1.7.0 // indirect
130141
github.com/mitchellh/copystructure v1.2.0 // indirect
131142
github.com/mitchellh/go-homedir v1.1.0 // indirect
132-
github.com/mitchellh/mapstructure v1.5.0 // indirect
133143
github.com/mitchellh/reflectwalk v1.0.2 // indirect
134144
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
135145
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -140,9 +150,9 @@ require (
140150
github.com/nishanths/predeclared v0.2.2 // indirect
141151
github.com/nunnatsa/ginkgolinter v0.19.1 // indirect
142152
github.com/olekukonko/tablewriter v0.0.5 // indirect
143-
github.com/pelletier/go-toml v1.9.5 // indirect
144153
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
145-
github.com/pmezard/go-difflib v1.0.0 // indirect
154+
github.com/pjbgf/sha1cd v0.3.2 // indirect
155+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
146156
github.com/polyfloyd/go-errorlint v1.7.1 // indirect
147157
github.com/prometheus/client_golang v1.20.2 // indirect
148158
github.com/prometheus/client_model v0.6.1 // indirect
@@ -158,27 +168,30 @@ require (
158168
github.com/rogpeppe/go-internal v1.14.1 // indirect
159169
github.com/ryancurrah/gomodguard v1.3.5 // indirect
160170
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
171+
github.com/sagikazarmark/locafero v0.7.0 // indirect
161172
github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect
162173
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
163174
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
164175
github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect
165176
github.com/securego/gosec/v2 v2.22.2 // indirect
177+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
166178
github.com/sirupsen/logrus v1.9.3 // indirect
167179
github.com/sivchari/containedctx v1.0.3 // indirect
168180
github.com/sivchari/tenv v1.12.1 // indirect
181+
github.com/skeema/knownhosts v1.3.1 // indirect
169182
github.com/sonatard/noctx v0.1.0 // indirect
183+
github.com/sourcegraph/conc v0.3.0 // indirect
170184
github.com/sourcegraph/go-diff v0.7.0 // indirect
171185
github.com/spf13/afero v1.12.0 // indirect
172-
github.com/spf13/cast v1.5.0 // indirect
186+
github.com/spf13/cast v1.7.1 // indirect
173187
github.com/spf13/cobra v1.9.1 // indirect
174-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
175188
github.com/spf13/pflag v1.0.6 // indirect
176-
github.com/spf13/viper v1.12.0 // indirect
189+
github.com/spf13/viper v1.20.0 // indirect
177190
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
178191
github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect
179192
github.com/stretchr/objx v0.5.2 // indirect
180193
github.com/stretchr/testify v1.10.0 // indirect
181-
github.com/subosito/gotenv v1.4.1 // indirect
194+
github.com/subosito/gotenv v1.6.0 // indirect
182195
github.com/tdakkota/asciicheck v0.4.1 // indirect
183196
github.com/tetafro/godot v1.5.0 // indirect
184197
github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 // indirect
@@ -189,6 +202,7 @@ require (
189202
github.com/ultraware/whitespace v0.2.0 // indirect
190203
github.com/uudashr/gocognit v1.2.0 // indirect
191204
github.com/uudashr/iface v1.3.1 // indirect
205+
github.com/xanzy/ssh-agent v0.3.3 // indirect
192206
github.com/xen0n/gosmopolitan v1.2.2 // indirect
193207
github.com/yagipy/maintidx v1.0.0 // indirect
194208
github.com/yeya24/promlinter v0.3.0 // indirect
@@ -197,6 +211,7 @@ require (
197211
go-simpler.org/musttag v0.13.0 // indirect
198212
go-simpler.org/sloglint v0.9.0 // indirect
199213
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
214+
go.opentelemetry.io/build-tools v0.22.0 // indirect
200215
go.opentelemetry.io/collector/component v1.30.0 // indirect
201216
go.opentelemetry.io/collector/confmap v1.30.0 // indirect
202217
go.opentelemetry.io/collector/confmap/provider/fileprovider v1.30.0 // indirect
@@ -213,6 +228,7 @@ require (
213228
go.uber.org/automaxprocs v1.6.0 // indirect
214229
go.uber.org/multierr v1.11.0 // indirect
215230
go.uber.org/zap v1.27.0 // indirect
231+
golang.org/x/crypto v0.37.0 // indirect
216232
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
217233
golang.org/x/mod v0.24.0 // indirect
218234
golang.org/x/net v0.39.0 // indirect
@@ -224,7 +240,7 @@ require (
224240
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
225241
google.golang.org/grpc v1.72.0 // indirect
226242
google.golang.org/protobuf v1.36.6 // indirect
227-
gopkg.in/ini.v1 v1.67.0 // indirect
243+
gopkg.in/warnings.v0 v0.1.2 // indirect
228244
gopkg.in/yaml.v2 v2.4.0 // indirect
229245
gopkg.in/yaml.v3 v3.0.1 // indirect
230246
honnef.co/go/tools v0.6.1 // indirect

0 commit comments

Comments
 (0)