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(semconv): Separate SemConv releases to allow different versioning #4904

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
75e644b
add new workspace for semconv
JamieDanielson Aug 7, 2024
800b0cf
add separate changelog for semconv
JamieDanielson Aug 7, 2024
a878d34
update release scripts and workflow to separate semconv
JamieDanielson Aug 7, 2024
29fdc70
update contributing guides to clarify semconv is separate
JamieDanielson Aug 7, 2024
df28867
add dummy entry to release-notes script for new pkg
JamieDanielson Aug 13, 2024
86ceb9b
add missing parenthesis to lerna command
JamieDanielson Aug 13, 2024
ed3233d
fix workspace to include packages subdirectory
JamieDanielson Aug 13, 2024
1d7a1bd
ensure only semconv package in release step
JamieDanielson Aug 13, 2024
0f02e89
update release-notes script to just use new regex
JamieDanielson Aug 13, 2024
c80e747
driveby semi-colon addition
JamieDanielson Aug 13, 2024
1f1657c
Merge remote-tracking branch 'jamie/main' into jamie.separate-semconv…
JamieDanielson Aug 13, 2024
2485ee9
rename package to semantic-conventions
JamieDanielson Aug 13, 2024
5e862fb
update semconv path in tsconfig files
JamieDanielson Aug 13, 2024
4d0ea6b
update references to new path
JamieDanielson Aug 13, 2024
c089181
update path in semconv generate script
JamieDanielson Aug 13, 2024
681c114
update path for new npm release scripts
JamieDanielson Aug 13, 2024
e1e0cf8
update package-lock file
JamieDanielson Aug 13, 2024
6502711
move semconv to its own dir outside of pkgs
JamieDanielson Aug 15, 2024
764430f
update npm scripts and workspace
JamieDanielson Aug 15, 2024
5bd0661
update references to semconv path
JamieDanielson Aug 15, 2024
b3d170d
update relative paths in npm scripts
JamieDanielson Aug 15, 2024
f215805
semconv is no longer under packages
JamieDanielson Aug 15, 2024
c5566df
update comment for changelog script
JamieDanielson Aug 15, 2024
7e56292
run npm i to update lock and update tsconfigs
JamieDanielson Aug 15, 2024
a1b4a21
semantic conventions will always be separate
JamieDanielson Aug 15, 2024
513be69
missed a straggler
JamieDanielson Aug 15, 2024
353db76
Update doc/contributing/releasing.md
JamieDanielson Aug 19, 2024
3478623
remove_experimental isnt needed
JamieDanielson Aug 19, 2024
62e1d9f
prepare_all should never include semconv
JamieDanielson Aug 19, 2024
8c0d0c8
re-order for clarity
JamieDanielson Aug 19, 2024
20b62ef
fix release script to work on macos and alpine
JamieDanielson Aug 19, 2024
7ea9782
fix verify release to work on macOS
JamieDanielson Aug 19, 2024
694cca0
update verbiage and call out SO answer
JamieDanielson Aug 19, 2024
4348587
Merge branch 'main' into jamie.separate-semconv-release-publishing
JamieDanielson Aug 19, 2024
8998d60
replace [[:digit:]] with [0-9]
JamieDanielson Aug 20, 2024
94b28c7
Merge branch 'main' into jamie.separate-semconv-release-publishing
JamieDanielson Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/create-or-update-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
options:
- experimental
- sdk
- semconv
- all

jobs:
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/opentelemetry-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.

### :bug: (Bug Fix)

Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This section refers to `"dependencies"` and `"devDependencies"` entries in `pack

All packages from the `@opentelemetry/` namespace MUST have the same pinned version, as these dependencies are automatically updated on each release by lerna.

**Example:** all packages under `packages/` should consistently maintain the same version, as should those under `experimental/packages/`.
**Example:** all packages under `packages/` except for `@opentelemetry/semantic-conventions` should consistently maintain the same version, as should those under `experimental/packages/`.

An exception is granted for dependencies on `@opentelemetry/api`, which, if used by the package SHOULD NOT be included as a `dependency`. `@opentelemetry/api` SHOULD be included as a `peerDependency` instead. The version range of the `peerDependency` SHOULD reflect the minimum supported, and SHOULD NOT allow versions greater than the latest released minor version.

Expand Down
6 changes: 4 additions & 2 deletions doc/contributing/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ We aim to eventually automate this process as much as possible.
3. For `Release Type`, select if you want to create a release PR for a new `minor` or `patch` version.
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`)
- `sdk` (all packages under `./packages/` except for `semantic-conventions`, and `./experimental/packages`)
- `semconv` (all packages under `./packages/opentelemetry-semantic-conventions`)
- `all` (all packages under `./api/`, `./packages/` and `./experimental/packages` except for `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
1 change: 1 addition & 0 deletions package-lock.json

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

22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,40 @@
"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",
"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: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_api && npm run _lerna:remove_stable_except_semconv && npm run _lerna:remove_experimental && 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_api && npm run _lerna:remove_stable_except_semconv && npm run _lerna:remove_experimental && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_semconv",
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, both of these will also bump examples and such, so they will diverge over time from the experimental/stable versioning over time. Maybe we should also exclude them from the update. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean we want to ensure absolutely nothing is included in this EXCEPT for the semantic-conventions package, right? Can you look here if this matches what you're suggesting: 1d7a1bd

"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",
"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_experimental": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"experimental/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
JamieDanielson marked this conversation as resolved.
Show resolved Hide resolved
"_lerna:remove_semconv": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"packages/opentelemetry-semantic-conventions/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
"_lerna:remove_stable_except_semconv": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>!(p.startsWith(\"packages/\") && p!==\"packages/opentelemetry-semantic-conventions/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'",
JamieDanielson marked this conversation as resolved.
Show resolved Hide resolved
"_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_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",
"_changelog:prepare_semconv": "node scripts/update-changelog.js ./packages/opentelemetry-semantic-conventions/CHANGELOG.md ./packages/opentelemetry-semantic-conventions/package.json",
"_changelog:prepare_all": "npm run _changelog:prepare_api && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable && npm run _changelog:prepare_semconv",
JamieDanielson marked this conversation as resolved.
Show resolved Hide resolved
"_github:draft_release:all": "npm run _github:draft_release:api && _github:draft_release:experimental && _github:draft_release:stable && _github:draft_release:semconv",
"_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:semconv": "node scripts/extract-latest-release-notes.js ./packages/opentelemetry-semantic-conventions/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./packages/opentelemetry-semantic-conventions/package.json | grep -oP '^\\d+\\.\\d+\\.\\d+$') && 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:all": "node scripts/extract-latest-release-notes.js api/CHANGELOG.md ./CHANGELOG.md experimental/CHANGELOG.md packages/opentelemetry-semantic-conventions/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 packages/opentelemetry-semantic-conventions/CHANGELOG.md && npm run _github:update_release_pr_body_from_file",
"_verify_release_kind": "echo $RELEASE_KIND | grep -oP '^(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 +134,7 @@
"workspaces": [
"api",
"packages/*",
"packages/opentelemetry-semantic-conventions/*",
"experimental/packages/*",
"experimental/examples/*",
"experimental/backwards-compatibility/*",
Expand Down
22 changes: 22 additions & 0 deletions packages/opentelemetry-semantic-conventions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- markdownlint-disable MD004 -->
# CHANGELOG

All notable changes to semantic conventions package in this project will be documented in this file.

## Unreleased

Note: This package will now be versioned according to the version of semantic conventions being provided.

### :boom: Breaking Change

### :rocket: (Enhancement)

* 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.

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)