Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Automate contrib release step 1 #38534

Merged
merged 5 commits into from
Mar 14, 2025

Conversation

jade-guiton-dd
Copy link
Contributor

@jade-guiton-dd jade-guiton-dd commented Mar 11, 2025

Description

In the steps for releasing contrib, step 1 is manual, and step 2 is automated by the "Prepare release" CI workflow. This PR modifies said workflow to include (hopefully all of) the changes made in step 1 as well, removing the need for a manual step.

Substeps added to Prepare Release:

Step 1 includes the following sub-steps:

Manually update dist.version and core collector module versions in cmd/otelcontribcol/builder-config.yaml
Manually update dist.version and core collector module versions in cmd/oteltestbedcol/builder-config.yaml

→ Updating dist.version in the builder config is already done as part of Prepare Release.
→ Updating the core collector module versions in the builder config is done as part of update-otel, which we run below.

Run make genotelcontribcol genoteltestbedcol

→ Makes no changes to committed files, and is also currently the very first step of update-otel.

Run make update-otel OTEL_VERSION=v0.85.0 OTEL_STABLE_VERSION=v1.1.0

→ Added as the first step in Prepare Release.

If you were unable to run make update-otel before releasing core, fix any errors from breaking changes.

→ This is the only concern: maintainers will not have the opportunity to fix update-otel errors in the middle of the CI process. But the current standard is to run update-otel and fix breaking changes before releasing core anyway.

Other changes to Prepare Release:

I removed the multimod-sync step, which I believe to be redundant with the more thorough sync step performed in update-otel. (I haven't checked exhaustively, but at least the latest release did not have a "make multimod-sync changes" commit, indicating that it made no changes.)

I also removed the final gotidy, which is redundant with the gotidy done at the end of the prerelease step.

The internal/buildscripts/modules file needs to be updated manually whenever the core module sets change. This is not written in the release doc, but was done during the previous release. I added a new Makefile command (make update-core-module-list) to regenerate the file, which I now call in Prepare Release as well.

Other changes:

Running update-core-module-list on the current main reorders the file a bit, but also adds some modules that were missing. I included those changes in this PR.

xconfmap was missing in the file, and for some reason wasn't updated during the latest update-otel run (#38490). Adding it to the module list file causes the check-collector-module-version check to fail, so I excluded it from the file for now. It should get added back during the next release process, which hopefully will update the pseudoversion properly as well.

Completely unrelated to the subject of the PR, but I also removed the for-generated-target Makefile target I introduced in a previous PR, because I realized it... doesn't work, because otelcontribcol doesn't have a Makefile to run targets on anyway.

I also added a make -B install-tools step to update-otel to make sure we use the latest version of mdatagen/ocb once multimod sync has updated internal/tools to the latest core. Hopefully that will prevent some heisenbugs in the future.

Link to tracking issue

Fixes core#12294

Testing

I tested this by running the Prepare Release script locally, starting from 3bdd1ba on contrib, and 8ed28ec on core, after the 0.121.0 core release, but just before the contrib release. I then compared the final result with 76acaca, which is just after the contrib release (manual PR, automated PR).

The final diff only included a change to dist.version (in the previous release, it was changed from 0.120.1 to 0.121.1 instead of 0.121.0 by mistake), and the changes to internal/buildscripts/modules I mentioned above.

If anyone wants to tests this manually, I used the following Makefile targets on a test-release branch:

test-release:
	cd ../opentelemetry-collector && git checkout -f 8ed28ec63a5e7998d821ba369f9ace8f0ed89d7e
	CANDIDATE_STABLE=1.27.0 CURRENT_STABLE=1.26.0 CANDIDATE_BETA=0.121.0 CURRENT_BETA=0.120.1 .github/workflows/scripts/release-prepare-release.sh
	git diff 76acacac0b0d700eecd9c6bcbb1147d2152860fc -- . ':(exclude).github' ':(exclude)Makefile'

reset-release:
	git checkout -f test-release
	git branch -D prepare-release-prs/0.121.0
	git tag | grep 'v0.121.0' | xargs -n 1 -I% git tag -d %

Documentation

To do after this PR: update the release doc

@songy23 songy23 added the ci-cd CI, CD, testing, build issues label Mar 11, 2025
@mx-psi
Copy link
Member

mx-psi commented Mar 13, 2025

@mowies Maybe you are interested in reviewing this one?

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. Could you prepare a draft PR updating the docs/release.md documentation to reflect any changes in the process?

@jade-guiton-dd
Copy link
Contributor Author

Draft PR to update the release doc is here

@mx-psi mx-psi merged commit 0e4e718 into open-telemetry:main Mar 14, 2025
172 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 14, 2025
github-merge-queue bot pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Mar 14, 2025
)

#### Description

Once
[contrib#38534](open-telemetry/opentelemetry-collector-contrib#38534)
is merged, the manual changes that were necessary in step 1 of releasing
contrib should now be included in step 2 (the Prepare Release CI
workflow). This PR updates the release doc to remove step 1.

#### Link to tracking issue
Updates #12294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate contrib release Step 1: Bumping version
4 participants