Skip to content

Commit ccf0fcc

Browse files
Verify that schema files are correctly published (open-telemetry#2868)
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.
1 parent 5accc43 commit ccf0fcc

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

CONTRIBUTING.md

+38
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,41 @@ owner should bring it to the [OpenTelemetry Specification SIG
266266
meeting](https://github.com/open-telemetry/community#cross-language-specification).
267267

268268
[nvm]: https://github.com/nvm-sh/nvm/blob/master/README.md#installing-and-updating
269+
270+
## Releasing
271+
272+
Release Procedure:
273+
274+
1. Prepare a [draft release here](https://github.com/open-telemetry/opentelemetry-specification/releases).
275+
Don't publish it yet.
276+
2. Create a PR with updated [CHANGELOG.md](CHANGELOG.md). The CHANGELOG.md must have a
277+
heading with the new version number. Ensure that no CHANGELOG entries are missing or
278+
ended up in the wrong section (e.g., in the last released version rather than Unreleased).
279+
The PR will fail the `schemas-check` Github action (all other actions must pass).
280+
This is expected and will be fixed in the next steps. Have this PR reviewed and approved
281+
and ready to be merged. While it is being reviewed you can work on step 3-4 in parallel.
282+
3. Prepare the schema file for the upcoming release. The schema file should be placed
283+
in the `schemas` directory. If no changes to semantic conventions happened
284+
since the last release which require a corresponding section in the schema file then
285+
simply copy the previous schema file, rename it to the new version and add a section
286+
with the new version number to the file. See for example the schema file for [1.9.0](
287+
https://github.com/open-telemetry/opentelemetry-specification/blob/main/schemas/1.9.0)
288+
that has no changes from 1.8.0.
289+
The schema file may already exist if there were changes done to semantic conventions
290+
and the schema file was created with corresponding changes.
291+
4. Create and merge the PR with the new schema file. Note the commit hash after merging.
292+
If the schema file for the new release version previously existed then no new PR is
293+
necessary, just note that latest commit hash of this repository.
294+
5. Once CHANGELOG.md PR is approved and ready to be merged we are ready to make the release.
295+
Update the [opentelemetry.io](https://github.com/open-telemetry/opentelemetry.io)
296+
repository: the [opentelemetry-specification](
297+
https://github.com/open-telemetry/opentelemetry.io/tree/main/content-modules)
298+
submodule points to this repository. Create a PR and update the submodule to point to
299+
the commit hash from step 4. Merge this PR. This should update the
300+
[https://opentelemetry.io/](https://opentelemetry.io/) website and the new schema file
301+
should be downloadable at `https://opentelemetry.io/schemas/<version>`.
302+
6. Re-trigger the `schema-checks` Github action on the PR that updates the CHANGELOG.md.
303+
The action should pass now. Merge the PR.
304+
7. Add the changelog entries from `CHANGELOG.md` to the description of the previously
305+
created [draft release here](
306+
https://github.com/open-telemetry/opentelemetry-specification/releases) and publish it.

internal/tools/schema_check.sh

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ grep -o -e '## v[1-9].*\s' $root_dir/CHANGELOG.md | grep -o '[1-9].*' | while re
3131
echo "FAILED: $file does not exist. The schema file must exist because the version is declared in CHANGELOG.md."
3232
exit 3
3333
fi
34+
35+
curl --no-progress-meter https://opentelemetry.io/schemas/$ver > verify$ver
36+
37+
diff verify$ver $file && echo "Published schema at https://opentelemetry.io/schemas/$ver is correct" \
38+
|| (echo "Published schema at https://opentelemetry.io/schemas/$ver is incorrect!" && exit 3)
39+
40+
rm verify$ver
3441
done
3542

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

0 commit comments

Comments
 (0)