Skip to content

Conversation

rpotluri-f5
Copy link

When an attribute with enum type is deprecated enum members now automatically inherit the deprecated status. This eliminates the need to manually deprecate each enum member individually, reducing maintenance overhead and preventing inconsistencies.

Fixes #878

When an attribute with enum type is deprecated enum members now automatically inherit the deprecated status. This eliminates the need to manually deprecate each enum member individually, reducing maintenance overhead and preventing inconsistencies.

Fixes open-telemetry#878
@rpotluri-f5 rpotluri-f5 requested a review from a team as a code owner August 27, 2025 21:09
Copy link

linux-foundation-easycla bot commented Aug 27, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.0%. Comparing base (b5900b5) to head (d0ecec4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #899   +/-   ##
=====================================
  Coverage   77.9%   78.0%           
=====================================
  Files         76      76           
  Lines       5971    5995   +24     
=====================================
+ Hits        4656    4680   +24     
  Misses      1315    1315           

☔ 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.

@rpotluri-f5 rpotluri-f5 marked this pull request as draft August 28, 2025 04:50
@rpotluri-f5 rpotluri-f5 marked this pull request as ready for review August 28, 2025 05:14
@jsuereth
Copy link
Contributor

@lmolkova Would you mind taking a look at this feature before we review the rust code?

The idea is simple - deprecated is inherited down automatically instead of requiring users to do so manually.

// Only inherit deprecation if member doesn't have explicit deprecation
if member.deprecated.is_none() {
// Inherit the parent's deprecation status
member.deprecated = deprecated.clone();

Choose a reason for hiding this comment

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

@rpotluri-f5 i think we need to extend this logic to be such that if the attribute deprecation reason is obsoleted, then it is cloned otherwise the enum member deprecation reason should be uncategorised, note/brief should be copied across and nothing else. This is to handle the fact that an attribute rename is different to a member rename as the renamed to have different targets.

@lmolkova
Copy link
Member

lmolkova commented Aug 30, 2025

Thanks for the contribution, @rpotluri-f5!
Unfortunately, I don't think we should have this feature. I've left a comment on the issue - #878 (comment) to explain why.

@rpotluri-f5
Copy link
Author

Thanks for the contribution, @rpotluri-f5! Unfortunately, I don't think we should have this feature. I've left a comment on the issue - #878 (comment) to explain why.

Your explanation makes sense. I will pick another open item to contribute to.

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.

Deprecation of enum members when attribute is deprecated
4 participants