Skip to content

Commit

Permalink
chore(semconv): Separate SemConv releases to allow different versioni…
Browse files Browse the repository at this point in the history
…ng (open-telemetry#4904)

Co-authored-by: Trent Mick <[email protected]>
  • Loading branch information
2 people authored and Zirak committed Sep 14, 2024
1 parent d0f0626 commit e392adc
Show file tree
Hide file tree
Showing 63 changed files with 191 additions and 125 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/create-or-update-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ on:
type: choice
description: Release Scope
options:
- experimental
- sdk
- all
- experimental # all packages in experimental/packages
- sdk # all SDK packages, experimental and stable, excluding semantic conventions
- all # all release packages, including API, excluding semconv
- semconv # only semantic convention package

jobs:
create-or-update-release-pr:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.

For API changes, see the [API CHANGELOG](api/CHANGELOG.md).
For experimental package changes, see the [experimental CHANGELOG](experimental/CHANGELOG.md).
For semantic convention package changes, see the [semconv CHANGELOG](packages/semantic-conventions/CHANGELOG.md).

## Unreleased

Expand All @@ -16,6 +17,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
* feat(semconv): update semantic conventions to 1.27 (from 1.7.0) [#4690](https://github.com/open-telemetry/opentelemetry-js/pull/4690) @dyladan
* Exported names have changed to `ATTR_{name}` for attributes (e.g. `ATTR_HTTP_REQUEST_METHOD`), `{name}_VALUE_{value}` for enumeration values (e.g. `HTTP_REQUEST_METHOD_VALUE_POST`), and `METRIC_{name}` for metrics. Exported names from previous versions are deprecated.
* Import `@opentelemetry/semantic-conventions` for *stable* semantic conventions. Import `@opentelemetry/semantic-conventions/incubating` for all semantic conventions, stable and unstable.
* Note: Semantic conventions are now versioned separately from other stable artifacts, to correspond to the version of semantic conventions they provide. Changes will be in a separate changelog.

### :bug: (Bug Fix)

Expand Down
4 changes: 3 additions & 1 deletion doc/contributing/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ We aim to eventually automate this process as much as possible.
4. For `Release Scope`, select if you want to release
- `experimental` (all packages under `./experimental/packages`)
- `sdk` (all packages under `./packages/` and `./experimental/packages`)
- `all` (all packages under `./api/`, `./packages/` and `./experimental/packages`)
- `all` (all packages under `./api/`, `./packages/` and `./experimental/packages`; excludes `./semantic-conventions/`)
- `semconv` (the single semconv package at `./semantic-conventions/`)

> [!TIP]
> If there was a commit to `main`, after PR creation simply run the workflow again before merging it.
Expand Down Expand Up @@ -53,6 +54,7 @@ We aim to eventually automate this process as much as possible.
2. Run
- `npm run _github:draft_release:experimental`, if you published an `all`, `sdk` or `experimental` release
- `npm run _github:draft_release:stable`, if you published an `all` or `sdk` release
- `npm run _github:draft_release:semconv`, if you published a `semconv` release
- `npm run _github:draft_release:api` if you published an `all` release
3. Verify that the contents of the created draft releases (title, changelog, selected commit)
4. Publish the releases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"path": "../../../packages/opentelemetry-resources"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../packages/sdk-metrics"
},
{
"path": "../../../packages/sdk-metrics"
"path": "../../../semantic-conventions"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-node"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"path": "../../../packages/opentelemetry-sdk-trace-node"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../packages/sdk-metrics"
},
{
"path": "../../../packages/sdk-metrics"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"path": "../../../packages/opentelemetry-sdk-trace-web"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../semantic-conventions"
},
{
"path": "../opentelemetry-instrumentation"
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/opentelemetry-sdk-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"path": "../../../packages/opentelemetry-sdk-trace-node"
},
{
"path": "../../../packages/opentelemetry-semantic-conventions"
"path": "../../../packages/sdk-metrics"
},
{
"path": "../../../packages/sdk-metrics"
"path": "../../../semantic-conventions"
},
{
"path": "../api-logs"
Expand Down
84 changes: 56 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 18 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,42 @@
"maint:regenerate-test-certs": "npm run --if-present --workspaces maint:regenerate-test-certs",
"comment_prepare_1": "echo scripts in this section automatically prepare releases. Intended for use by maintainers only.",
"comment_prepare_2": "echo experimental preparation scripts only prepare experimental packages",
"prepare_release:experimental:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_experimental",
"prepare_release:experimental:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_experimental",
"prepare_release:experimental:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:remove_stable && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_experimental",
"prepare_release:experimental:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:remove_stable && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_experimental",
"comment_prepare_3": "echo sdk preparation scripts prepare all stable and experimental packages",
"prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable",
"prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable",
"prepare_release:all:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_minor && cd api/ && npm version minor && cd .. && lerna run align-api-deps && npm run _restore:package-json && npm run _changelog:prepare_all",
"prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable",
"prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable",
"comment_prepare_4": "echo semconv preparation scripts only prepare semconv package",
"prepare_release:semconv:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_everything_except_semconv && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_semconv",
"prepare_release:semconv:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_everything_except_semconv && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_semconv",
"prepare_release:all:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:version_minor && cd api/ && npm version minor && cd .. && lerna run align-api-deps && npm run _restore:package-json && npm run _changelog:prepare_all",
"release:publish": "lerna publish --concurrency 1 from-package --no-push --no-private --no-git-tag-version --no-verify-access",
"comment_internal": "echo scripts below this line are for internal use",
"_check:no_changes": "if [ ! -z \"$(git status -uall --porcelain)\" ]; then echo Please ensure all changes are committed; exit 1; fi",
"_backup:package-json": "cp package.json package.json.backup",
"_restore:package-json": "mv package.json.backup package.json && npm install --package-lock-only",
"_lerna:remove_api": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"api\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
"_lerna:remove_semconv": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"semantic-conventions\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
"_lerna:remove_everything_except_semconv": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p==\"semantic-conventions\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
"_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
"_lerna:version_patch": "npx lerna version patch --exact --no-git-tag-version --no-push --yes",
"_lerna:version_minor": "npx lerna version minor --exact --no-git-tag-version --no-push --yes",
"_changelog:prepare_experimental": "node scripts/update-changelog.js ./experimental/CHANGELOG.md ./experimental/packages/",
"_changelog:prepare_stable": "node scripts/update-changelog.js ./CHANGELOG.md ./packages/",
"_changelog:prepare_api": "node scripts/update-changelog.js ./api/CHANGELOG.md ./api/package.json",
"_changelog:prepare_semconv": "node scripts/update-changelog.js ./semantic-conventions/CHANGELOG.md ./semantic-conventions/package.json",
"_changelog:prepare_all": "npm run _changelog:prepare_api && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable",
"_github:draft_release:all": "npm run _github:draft_release:api && _github:draft_release:experimental && _github:draft_release:stable",
"_github:draft_release:api": "node scripts/extract-latest-release-notes.js ./api/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./api/package.json | grep -oP '^\\d+\\.\\d+\\.\\d+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title api/v$VERSION api/v$VERSION",
"_github:draft_release:experimental": "node scripts/extract-latest-release-notes.js ./experimental/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./experimental/packages/ | grep -oP '^\\d+\\.\\d+\\.\\d+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title experimental/v$VERSION experimental/v$VERSION",
"_github:draft_release:stable": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md && VERSION=$(node scripts/get-version.js ./packages/ | grep -oP '^\\d+\\.\\d+\\.\\d+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title v$VERSION v$VERSION",
"_github:draft_release:api": "node scripts/extract-latest-release-notes.js ./api/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./api/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title api/v$VERSION api/v$VERSION",
"_github:draft_release:experimental": "node scripts/extract-latest-release-notes.js ./experimental/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./experimental/packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title experimental/v$VERSION experimental/v$VERSION",
"_github:draft_release:stable": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md && VERSION=$(node scripts/get-version.js ./packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title v$VERSION v$VERSION",
"_github:draft_release:semconv": "node scripts/extract-latest-release-notes.js ./semantic-conventions/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./semantic-conventions/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title semconv/v$VERSION semconv/v$VERSION",
"_github:update_release_pr_body_from_file": "gh pr edit --repo open-telemetry/opentelemetry-js $RELEASE_PR_OWNER:release/next-version --body-file ./.tmp/release-notes.md",
"_github:update_release_pr_body:all": "node scripts/extract-latest-release-notes.js api/CHANGELOG.md ./CHANGELOG.md experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file",
"_github:update_release_pr_body:sdk": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file",
"_github:update_release_pr_body:experimental": "node scripts/extract-latest-release-notes.js experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file",
"_verify_release_kind": "echo $RELEASE_KIND | grep -oP '^(all|sdk|experimental):(minor|patch)$'",
"_github:update_release_pr_body:semconv": "node scripts/extract-latest-release-notes.js semantic-conventions/CHANGELOG.md && npm run _github:update_release_pr_body_from_file",
"_verify_release_kind": "echo $RELEASE_KIND | grep -oE '^(all|sdk|experimental|semconv):(minor|patch)$'",
"_verify_release_remote": "git remote get-url $RELEASE_PR_REMOTE",
"_github:update_release_branch": "npm run _verify_release_kind && npm run _verify_release_remote && (git checkout main && git pull upstream main && git branch -D release/next-version; git checkout -b release/next-version && npm run prepare_release:$RELEASE_KIND && git commit -am \"chore: prepare release\" && git push --set-upstream $RELEASE_PR_REMOTE --force release/next-version)",
"github:create_or_update_release_pr": "npm run _github:update_release_branch && (gh pr create --repo open-telemetry/opentelemetry-js --title 'chore: prepare next release' --body ''; npm run _github:update_release_pr_body:$RELEASE_SCOPE)"
Expand Down Expand Up @@ -125,6 +133,7 @@
"workspaces": [
"api",
"packages/*",
"semantic-conventions",
"experimental/packages/*",
"experimental/examples/*",
"experimental/backwards-compatibility/*",
Expand Down
Loading

0 comments on commit e392adc

Please sign in to comment.