Fail on unstructured deprecated property under --future flag#737
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enforces structured deprecation in semantic conventions by failing on unstructured deprecated properties under the --future flag. Key changes include updating expected test violation counts, introducing a new error variant for unstructured deprecated properties, and modifying deprecation parsing and messaging across modules.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/registry_generate.rs | Updated expected policy violation count to account for the new error. |
| tests/registry_check.rs | Adjusted expectation and inline comment to reflect one additional violation. |
| src/registry/check.rs | Incorporated the new unstructured deprecated property error into validation logic. |
| crates/weaver_semconv/src/lib.rs | Added a new Error variant (UnstructuredDeprecatedProperty) with updated error messaging. |
| crates/weaver_semconv/src/group.rs | Inserted new checks for unstructured deprecated notes on groups and attributes. |
| crates/weaver_semconv/src/deprecated.rs | Modified deprecation deserialization to use Deprecated::Unspecified for string inputs. |
| crates/weaver_resolved_schema/src/lib.rs | Updated pattern matching to accommodate the revised deprecation variants. |
| crates/weaver_live_check/src/advice.rs | Adjusted handling of deprecation variants to reflect changes in naming. |
| crates/weaver_forge/src/extensions/otel.rs | Revised output message for deprecated properties to align with updated naming. |
| crates/weaver_forge/expected_output/test/resource/library.md | Updated deprecation output in documentation. |
| crates/weaver_forge/data/exporter.yaml | Modified deprecation fields from legacy string format to structured mapping. |
| crates/weaver_codegen_test/semconv_registry/registry/deprecated/network.yaml | Aligned deprecated field formatting across network attributes. |
Comments suppressed due to low confidence (2)
crates/weaver_semconv/src/deprecated.rs:80
- [nitpick] Consider standardizing the deprecation variant naming between the string branch (using 'Unspecified') and the map branch (using 'Uncategorized') to reduce potential confusion and improve maintainability.
Ok(Deprecated::Unspecified { note: value.to_owned() })
crates/weaver_forge/src/extensions/otel.rs:852
- [nitpick] Verify that changing the output label to 'unspecified' is intentional and that it aligns consistently with the updated deprecation error messaging across all modules.
"unspecified: Replaced by new_name."
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #737 +/- ##
=====================================
Coverage 76.7% 76.7%
=====================================
Files 65 65
Lines 5036 5046 +10
=====================================
+ Hits 3864 3873 +9
- Misses 1172 1173 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5ec290b to
5154f1d
Compare
|
@lmolkova Today I'm preparing a release, could you:
Thanks |
4e31c0d to
0135bcd
Compare
we don't have means to enforce using structured deprecation in semconv since
deprecateddefaults toUncategorizedduring deserialization and it's not possible to distinguishdeprecated: notefromdeprecated: \n reason: unstructured \n note: note.Fixing it.