Skip to content

[v2] Remove 'unspecified' deprecation reason, require structured deprecated - #1929

Open
lmolkova wants to merge 7 commits into
open-telemetry:mainfrom
lmolkova:remove-unspecified-deprecation
Open

lmolkova wants to merge 7 commits into
open-telemetry:mainfrom
lmolkova:remove-unspecified-deprecation

Conversation

@lmolkova

Copy link
Copy Markdown
Member

Fixes #1828
Fixes #988 (for v2)

v2 now has its own Deprecated type, separate from the shared v1 one.

  • unspecified is gone from the v2 definition, resolved and materialized schemas. A plain string deprecated is rejected in v2 definitions.
  • note is required on obsoleted and uncategorized, optional on renamed. Weaver doesn't store a default note anymore. Fields that don't belong to the reason, like renamed_to on uncategorized, are rejected.
  • v1 to v2 conversion maps plain string deprecations to uncategorized. v1 output doesn't change.
  • Display prints the note, or "Replaced by x." for a renamed without one. Forge markdown templates use a matching deprecated_note macro.
  • Diff output leaves out note on renamed items that don't have one.
  • The live-check deprecated advice context now has a structured deprecated object, serialized from the v2 type, instead of deprecation_reason / deprecation_note. New fields on Deprecated show up there with no extra code.

Breaking: resolved v2 registries built by older versions can contain reason: unspecified and need to be regenerated.

@lmolkova
lmolkova requested a review from a team as a code owner November 25, 2026 01:18
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-12-05 20:05 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with the author? Comment /dashboard route:author to route it back.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.2%. Comparing base (624ea48) to head (e00c07d).

Files with missing lines Patch % Lines
crates/weaver_resolved_schema/src/v2/mod.rs 33.3% 2 Missing ⚠️
crates/weaver_live_check/src/lib.rs 90.0% 1 Missing ⚠️
crates/weaver_semconv/src/v2/deprecated.rs 91.6% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1929   +/-   ##
=====================================
  Coverage   88.1%   88.2%           
=====================================
  Files        169     170    +1     
  Lines      19574   19591   +17     
=====================================
+ Hits       17263   17291   +28     
+ Misses      2311    2300   -11     

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active template issues cause rename entries to run together and explicitly empty deprecation notes to render replacement messages with empty targets.

2 open issues
What changed in this PR

This PR introduces a dedicated structured deprecation type for v2 semantic conventions, addressing #1828 and #988 while preserving the separate v1 model.

Changes:

  • Removes unspecified from v2 and enforces reason-specific fields, with conversion support for legacy v1 deprecations.
  • Updates schemas, diff output, documentation templates, and UI handling for optional rename notes.
  • Changes live-check advice to expose a structured deprecated object and documents the migration requirements.
File Description
ui/​src/​lib/​api.ts Removes the explicit unspecified reason literal.
ui/​src/​components/​StabilityBadge.tsx Adds replacement names to deprecation tooltips.
src/​serve/​server.rs Uses the v2 deprecation type.
schemas/​semconv.schema.v2.json Enforces structured, reason-specific deprecations.
schemas/​semconv.resolved.v2.json Updates resolved deprecation constraints.
schemas/​semconv.materialized.v2.json Updates materialized deprecation constraints.
schemas/​semconv.diff.v2.json Makes rename notes optional.
schemas/​semconv-syntax.v2.md Documents supported reasons and note requirements.
defaults/​diff_templates/​markdown/​diff.md.j2 Conditionally renders rename notes.
defaults/​diff_templates/​ansi/​diff.txt.j2 Conditionally renders terminal rename notes.
crates/​weaver_version/​src/​schema_changes.rs Represents rename notes as optional.
crates/​weaver_semconv/​src/​v2/​span.rs Uses v2 deprecations for spans.
crates/​weaver_semconv/​src/​v2/​mod.rs Exposes the new type in common fields.
crates/​weaver_semconv/​src/​v2/​metric.rs Uses v2 deprecations for metrics.
crates/​weaver_semconv/​src/​v2/​event.rs Uses v2 deprecations for events.
crates/​weaver_semconv/​src/​v2/​entity.rs Uses v2 deprecations for entities.
crates/​weaver_semconv/​src/​v2/​deprecated.rs Defines and tests validation, display, and conversions.
crates/​weaver_semconv/​src/​v2/​attribute.rs Requires structured enum-member deprecations.
crates/​weaver_semconv/​src/​convert.rs Converts between v1 and v2 deprecation types.
crates/​weaver_search/​src/​types.rs Uses v2 deprecations in search types.
crates/​weaver_search/​src/​lib.rs Updates search test fixtures.
crates/​weaver_resolver/​src/​imports.rs Converts deprecations at import boundaries.
crates/​weaver_resolver/​src/​dependency.rs Converts dependency deprecation metadata.
crates/​weaver_resolver/​src/​attribute.rs Converts deprecations during attribute lookup.
crates/​weaver_resolved_schema/​src/​v2/​registry.rs Updates registry test fixtures.
crates/​weaver_resolved_schema/​src/​v2/​mod.rs Preserves absent rename notes in diffs.
crates/​weaver_resolved_schema/​src/​v1/​mod.rs Preserves populated notes in v1 diffs.
crates/​weaver_resolved_schema/​src/​convert.rs Updates resolved-schema conversions and tests.
crates/​weaver_live_check/​tests/​livecheck_emit.rs Updates emitted advice context fixtures.
crates/​weaver_live_check/​src/​live_checker.rs Updates deprecation fixtures and assertions.
crates/​weaver_live_check/​src/​lib.rs Normalizes versioned deprecations to v2.
crates/​weaver_live_check/​src/​advice/​deprecated_advisor.rs Serializes structured deprecation advice.
crates/​weaver_forge/​templates/​registry/​markdown/​spans.md.j2 Uses shared deprecation formatting.
crates/​weaver_forge/​templates/​registry/​markdown/​metrics.md.j2 Uses shared deprecation formatting.
crates/​weaver_forge/​templates/​registry/​markdown/​events.md.j2 Uses shared deprecation formatting.
crates/​weaver_forge/​templates/​registry/​markdown/​entities.md.j2 Uses shared deprecation formatting.
crates/​weaver_forge/​templates/​registry/​markdown/​attributes.md.j2 Imports and uses shared deprecation formatting.
crates/​weaver_forge/​templates/​registry/​markdown/​_macros.j2 Adds fallback text for note-less renames.
CHANGELOG.md Records breaking changes and regeneration requirements.

Review effort: Balanced

@lmolkova
lmolkova force-pushed the remove-unspecified-deprecation branch from 141df06 to c22dad8 Compare November 26, 2026 02:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Formal schema changes and breaking persisted v2 and live-check contracts require specification-approver review and maintainer confirmation of downstream compatibility and the registry regeneration rollout.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

Review effort: Balanced

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.

[v2] Remove 'unspecified' deprecation reason deprecation struct deserialization: validate properties depending on reason

2 participants