Repository navigation
fix(semconv): repair generate.sh version step and update weaver to 0.28.0 - #1274
Open
MariusCiocanel wants to merge 3 commits into
Open
MariusCiocanel wants to merge 3 commits into
MariusCiocanel wants to merge 3 commits into
Conversation
…o-op Since the Swift 6 migration, OpenTelemetry.swift declares `public static let version`, but the final sed step in generate.sh still matched only `public static var version`. It matched nothing and exited 0, so the reported spec version was never updated. It also used BSD-only `sed -i ''`. Match both `var` and `let`, exit non-zero with an error when no version declaration is found, and use `sed -i.bak`, which works with both BSD and GNU sed. Assisted-by: Claude Opus 5.5
The template strips the root namespace from attribute names, which leaves a leading dot (`client.address` -> `.address`). Newer weaver versions treat that dot as a word boundary in `camel_case`, so every generated identifier would become UpperCamel (`address` -> `Address`) and Swift keywords would stop being escaped (`_extension` -> `Extension`). Trim the dot before `camel_case`. Output with weaver 0.17.1 is unchanged. Assisted-by: Claude Opus 5.5
Update the semantic-conventions generator from 0.17.1 to 0.28.0. With the template fix in the previous commit, generated sources at semconv v1.38.0 are identical. Also point the comment at open-telemetry/weaver instead of the old build-tools repository. Assisted-by: Claude Opus 5.5
MariusCiocanel
marked this pull request as ready for review
November 5, 2026 17:15
MariusCiocanel
requested review from
ArielDemarco,
aranhave,
benjoseph-grafana,
bryce-b,
nachoBonafonte,
vvydier and
williazz
as code owners
November 5, 2026 17:15
Contributor
Author
|
From SIG: Add a parameter to the generate.sh to be able to choose between deleting the old code (e.g in version 3.0.0) or marking the deprecations with @available(*, deprecated) (e.g for 3.1.0) |
benjoseph-grafana
approved these changes
Nov 5, 2026
Contributor
|
Suggestion: can we refactor this pr to 'chore!: upgrade sem conv to x.y.z' , then another pr can update the version to |
Member
|
@williazz any reason this PR cannot be just updating weaver to the latest version? |
aranhave
approved these changes
Nov 6, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #598 (codegen now runs on weaver).
Tooling-only changes to
Scripts/semantic-convention/. Generated sources are unchanged:generate.shat semconv v1.38.0 produces byte-identical output before and after, and after each commit.1. Fix the silent no-op in the version step (
generate.sh)Since the Swift 6 migration (open-telemetry/opentelemetry-swift-core#30),
OpenTelemetry.swiftdeclarespublic static let version, but the script's finalsedmatched onlypublic static var version. It matched nothing, exited 0, and never updated the reported spec version. It also used BSD-onlysed -i ''. The step now matchesvarorlet, fails with an error when no declaration is found, and usessed -i.bak, which works with both BSD and GNU sed.2. Make the template work with newer weaver (
SemanticAttributes.swift.j2)The template strips the namespace from attribute names, which leaves a leading dot (
client.address→.address). Newer weaver versions capitalise the word after that dot incamel_case, which would rename every generated identifier (address→Address) and break users. Adding| trim(".")beforecamel_casefixes it. Output with the current weaver 0.17.1 is unchanged.3. Bump weaver 0.17.1 → 0.28.0 (
generate.sh)Together with commit 2, output is identical. The comment now points at
open-telemetry/weaver.Not in this PR: updating semantic conventions (v1.38.0 → latest).
weaver.yamlsetsexclude_deprecated: true, so every semconv bump removes the Swift constants that upstream deprecated instead of marking them deprecated. For example, v1.39.0 removesRpc.systemandRpc.gStatusCode, which is a source-breaking change for users. I'd like to discuss at the next SIG whether to keep deprecated attributes (marked@available(*, deprecated)) or accept the breaks with release notes. The semconv bump will follow in a separate PR once that's decided.Testing
bash -nandshellcheck -S warningongenerate.shgenerate.shat v1.38.0: no changes underSources/with weaver 0.17.1 + new template, and with weaver 0.28.0 + new templatelet/var, and exits 1 when the declaration is missingswift build --build-testsandswift testpass, with the same test count as mainAI assistance: Claude (Opus 5.5) helped write these changes (
Assisted-bytrailers). I reviewed and tested them before opening this PR.🤖 Generated with Claude Code