Skip to content

Add weaver registry package command#1254

Merged
jsuereth merged 21 commits intoopen-telemetry:mainfrom
lmolkova:add-registry-package
Mar 5, 2026
Merged

Add weaver registry package command#1254
jsuereth merged 21 commits intoopen-telemetry:mainfrom
lmolkova:add-registry-package

Conversation

@lmolkova
Copy link
Member

Fixes #1244

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 86.41975% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.7%. Comparing base (502906d) to head (4367395).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/weaver_semconv/src/manifest.rs 84.7% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1254     +/-   ##
=======================================
- Coverage   80.8%   80.7%   -0.1%     
=======================================
  Files        111     111             
  Lines       9257    9301     +44     
=======================================
+ Hits        7480    7515     +35     
- Misses      1777    1786      +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lmolkova lmolkova force-pushed the add-registry-package branch from a6a9f1f to 1390a7e Compare March 1, 2026 02:12
@lmolkova lmolkova marked this pull request as ready for review March 1, 2026 02:36
@lmolkova lmolkova requested a review from a team as a code owner March 1, 2026 02:36
Copy link
Contributor

@jerbly jerbly left a comment

Choose a reason for hiding this comment

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

Looks good... just needs a new error variant/s to clarify write errors.

@jerbly
Copy link
Contributor

jerbly commented Mar 2, 2026

Sorry @lmolkova - I just noticed that usage.md may have been hand edited. I've done a bad job explaining that this is now generated. Update the /// doc comments in the code and then run: cargo run -- --quiet markdown-help > docs/usage.md to have it updated. There will likely be other edits missed from other PRs. :(

/// This is produced by `weaver registry package` and describes the contents of
/// a self-contained registry artifact, including its resolved schema location.
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
pub struct PublicationRegistryManifest {
Copy link
Member Author

Choose a reason for hiding this comment

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

let's try putting it into resolved schema crate

Copy link
Member Author

@lmolkova lmolkova Mar 5, 2026

Choose a reason for hiding this comment

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

I tried, essentially it means have duplicate structure, one unnamed here and another one named there and some copy logic. but in practice it does not seem to bring any benefit.

I wonder if separation between semconv and resolved crates is even necessary? you can't use semconv without resolving them.

})?
.clone();

let loaded = weaver.load_definitions(main_registry_repo, &mut diag_msgs)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm so happy this API is working out for us, when I see it used in commands like this.

Any friction / oddities in weaver here? Should we perhaps have it also create RegsitryRepo?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, it's super-easy to use, no friction at all!

I think we should do a big cleanup when we remove legacy and use this chance to polish this - repo seems like an impl detail that would be cool to hide.
I don't think it's a big deal unless we want to ship libraries and need good public api

Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

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

This looks great to me. Pre-approving but I can re-review once the fixes for registry types are in.

let expected_errors: String = std::fs::read_to_string(&expected_errors_file)
.expect("Failed to read expected errors file");
let observed_errors = serde_json::to_string(&schema).unwrap();
let observed_errors = serde_json::to_string(&schema.err()).unwrap();
Copy link
Member Author

Choose a reason for hiding this comment

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

schema does not need to be serializeable, it was the only place that required it to be, but we don't care about schema itself, only about errors.

"title": "DefinitionRegistryManifest",
"description": "Represents the definition manifest for a semantic convention registry.\n\nThis is used when developing a registry before it is published.\nSee [`PublicationRegistryManifest`] for the stricter publication form produced\nby `weaver registry package`.",
"type": "object",
"properties": {
Copy link
Member Author

@lmolkova lmolkova Mar 5, 2026

Choose a reason for hiding this comment

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

no file format here. not sure we need one for definition, let's add it when necessary.

@jsuereth jsuereth enabled auto-merge (squash) March 5, 2026 15:58
@jsuereth jsuereth merged commit 76beb05 into open-telemetry:main Mar 5, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement weaver registry package command

3 participants