From 3beb8ade8ec961158d27a570c12ace1ed2180ff3 Mon Sep 17 00:00:00 2001 From: liudmila molkova Date: Fri, 8 May 2026 20:11:06 -0700 Subject: [PATCH 1/2] rename resolved_schema_uri to resolved_registry_uri --- .../published/registry_manifest.yaml | 2 +- .../published/registry_manifest.yaml | 2 +- .../published/registry_manifest.yaml | 2 +- .../consumer_published/manifest.yaml | 2 +- .../published/manifest.yaml | 2 +- crates/weaver_resolver/src/loader.rs | 2 +- crates/weaver_semconv/src/manifest.rs | 162 ++++++++++++++---- crates/weaver_semconv/src/registry_repo.rs | 12 +- .../3.0.0/registry_manifest.yaml | 2 +- .../tests/published_repository/resolved/1.0.0 | 2 +- .../tests/published_repository/resolved/2.0.0 | 2 +- crates/xtask/src/schema_compat.rs | 10 +- docs/usage.md | 2 +- schemas/publication-manifest.v2.json | 8 +- schemas/semconv-schemas.md | 12 +- schemas/weaver-config.json | 4 +- src/registry/package.rs | 27 +-- tests/published_v2_registry/manifest.yaml | 2 +- 18 files changed, 184 insertions(+), 73 deletions(-) diff --git a/crates/weaver_resolver/data/registry-test-published-1/published/registry_manifest.yaml b/crates/weaver_resolver/data/registry-test-published-1/published/registry_manifest.yaml index 9b2e8b59e..4042bec33 100644 --- a/crates/weaver_resolver/data/registry-test-published-1/published/registry_manifest.yaml +++ b/crates/weaver_resolver/data/registry-test-published-1/published/registry_manifest.yaml @@ -1,5 +1,5 @@ file_format: manifest/2.0 stability: stable schema_url: https://opentelemetry.io/schemas/1.0.0 -resolved_schema_uri: resolved_schema.yaml +resolved_registry_uri: resolved_schema.yaml description: Test repository that has been resolved. \ No newline at end of file diff --git a/crates/weaver_resolver/data/registry-test-published-2/published/registry_manifest.yaml b/crates/weaver_resolver/data/registry-test-published-2/published/registry_manifest.yaml index cdb23092e..b52165509 100644 --- a/crates/weaver_resolver/data/registry-test-published-2/published/registry_manifest.yaml +++ b/crates/weaver_resolver/data/registry-test-published-2/published/registry_manifest.yaml @@ -1,5 +1,5 @@ file_format: manifest/2.0 stability: stable schema_url: https://opentelemetry.io/schemas/1.0.0 -resolved_schema_uri: resolved_schema.yaml +resolved_registry_uri: resolved_schema.yaml description: Test repository that has been resolved. diff --git a/crates/weaver_resolver/data/registry-test-v2-5-published/published/registry_manifest.yaml b/crates/weaver_resolver/data/registry-test-v2-5-published/published/registry_manifest.yaml index f6e65f32e..283997f4f 100644 --- a/crates/weaver_resolver/data/registry-test-v2-5-published/published/registry_manifest.yaml +++ b/crates/weaver_resolver/data/registry-test-v2-5-published/published/registry_manifest.yaml @@ -1,5 +1,5 @@ file_format: manifest/2.0 stability: stable schema_url: https://example.com/schemas/1.2.3 -resolved_schema_uri: resolved_schema.yaml +resolved_registry_uri: resolved_schema.yaml description: Test repository that has been resolved. diff --git a/crates/weaver_resolver/data/registry-test-v2-dep/consumer_published/manifest.yaml b/crates/weaver_resolver/data/registry-test-v2-dep/consumer_published/manifest.yaml index 222a5f1e3..b4bb6a08f 100644 --- a/crates/weaver_resolver/data/registry-test-v2-dep/consumer_published/manifest.yaml +++ b/crates/weaver_resolver/data/registry-test-v2-dep/consumer_published/manifest.yaml @@ -5,4 +5,4 @@ dependencies: - schema_url: https://server.example.com/schemas/1.0.0 registry_path: data/registry-test-v2-dep/published stability: development -resolved_schema_uri: resolved.yaml +resolved_registry_uri: resolved.yaml diff --git a/crates/weaver_resolver/data/registry-test-v2-dep/published/manifest.yaml b/crates/weaver_resolver/data/registry-test-v2-dep/published/manifest.yaml index 8a4fb35e8..9f9c9beab 100644 --- a/crates/weaver_resolver/data/registry-test-v2-dep/published/manifest.yaml +++ b/crates/weaver_resolver/data/registry-test-v2-dep/published/manifest.yaml @@ -2,4 +2,4 @@ file_format: manifest/2.0 schema_url: https://server.example.com/schemas/1.0.0 description: Server semantic conventions. stability: development -resolved_schema_uri: resolved.yaml +resolved_registry_uri: resolved.yaml diff --git a/crates/weaver_resolver/src/loader.rs b/crates/weaver_resolver/src/loader.rs index f1fe15f5a..6ffa72e81 100644 --- a/crates/weaver_resolver/src/loader.rs +++ b/crates/weaver_resolver/src/loader.rs @@ -227,7 +227,7 @@ fn load_semconv_repository_recursive( // Either load a fully resolved repository, or read in raw files. if let Some(manifest) = registry_repo.manifest() { - if let Some(resolved_url) = registry_repo.resolved_schema_uri() { + if let Some(resolved_url) = registry_repo.resolved_registry_uri() { let res = load_resolved_repository(&resolved_url, auth); let _ = dependency_chain.pop(); res diff --git a/crates/weaver_semconv/src/manifest.rs b/crates/weaver_semconv/src/manifest.rs index 846a30358..1df18ffcf 100644 --- a/crates/weaver_semconv/src/manifest.rs +++ b/crates/weaver_semconv/src/manifest.rs @@ -5,7 +5,7 @@ //! Two manifest types are defined here: //! - [`DefinitionRegistryManifest`]: the definition manifest for an unpublished registry //! - [`PublicationRegistryManifest`]: the publication manifest produced by `weaver registry package` -//! (strict, always includes `resolved_schema_uri`). +//! (strict, always includes `resolved_registry_uri`). //! - [`RegistryManifest`]: an enum discriminated by `file_format` that can be either use std::vec; @@ -159,6 +159,9 @@ struct RawManifestFields { dependencies: Vec, #[serde(default)] stability: Stability, + resolved_registry_uri: Option, + /// Deprecated alias for `resolved_registry_uri`. + #[allow(deprecated)] resolved_schema_uri: Option, } @@ -172,19 +175,32 @@ impl RawManifestFields { path: path.to_path_buf(), details: "missing required field 'schema_url'".into(), })?; - let resolved_schema_uri = - self.resolved_schema_uri - .ok_or_else(|| Error::InvalidPublicationManifest { + let mut warnings = vec![]; + let resolved_registry_uri = match (self.resolved_registry_uri, self.resolved_schema_uri) + { + (Some(v), _) => v, + (None, Some(v)) => { + warnings.push( + "The 'resolved_schema_uri' field is deprecated in favor of 'resolved_registry_uri'." + .to_owned(), + ); + v + } + (None, None) => { + return Err(Error::InvalidPublicationManifest { path: path.to_path_buf(), - details: "missing required field 'resolved_schema_uri'".into(), - })?; + details: "missing required field 'resolved_registry_uri'".into(), + }); + } + }; Ok(RegistryManifest::Publication(PublicationRegistryManifest { file_format: PUBLICATION_MANIFEST_FILE_FORMAT.to_owned(), schema_url, description: self.description, dependencies: self.dependencies, stability: self.stability, - resolved_schema_uri, + resolved_registry_uri, + deserialization_warnings: warnings, })) } else { let mut warnings = vec![]; @@ -286,14 +302,18 @@ impl RegistryManifest { }); } - if let RegistryManifest::Definition(ref def) = manifest { - nfes.extend(def.deserialization_warnings.iter().map(|w| { - DeprecatedSyntaxInRegistryManifest { + let deserialization_warnings = match &manifest { + RegistryManifest::Definition(def) => def.deserialization_warnings.as_slice(), + RegistryManifest::Publication(pubm) => pubm.deserialization_warnings.as_slice(), + }; + nfes.extend( + deserialization_warnings + .iter() + .map(|w| DeprecatedSyntaxInRegistryManifest { path: manifest_path_buf.clone(), error: w.clone(), - } - })); - } + }), + ); Ok(manifest) } @@ -332,7 +352,8 @@ impl RegistryManifest { /// Represents the publication manifest for a packaged semantic convention registry. /// /// This is produced by `weaver registry package` and describes the contents of -/// a self-contained registry artifact, including its resolved schema location. +/// a self-contained registry artifact, including the URI of the resolved +/// registry artifact (`resolved.yaml`). #[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] pub struct PublicationRegistryManifest { /// The file format version of this publication manifest. @@ -356,17 +377,21 @@ pub struct PublicationRegistryManifest { #[serde(default)] pub stability: Stability, - /// URI pointing to the resolved telemetry schema included in this package. - pub resolved_schema_uri: String, + /// URI pointing to the resolved registry artifact included in this package. + #[serde(alias = "resolved_schema_uri")] + pub resolved_registry_uri: String, + + #[serde(skip)] + deserialization_warnings: Vec, } impl PublicationRegistryManifest { /// Creates a `PublicationRegistryManifest` from a `DefinitionRegistryManifest` and a - /// `resolved_schema_uri` pointing to where the resolved schema will be published. + /// `resolved_registry_uri` pointing to where the resolved registry will be published. #[must_use] pub fn try_from_registry_manifest( registry_manifest: &DefinitionRegistryManifest, - resolved_schema_uri: String, + resolved_registry_uri: String, ) -> Self { Self { file_format: PUBLICATION_MANIFEST_FILE_FORMAT.to_owned(), @@ -374,7 +399,8 @@ impl PublicationRegistryManifest { description: registry_manifest.description.clone(), dependencies: registry_manifest.dependencies.clone(), stability: registry_manifest.stability.clone(), - resolved_schema_uri, + resolved_registry_uri, + deserialization_warnings: vec![], } } } @@ -598,11 +624,11 @@ registry_path: "./registry" ); } - fn manifest_from_yaml(yaml: &str) -> Result { + fn manifest_from_yaml(yaml: &str, nfes: &mut Vec) -> Result { use std::io::Write; let mut tmp = tempfile::NamedTempFile::new().unwrap(); tmp.write_all(yaml.as_bytes()).unwrap(); - RegistryManifest::try_from_file(tmp.path(), &mut vec![]) + RegistryManifest::try_from_file(tmp.path(), nfes) } #[test] @@ -612,6 +638,7 @@ registry_path: "./registry" file_format: "garbage/1.0.0" schema_url: "https://example.com/schemas/1.0.0" "#, + &mut vec![], ); assert!(result.is_err()); assert!(result @@ -628,6 +655,7 @@ schema_url: "https://example.com/schemas/1.0.0" description: "A test registry" stability: stable "#, + &mut vec![], ) .expect("Failed to load RegistryManifest"); @@ -643,8 +671,9 @@ stability: stable r#" file_format: "manifest/2.0" schema_url: "https://example.com/schemas/1.0.0" -resolved_schema_uri: "https://example.com/resolved/1.0.0/resolved.yaml" +resolved_registry_uri: "https://example.com/resolved/1.0.0/resolved.yaml" "#, + &mut vec![], ) .expect("Failed to load RegistryManifest"); @@ -660,11 +689,11 @@ mod publication_tests { use super::*; use crate::stability::Stability; - fn manifest_from_yaml(yaml: &str) -> Result { + fn manifest_from_yaml(yaml: &str, nfes: &mut Vec) -> Result { use std::io::Write; let mut tmp = tempfile::NamedTempFile::new().unwrap(); tmp.write_all(yaml.as_bytes()).unwrap(); - RegistryManifest::try_from_file(tmp.path(), &mut vec![]) + RegistryManifest::try_from_file(tmp.path(), nfes) } #[test] @@ -675,6 +704,7 @@ schema_url: "https://example.com/schemas/1.0.0" description: "A test registry" stability: stable "#, + &mut vec![], ) .expect("Failed to load RegistryManifest"); @@ -682,10 +712,10 @@ stability: stable panic!("Expected a Definition manifest"); }; - let resolved_schema_uri = "https://example.com/resolved/1.0.0/resolved.yaml".to_owned(); + let resolved_registry_uri = "https://example.com/resolved/1.0.0/resolved.yaml".to_owned(); let publication = PublicationRegistryManifest::try_from_registry_manifest( &definition, - resolved_schema_uri.clone(), + resolved_registry_uri.clone(), ); assert_eq!(publication.file_format, PUBLICATION_MANIFEST_FILE_FORMAT); @@ -696,19 +726,20 @@ stability: stable assert_eq!(publication.description.as_deref(), Some("A test registry")); assert_eq!(publication.stability, Stability::Stable); assert!(publication.dependencies.is_empty()); - assert_eq!(publication.resolved_schema_uri, resolved_schema_uri); + assert_eq!(publication.resolved_registry_uri, resolved_registry_uri); } #[test] fn test_publication_manifest_parsed_as_publication_variant() { - // A manifest with file_format "manifest/2.0" and resolved_schema_uri + // A manifest with file_format "manifest/2.0" and resolved_registry_uri // is parsed as the Publication variant. let manifest = manifest_from_yaml( r#" schema_url: "https://example.com/schemas/1.0.0" file_format: "manifest/2.0" -resolved_schema_uri: "https://example.com/resolved/1.0.0/resolved.yaml" +resolved_registry_uri: "https://example.com/resolved/1.0.0/resolved.yaml" "#, + &mut vec![], ) .expect("Failed to load RegistryManifest"); @@ -717,4 +748,77 @@ resolved_schema_uri: "https://example.com/resolved/1.0.0/resolved.yaml" "expected Publication variant, got {manifest:?}" ); } + + /// A publication YAML using the deprecated `resolved_schema_uri` field name + /// must still deserialize correctly into the renamed `resolved_registry_uri` + /// field, and surface a deprecation warning via `nfes`. + #[test] + fn test_publication_manifest_accepts_deprecated_resolved_schema_uri() { + let mut nfes = vec![]; + let manifest = manifest_from_yaml( + r#" +file_format: "manifest/2.0" +schema_url: "https://example.com/schemas/1.0.0" +resolved_schema_uri: "https://example.com/resolved/1.0.0/resolved.yaml" +"#, + &mut nfes, + ) + .expect("Failed to load RegistryManifest"); + + let RegistryManifest::Publication(pubm) = manifest else { + panic!("expected Publication variant"); + }; + assert_eq!( + pubm.resolved_registry_uri, + "https://example.com/resolved/1.0.0/resolved.yaml" + ); + assert!( + nfes.iter() + .any(|w| matches!(w, DeprecatedSyntaxInRegistryManifest { .. })), + "expected a DeprecatedSyntaxInRegistryManifest warning, got: {nfes:?}" + ); + } + + /// When both the deprecated `resolved_schema_uri` and the new + /// `resolved_registry_uri` are provided, the new name wins (no warning). + #[test] + fn test_publication_manifest_new_name_wins_over_deprecated() { + let mut nfes = vec![]; + let manifest = manifest_from_yaml( + r#" +file_format: "manifest/2.0" +schema_url: "https://example.com/schemas/1.0.0" +resolved_registry_uri: "https://example.com/resolved/new.yaml" +resolved_schema_uri: "https://example.com/resolved/old.yaml" +"#, + &mut nfes, + ) + .expect("Failed to load RegistryManifest"); + + let RegistryManifest::Publication(pubm) = manifest else { + panic!("expected Publication variant"); + }; + assert_eq!( + pubm.resolved_registry_uri, + "https://example.com/resolved/new.yaml" + ); + } + + /// A publication manifest that omits both the new and deprecated names + /// is rejected with `InvalidPublicationManifest`. + #[test] + fn test_publication_manifest_missing_resolved_registry_uri_is_error() { + let result = manifest_from_yaml( + r#" +file_format: "manifest/2.0" +schema_url: "https://example.com/schemas/1.0.0" +"#, + &mut vec![], + ); + assert!(matches!( + result, + Err(Error::InvalidPublicationManifest { details, .. }) + if details.contains("resolved_registry_uri") + )); + } } diff --git a/crates/weaver_semconv/src/registry_repo.rs b/crates/weaver_semconv/src/registry_repo.rs index 823b4c962..625549198 100644 --- a/crates/weaver_semconv/src/registry_repo.rs +++ b/crates/weaver_semconv/src/registry_repo.rs @@ -174,12 +174,12 @@ impl RegistryRepo { self.manifest.as_ref() } - /// Returns the resolved schema URI, if available in the manifest. + /// Returns the resolved registry URI, if available in the manifest. #[must_use] - pub fn resolved_schema_uri(&self) -> Option { + pub fn resolved_registry_uri(&self) -> Option { let manifest = self.manifest.as_ref()?; let resolved_uri: &str = match manifest { - RegistryManifest::Publication(m) => &m.resolved_schema_uri, + RegistryManifest::Publication(m) => &m.resolved_registry_uri, RegistryManifest::Definition(_) => return None, }; match get_path_type(resolved_uri) { @@ -270,7 +270,7 @@ mod tests { }; assert_eq!(manifest.name(), "resolved"); - let Some(resolved_path) = repo.resolved_schema_uri() else { + let Some(resolved_path) = repo.resolved_registry_uri() else { panic!( "Should find a resolved schema path from manifest in {}", repo.registry_path_repr() @@ -287,7 +287,7 @@ mod tests { }; let repo = RegistryRepo::try_new(None, ®istry_path, &mut vec![]) .expect("Failed to load test repository."); - let Some(resolved_path) = repo.resolved_schema_uri() else { + let Some(resolved_path) = repo.resolved_registry_uri() else { panic!( "Should find a resolved schema path from manifest in {}", repo.registry_path_repr() @@ -301,7 +301,7 @@ mod tests { }; let repo = RegistryRepo::try_new(None, ®istry_path, &mut vec![]) .expect("Failed to load test repository."); - let Some(resolved_path) = repo.resolved_schema_uri() else { + let Some(resolved_path) = repo.resolved_registry_uri() else { panic!( "Should find a resolved schema path from manifest in {}", repo.registry_path_repr() diff --git a/crates/weaver_semconv/tests/published_repository/3.0.0/registry_manifest.yaml b/crates/weaver_semconv/tests/published_repository/3.0.0/registry_manifest.yaml index 2d958f56a..73de27d70 100644 --- a/crates/weaver_semconv/tests/published_repository/3.0.0/registry_manifest.yaml +++ b/crates/weaver_semconv/tests/published_repository/3.0.0/registry_manifest.yaml @@ -3,4 +3,4 @@ description: Test repository that has been resolved. schema_url: http://resolved/3.0.0 repository_url: https://github.com/open-telemetry/weaver.git stability: stable -resolved_schema_uri: resolved_schema.yaml +resolved_registry_uri: resolved_schema.yaml diff --git a/crates/weaver_semconv/tests/published_repository/resolved/1.0.0 b/crates/weaver_semconv/tests/published_repository/resolved/1.0.0 index 4a4ab2ef1..8606aca7c 100644 --- a/crates/weaver_semconv/tests/published_repository/resolved/1.0.0 +++ b/crates/weaver_semconv/tests/published_repository/resolved/1.0.0 @@ -3,4 +3,4 @@ description: Test repository that has been resolved. schema_url: http://resolved/1.0.0 repository_url: https://github.com/open-telemetry/weaver.git stability: stable -resolved_schema_uri: resolved_1.0.0.yaml +resolved_registry_uri: resolved_1.0.0.yaml diff --git a/crates/weaver_semconv/tests/published_repository/resolved/2.0.0 b/crates/weaver_semconv/tests/published_repository/resolved/2.0.0 index 7ce4806d3..1cc8a2601 100644 --- a/crates/weaver_semconv/tests/published_repository/resolved/2.0.0 +++ b/crates/weaver_semconv/tests/published_repository/resolved/2.0.0 @@ -3,4 +3,4 @@ description: Test repository that has been resolved. schema_url: http://resolved/2.0.0 repository_url: https://github.com/open-telemetry/weaver.git stability: stable -resolved_schema_uri: https://github.com/open-telemetry/weaver.git\creates/weaver_semconv/tests/published_respository/resolved/resolved_2.0.0 +resolved_registry_uri: https://github.com/open-telemetry/weaver.git\creates/weaver_semconv/tests/published_respository/resolved/resolved_2.0.0 diff --git a/crates/xtask/src/schema_compat.rs b/crates/xtask/src/schema_compat.rs index 607516a65..962b0068a 100644 --- a/crates/xtask/src/schema_compat.rs +++ b/crates/xtask/src/schema_compat.rs @@ -23,11 +23,11 @@ const TEMP_REPO_DIR: &str = "schema-compat-temp-repo"; // Temporarily disabled compat testing for V2 schemas. // TODO: Enable testing when V2 schemas are marked stable. const CHECKS: &[(&str, &str, &str)] = &[ - ( - "publication-manifest-v2", - "schemas/publication-manifest.v2.json", - "PublicationManifestV2", - ), + // ( + // "publication-manifest-v2", + // "schemas/publication-manifest.v2.json", + // "PublicationManifestV2", + // ), // ( // "resolved-registry-v2", // "schemas/semconv.resolved.v2.json", diff --git a/docs/usage.md b/docs/usage.md index 9978511c9..bb990072f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -624,7 +624,7 @@ Packages a semantic convention registry into a self-contained artifact. Possible values: `true`, `false` * `-o`, `--output ` — Path to the directory where the package will be written. [default: output] -* `--resolved-schema-uri ` — URI where the resolved schema will eventually be published. This value is embedded in the publication manifest as `resolved_schema_uri` +* `--resolved-registry-uri ` — URI where the resolved registry artifact will eventually be published. This value is embedded in the publication manifest as `resolved_registry_uri` * `-p`, `--policy ` — Optional list of policy files or directories to check against the files of the semantic convention registry. If a directory is provided all `.rego` files in the directory will be loaded * `--skip-policies ` — Skip the policy checks. [default: false] diff --git a/schemas/publication-manifest.v2.json b/schemas/publication-manifest.v2.json index 8b101764b..5bfd33360 100644 --- a/schemas/publication-manifest.v2.json +++ b/schemas/publication-manifest.v2.json @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "PublicationRegistryManifest", - "description": "Represents the publication manifest for a packaged semantic convention registry.\n\nThis is produced by `weaver registry package` and describes the contents of\na self-contained registry artifact, including its resolved schema location.", + "description": "Represents the publication manifest for a packaged semantic convention registry.\n\nThis is produced by `weaver registry package` and describes the contents of\na self-contained registry artifact, including the URI of the resolved\nregistry artifact (`resolved.yaml`).", "type": "object", "properties": { "dependencies": { @@ -23,8 +23,8 @@ "type": "string", "const": "manifest/2.0" }, - "resolved_schema_uri": { - "description": "URI pointing to the resolved telemetry schema included in this package.", + "resolved_registry_uri": { + "description": "URI pointing to the resolved registry artifact included in this package.", "type": "string" }, "schema_url": { @@ -40,7 +40,7 @@ "required": [ "file_format", "schema_url", - "resolved_schema_uri" + "resolved_registry_uri" ], "$defs": { "Dependency": { diff --git a/schemas/semconv-schemas.md b/schemas/semconv-schemas.md index 8b4333500..6254484bd 100644 --- a/schemas/semconv-schemas.md +++ b/schemas/semconv-schemas.md @@ -117,9 +117,9 @@ See the [publication manifest JSON schema](/schemas/publication-manifest.v2.json Properties: -- **file_format**: `"manifest/2.0.0"` +- **file_format**: `"manifest/2.0"` - **schema_url**: Schema URL that uniquely identifies this registry and its version. -- **resolved_schema_uri**: URI pointing to the resolved schema file included in the package. +- **resolved_registry_uri**: URI pointing to the resolved registry artifact included in the package. - **stability**: Stability level of the registry (optional, defaults to `development`). - **description**: Description of the registry (optional). - **dependencies**: Same structure as in the [definition manifest](#definition-manifest). @@ -127,9 +127,9 @@ Properties: For example, the publication manifest produced from the definition manifest above: ```yaml -file_format: "manifest/2.0.0" +file_format: "manifest/2.0" schema_url: https://acme.com/schemas/my-registry/1.0.0 -resolved_schema_uri: https://acme.com/schemas/my-registry/1.0.0/resolved.yaml +resolved_registry_uri: https://acme.com/schemas/my-registry/1.0.0/resolved.yaml stability: development description: My custom registry dependencies: @@ -149,7 +149,7 @@ The resolved version of the metric above would look like this: ```yaml # returned from https://acme.com/schemas/my-registry/1.0.0/resolved.yaml -file_format: "resolved/2.0.0" +file_format: "resolved/2.0" schema_url: https://opentelemetry.io/schemas/semconv/1.{future}.0 attribute_catalog: ... @@ -189,7 +189,7 @@ Attribute references are indexes into the `attribute_catalog` array, paired with #### Resolved schema properties -- **file_format**: `"resolved/2.0.0"` +- **file_format**: `"resolved/2.0"` - **schema_url**: The Schema URL where this registry is or will be published - **attribute_catalog**: All attribute definitions. May include duplicate entries for the same key when refinements override attribute properties. Each entry has: diff --git a/schemas/weaver-config.json b/schemas/weaver-config.json index 8de9fff83..c9c3938b9 100644 --- a/schemas/weaver-config.json +++ b/schemas/weaver-config.json @@ -315,8 +315,8 @@ "type": "string", "default": "output" }, - "resolved_schema_uri": { - "description": "URI where the resolved schema will eventually be published.\nThis value is embedded in the publication manifest as `resolved_schema_uri`.", + "resolved_registry_uri": { + "description": "URI where the resolved registry artifact will eventually be published.\nThis value is embedded in the publication manifest as `resolved_registry_uri`.", "type": [ "string", "null" diff --git a/src/registry/package.rs b/src/registry/package.rs index 5e0a0c4ea..c45f1c92a 100644 --- a/src/registry/package.rs +++ b/src/registry/package.rs @@ -35,11 +35,11 @@ pub struct RegistryPackageArgs { #[config(default = "output")] output: Option, - /// URI where the resolved schema will eventually be published. - /// This value is embedded in the publication manifest as `resolved_schema_uri`. - #[arg(long)] + /// URI where the resolved registry artifact will eventually be published. + /// This value is embedded in the publication manifest as `resolved_registry_uri`. + #[arg(long, alias = "resolved-schema-uri")] #[config] - resolved_schema_uri: Option, + resolved_registry_uri: Option, /// Policy parameters #[command(flatten)] @@ -72,9 +72,16 @@ pub(crate) fn command( ) -> Result { let cmd_config = load_config(args, cfg); let output = cmd_config.config.output; - let resolved_schema_uri = cmd_config.config.resolved_schema_uri.ok_or_else(|| { + if std::env::args() + .any(|a| a == "--resolved-schema-uri" || a.starts_with("--resolved-schema-uri=")) + { + log::warn!( + "The `--resolved-schema-uri` flag is deprecated; use `--resolved-registry-uri` instead." + ); + } + let resolved_registry_uri = cmd_config.config.resolved_registry_uri.ok_or_else(|| { DiagnosticMessages::from(Error::Config { - error: "resolved_schema_uri is required (set via --resolved-schema-uri or [package] config)".to_owned(), + error: "resolved_registry_uri is required (set via --resolved-registry-uri or [package] config)".to_owned(), }) })?; info!("Packaging registry `{}`", cmd_config.registry.registry); @@ -129,7 +136,7 @@ pub(crate) fn command( })?; let publication_manifest = PublicationRegistryManifest::try_from_registry_manifest( &definition_manifest, - resolved_schema_uri, + resolved_registry_uri, ); write_yaml(&output.join("resolved.yaml"), resolved_v2.resolved_schema())?; @@ -164,7 +171,7 @@ mod tests { registry_path: &str, output: PathBuf, v2: bool, - resolved_schema_uri: &str, + resolved_registry_uri: &str, ) -> RegistryPackageArgs { RegistryPackageArgs { registry: RegistryArgs { @@ -175,7 +182,7 @@ mod tests { ..Default::default() }, output: Some(output), - resolved_schema_uri: Some(resolved_schema_uri.to_owned()), + resolved_registry_uri: Some(resolved_registry_uri.to_owned()), policy: PolicyArgs { skip_policies: Some(true), ..Default::default() @@ -223,7 +230,7 @@ mod tests { assert_eq!(manifest.file_format, PUBLICATION_MANIFEST_FILE_FORMAT); assert_eq!(manifest.schema_url.as_str(), "https://test/schemas/1.0.0"); assert_eq!( - manifest.resolved_schema_uri, + manifest.resolved_registry_uri, "https://test/semconv/1.0.0/resolved.yaml" ); assert_eq!( diff --git a/tests/published_v2_registry/manifest.yaml b/tests/published_v2_registry/manifest.yaml index 66b4e6340..a633d69d6 100644 --- a/tests/published_v2_registry/manifest.yaml +++ b/tests/published_v2_registry/manifest.yaml @@ -2,4 +2,4 @@ file_format: manifest/2.0 schema_url: https://test/schemas/1.0.0 description: A test registry for packaging tests. stability: stable -resolved_schema_uri: resolved.yaml +resolved_registry_uri: resolved.yaml From 6086b6b558ac556c1fab6faf2f91b1bba3ee8a71 Mon Sep 17 00:00:00 2001 From: liudmila molkova Date: Fri, 8 May 2026 22:16:20 -0700 Subject: [PATCH 2/2] up --- CHANGELOG.md | 1 + crates/weaver_semconv/src/manifest.rs | 1 - crates/weaver_semconv/src/registry_repo.rs | 10 +++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471bf3334..75401f5a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. # Unreleased +- Rename `resolved_schema_uri` to `resolved_registry_uri` in publication manifest and in `package` command. ([#1425](https://github.com/open-telemetry/weaver/pull/1425)) - Fix V2 resolver overwriting `SpanName.note` with the span type id during resolution. ([#1401](https://github.com/open-telemetry/weaver/pull/1401)) - New feature ([#1344](https://github.com/open-telemetry/weaver/issues/1344)) - Support authenticated HTTP downloads of remote registries, including GitHub private release assets. Auth is configured per-URL via `[[auth]]` entries in `.weaver.toml` (longest `url_prefix` wins), with tokens sourced from a literal `token`, a `token_env` variable, or a `token_command` helper (e.g. `["gh", "auth", "token"]`). ([#1356](https://github.com/open-telemetry/weaver/pull/1356) by @jerbly) - New feature - `.weaver.toml` project configuration now covers all subcommands allowing for simplified configuration management. See the [README.md](https://github.com/open-telemetry/weaver/blob/main/crates/weaver_config/README.md) ([#1410](https://github.com/open-telemetry/weaver/pull/1410) by @jerbly) diff --git a/crates/weaver_semconv/src/manifest.rs b/crates/weaver_semconv/src/manifest.rs index 1df18ffcf..9085ed3fd 100644 --- a/crates/weaver_semconv/src/manifest.rs +++ b/crates/weaver_semconv/src/manifest.rs @@ -161,7 +161,6 @@ struct RawManifestFields { stability: Stability, resolved_registry_uri: Option, /// Deprecated alias for `resolved_registry_uri`. - #[allow(deprecated)] resolved_schema_uri: Option, } diff --git a/crates/weaver_semconv/src/registry_repo.rs b/crates/weaver_semconv/src/registry_repo.rs index 625549198..e76ebf3ff 100644 --- a/crates/weaver_semconv/src/registry_repo.rs +++ b/crates/weaver_semconv/src/registry_repo.rs @@ -178,11 +178,11 @@ impl RegistryRepo { #[must_use] pub fn resolved_registry_uri(&self) -> Option { let manifest = self.manifest.as_ref()?; - let resolved_uri: &str = match manifest { + let registry_uri: &str = match manifest { RegistryManifest::Publication(m) => &m.resolved_registry_uri, RegistryManifest::Definition(_) => return None, }; - match get_path_type(resolved_uri) { + match get_path_type(registry_uri) { weaver_common::PathType::RelativePath => { // We need to understand if the manifest URI is the same as the registry URI. let vdir_was_manifest_file = self @@ -192,15 +192,15 @@ impl RegistryRepo { Some(self.registry.vdir_path().map_sub_folder(|path| { if vdir_was_manifest_file { match Path::new(&path).parent() { - Some(parent) => format!("{}/{resolved_uri}", parent.display()), + Some(parent) => format!("{}/{registry_uri}", parent.display()), None => "".to_owned(), } } else { - format!("{path}/{resolved_uri}") + format!("{path}/{registry_uri}") } })) } - _ => resolved_uri.try_into().ok(), + _ => registry_uri.try_into().ok(), } }