Skip to content

Check deprecated.rename_to type compatibility and more#2688

Merged
lmolkova merged 3 commits intoopen-telemetry:mainfrom
lmolkova:deprecated-rego-checks
Aug 27, 2025
Merged

Check deprecated.rename_to type compatibility and more#2688
lmolkova merged 3 commits intoopen-telemetry:mainfrom
lmolkova:deprecated-rego-checks

Conversation

@lmolkova
Copy link
Copy Markdown
Member

@lmolkova lmolkova commented Aug 27, 2025

Fixes #2630, #2627

Add policies that check:

  • renamed_to type is the same:
    • OK: same standard type to same standard type, enum <-> enum of the same type, string enum <-> string, int enum <-> int,
    • Not OK: string <-> int and such, string <-> int enum, string enum <-> int enum
  • renamed_to enum member exists on the same enum and is not deprecated

Fixes existing violations, brings back some dropped deprecations - context https://cloud-native.slack.com/archives/C041APFBYQP/p1756196369228549?thread_ts=1756165118.156879&cid=C041APFBYQP

The reason to keep type the same when renaming is the following: the goal is to apply rename and other transformations in the collector (and make schema transformations more real). Rename transformation would literally rename attribute. We could introduce more complex transformations that could change type, etc, but they are not supported yet. So rename deprecation can only be used with pure renames at least for the time being.

@lmolkova lmolkova requested a review from a team as a code owner August 27, 2025 00:30
@lmolkova lmolkova requested review from a team as code owners August 27, 2025 00:30
@lmolkova lmolkova changed the title Check deprecated.rename_to type compatibility Check deprecated.rename_to type compatibility and more Aug 27, 2025
@lmolkova lmolkova added Skip Changelog Label to skip the changelog check and removed Skip Changelog Label to skip the changelog check labels Aug 27, 2025
@maryliag
Copy link
Copy Markdown
Contributor

missing changelog, otherwise LGTM

@lmolkova lmolkova moved this from Untriaged to Needs More Approval in Semantic Conventions Triage Aug 27, 2025
Comment thread model/gen-ai/deprecated/registry-deprecated.yaml Outdated
@lmolkova lmolkova added this pull request to the merge queue Aug 27, 2025
Merged via the queue into open-telemetry:main with commit 570283b Aug 27, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project
Status: V1 - Stable Semantics

Development

Successfully merging this pull request may close these issues.

Deprecated: renamed policy should check if member exists

4 participants