chore: sdk/internal/x - generate x package from shared template - #7495
Conversation
- Add sdk/internal/gen.go with gotmpl directives to generate x/x.go and x/x_test.go - Refactor sdk/internal/x/x.go to generic Feature[T] with multi-key support and Keys() - Move Resource feature into sdk/internal/x/features.go (case-insensitive true enables) - Add tests: generic feature tests in x_test.go and Resource tests in features_test.go - Aligns with sdk/log/internal/x pattern introduced in PR open-telemetry#7389 Internal note: replaces Key() with Keys() for internal Feature API. Build and lints pass
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7495 +/- ##
=====================================
Coverage 86.2% 86.2%
=====================================
Files 295 294 -1
Lines 25864 25844 -20
=====================================
- Hits 22302 22286 -16
+ Misses 3189 3185 -4
Partials 373 373
🚀 New features to boost your workflow:
|
|
Please fix the lint errors; we can verify them with |
|
@flc1125 done. Please check. |
MrAlias
left a comment
There was a problem hiding this comment.
This should replace sdk/trace/internal/x instead of being added additionally. There should not be more than one x package in a module to prevent duplication and confusion.
The replacement and associated updates should be included here or things should be kept the way they currently are.
@flc1125 and @MrAlias should I make changes based on this in this PR or we can take it up later? If for this PR, can you once explain what needs to be done I ll do that |
|
Include the changes in this PR. You "should replace Any dependencies on |
…ation - Delete sdk/trace/internal/x/x.go and sdk/trace/internal/x/features.go - Experimental flags now live under sdk/internal/x - Keep README redirect (optional) to guide developers - Build and lints remain green
…ation - Delete sdk/trace/internal/x/x.go and sdk/trace/internal/x/features.go - Experimental flags now live under sdk/internal/x - Keep README redirect (optional) to guide developers - Build and lints remain green
|
@flc1125 @MrAlias I replaced the usages of sdk/trace/internal/x. Then I thought why would I even need to keep this package. Should I delete this package sdk/trace/internal/x? I tried removing everything, but make ci regenerates the code. Should we just keep those files for now. In the previous commit, they got regenerated when I ran make ci. |
We can remove them. |
Closes #7384
Internal note: replaces Key() with Keys() for internal Feature API. Build and lints pass