Skip to content

Commit

Permalink
Verify that schema files are correctly published (open-telemetry#2868)
Browse files Browse the repository at this point in the history
This downloads the schema files from https://opentelemetry.io/schemas/ and verifies their content.

Next time we make a release this will force us to make sure
https://github.com/open-telemetry/opentelemetry.io repo is updated
before we make the release.

This helps prevent issues like open-telemetry/opentelemetry.io#1846

Also add release procedure to the docs.
  • Loading branch information
tigrannajaryan committed Oct 17, 2022
1 parent 5accc43 commit ccf0fcc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,41 @@ owner should bring it to the [OpenTelemetry Specification SIG
meeting](https://github.com/open-telemetry/community#cross-language-specification).

[nvm]: https://github.com/nvm-sh/nvm/blob/master/README.md#installing-and-updating

## Releasing

Release Procedure:

1. Prepare a [draft release here](https://github.com/open-telemetry/opentelemetry-specification/releases).
Don't publish it yet.
2. Create a PR with updated [CHANGELOG.md](CHANGELOG.md). The CHANGELOG.md must have a
heading with the new version number. Ensure that no CHANGELOG entries are missing or
ended up in the wrong section (e.g., in the last released version rather than Unreleased).
The PR will fail the `schemas-check` Github action (all other actions must pass).
This is expected and will be fixed in the next steps. Have this PR reviewed and approved
and ready to be merged. While it is being reviewed you can work on step 3-4 in parallel.
3. Prepare the schema file for the upcoming release. The schema file should be placed
in the `schemas` directory. If no changes to semantic conventions happened
since the last release which require a corresponding section in the schema file then
simply copy the previous schema file, rename it to the new version and add a section
with the new version number to the file. See for example the schema file for [1.9.0](
https://github.com/open-telemetry/opentelemetry-specification/blob/main/schemas/1.9.0)
that has no changes from 1.8.0.
The schema file may already exist if there were changes done to semantic conventions
and the schema file was created with corresponding changes.
4. Create and merge the PR with the new schema file. Note the commit hash after merging.
If the schema file for the new release version previously existed then no new PR is
necessary, just note that latest commit hash of this repository.
5. Once CHANGELOG.md PR is approved and ready to be merged we are ready to make the release.
Update the [opentelemetry.io](https://github.com/open-telemetry/opentelemetry.io)
repository: the [opentelemetry-specification](
https://github.com/open-telemetry/opentelemetry.io/tree/main/content-modules)
submodule points to this repository. Create a PR and update the submodule to point to
the commit hash from step 4. Merge this PR. This should update the
[https://opentelemetry.io/](https://opentelemetry.io/) website and the new schema file
should be downloadable at `https://opentelemetry.io/schemas/<version>`.
6. Re-trigger the `schema-checks` Github action on the PR that updates the CHANGELOG.md.
The action should pass now. Merge the PR.
7. Add the changelog entries from `CHANGELOG.md` to the description of the previously
created [draft release here](
https://github.com/open-telemetry/opentelemetry-specification/releases) and publish it.
7 changes: 7 additions & 0 deletions internal/tools/schema_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ grep -o -e '## v[1-9].*\s' $root_dir/CHANGELOG.md | grep -o '[1-9].*' | while re
echo "FAILED: $file does not exist. The schema file must exist because the version is declared in CHANGELOG.md."
exit 3
fi

curl --no-progress-meter https://opentelemetry.io/schemas/$ver > verify$ver

diff verify$ver $file && echo "Published schema at https://opentelemetry.io/schemas/$ver is correct" \
|| (echo "Published schema at https://opentelemetry.io/schemas/$ver is incorrect!" && exit 3)

rm verify$ver
done

# Now check the content of all schema files in the ../shemas directory.
Expand Down

0 comments on commit ccf0fcc

Please sign in to comment.