2020-03-21 07:22:21 +02:00
# Release Process
2021-05-13 01:10:56 +02:00
## Semantic Convention Generation
2023-07-26 17:09:04 +02:00
New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated.
2022-04-12 22:40:43 +02:00
The `semconv-generate` make target is used for this.
2021-05-13 01:10:56 +02:00
2023-07-26 17:09:04 +02:00
1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag.
2023-01-06 00:58:42 +02:00
2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest`
3. Run the `make semconv-generate ...` target from this repository.
2021-05-13 01:10:56 +02:00
2022-04-12 22:40:43 +02:00
For example,
2021-05-13 01:10:56 +02:00
2022-04-12 22:40:43 +02:00
```sh
2023-07-26 17:09:04 +02:00
export TAG="v1.21.0" # Change to the release version you are generating.
export OTEL_SEMCONV_REPO="/absolute/path/to/opentelemetry/semantic-conventions"
2023-01-06 00:58:42 +02:00
docker pull otel/semconvgen:latest
2023-07-26 17:09:04 +02:00
make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO.
2022-04-12 22:40:43 +02:00
```
2021-06-10 19:03:43 +02:00
2022-04-12 22:40:43 +02:00
This should create a new sub-package of [`semconv` ](./semconv ).
Ensure things look correct before submitting a pull request to include the addition.
2021-06-10 19:03:43 +02:00
2023-08-14 16:42:08 +02:00
## Breaking changes validation
You can run `make gorelease` that runs [gorelease ](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease ) to ensure that there are no unwanted changes done in the public API.
You can check/report problems with `gorelease` [here ](https://golang.org/issues/26420 ).
2024-05-10 00:05:56 +02:00
## Verify changes for contrib repository
If the changes in the main repository are going to affect the contrib repository, it is important to verify that the changes are compatible with the contrib repository.
Follow [the steps ](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md#verify-otel-changes ) in the contrib repository to verify OTel changes.
2020-03-21 07:22:21 +02:00
## Pre-Release
2021-10-01 22:20:32 +02:00
First, decide which module sets will be released and update their versions
in `versions.yaml` . Commit this change to a new branch.
2020-07-31 19:08:50 +02:00
Update go.mod for submodules to depend on the new release which will happen in the next step.
2021-10-01 22:20:32 +02:00
1. Run the `prerelease` make target. It creates a branch
`prerelease_<module set>_<new tag>` that will contain all release changes.
2020-03-21 07:22:21 +02:00
```
2021-10-01 22:20:32 +02:00
make prerelease MODSET=< module set >
2020-07-13 22:09:59 +02:00
```
2. Verify the changes.
```
2021-10-01 22:20:32 +02:00
git diff ...prerelease_< module set > _< new tag >
2020-07-13 22:09:59 +02:00
```
2020-07-31 19:08:50 +02:00
This should have changed the version for all modules to be `<new tag>` .
2021-10-01 22:20:32 +02:00
If these changes look correct, merge them into your pre-release branch:
```go
git merge prerelease_< module set > _< new tag >
```
2020-07-13 22:09:59 +02:00
2020-07-31 19:08:50 +02:00
3. Update the [Changelog ](./CHANGELOG.md ).
- Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand.
To verify this, you can look directly at the commits since the `<last tag>` .
```
git --no-pager log --pretty=oneline "< last tag > ..HEAD"
```
- Move all the `Unreleased` changes into a new section following the title scheme (`[< new tag > ] - < date of release > `).
2024-07-08 20:31:31 +02:00
- Make sure the new section is under the comment for released section, like `<!-- Released section -->` , so it is protected from being overwritten in the future.
2020-07-31 19:08:50 +02:00
- Update all the appropriate links at the bottom.
2020-03-21 07:22:21 +02:00
2020-07-31 19:08:50 +02:00
4. Push the changes to upstream and create a Pull Request on GitHub.
Be sure to include the curated changes from the [Changelog ](./CHANGELOG.md ) in the description.
2020-07-13 22:09:59 +02:00
2020-03-21 07:22:21 +02:00
## Tag
2020-07-31 19:08:50 +02:00
Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit.
***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step!
2021-10-01 22:20:32 +02:00
Failure to do so will leave things in a broken state. As long as you do not
change `versions.yaml` between pre-release and this step, things should be fine.
2020-07-31 19:08:50 +02:00
***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module ](https://github.com/golang/go/issues/34189 ).
It is critical you make sure the version you push upstream is correct.
[Failure to do so will lead to minor emergencies and tough to work around ](https://github.com/open-telemetry/opentelemetry-go/issues/331 ).
2021-10-01 22:20:32 +02:00
1. For each module set that will be released, run the `add-tags` make target
using the `<commit-hash>` of the commit on the main branch for the merged Pull Request.
2020-07-13 22:09:59 +02:00
```
2021-10-01 22:20:32 +02:00
make add-tags MODSET=< module set > COMMIT=< commit hash >
2020-07-13 22:09:59 +02:00
```
2021-10-01 22:20:32 +02:00
It should only be necessary to provide an explicit `COMMIT` value if the
current `HEAD` of your working directory is not the correct commit.
2020-07-31 19:08:50 +02:00
2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git` ).
Make sure you push all sub-modules as well.
2020-03-21 07:22:21 +02:00
```
git push upstream < new tag >
git push upstream < submodules-path / new tag >
2020-07-13 22:09:59 +02:00
...
2020-03-21 07:22:21 +02:00
```
## Release
2020-07-31 19:08:50 +02:00
Finally create a Release for the new `<new tag>` on GitHub.
The release body should include all the release notes from the Changelog for this release.
2020-03-30 22:10:18 +02:00
2021-04-27 16:33:18 +02:00
## Post-Release
### Contrib Repository
2020-08-05 18:01:00 +02:00
2021-02-04 21:13:25 +02:00
Once verified be sure to [make a release for the `contrib` repository ](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md ) that uses this release.
2021-04-27 16:33:18 +02:00
### Website Documentation
2024-01-16 15:06:37 +02:00
Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go].
2021-04-27 16:33:18 +02:00
Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.
2022-04-12 22:40:43 +02:00
2023-07-26 17:09:04 +02:00
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
2024-01-16 15:06:37 +02:00
[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/
[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go
2023-06-26 16:51:12 +02:00
### Demo Repository
Bump the dependencies in the following Go services:
2024-12-16 17:42:35 +02:00
- [`accounting` ](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accounting )
2023-06-26 16:51:12 +02:00
- [`checkoutservice` ](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice )
- [`productcatalogservice` ](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice )