-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[extension] Error out if passed extension.Settings has incorrect type #12305
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12305 +/- ##
==========================================
- Coverage 91.41% 91.39% -0.03%
==========================================
Files 467 468 +1
Lines 25583 25598 +15
==========================================
+ Hits 23387 23395 +8
- Misses 1778 1787 +9
+ Partials 418 416 -2 ☔ View full report in Codecov by Sentry. |
set := extensiontest.NewNopSettings() | ||
set.ID = component.NewID(factory.Type()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we switch extensiontest.NewNopSettings()
to accept a type? Also we can generate a helper like metadatatest.NewNopSettings
for components that calls the extensiontest but passes the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added extensiontest.NewNopSettingsWithType
, PTAL!
183d7ed
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR makes `"go.opentelemetry.io/collector/component"` to be always present to create component type: ``` var typ = component.MustNewType("{{ .Type }}") ``` cc @mx-psi <!-- Issue number if applicable --> #### Link to tracking issue Relevant to #12305 <!--Describe what testing was performed and which tests were added.--> #### Testing n/a <!--Describe the documentation added.--> #### Documentation n/a <!--Please delete paragraphs that you did not use before submitting.-->
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> Deprecate `Create*` methods. This is a small part of #12305, but applied to all other component kinds #### Link to tracking issue Updates #12221
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> Creates `NewNopSettingsWithType` function on test modules and deprecates the `NewNopSettings` functions on those modules. Replace all usages of `NewNopSettings` with `NewNopSettingsWithType`. Part of #12305 but applied to all component kinds. #### Link to tracking issue Updates #12221
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> Creates `NewNopSettingsWithType` function on test modules and deprecates the `NewNopSettings` functions on those modules. Replace all usages of `NewNopSettings` with `NewNopSettingsWithType`. Part of open-telemetry#12305 but applied to all component kinds. #### Link to tracking issue Updates open-telemetry#12221
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Remove `NewNopSettings` introduced recently cc @mx-psi <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry/opentelemetry-collector#12305 <!--Describe what testing was performed and which tests were added.--> #### Testing n/a <!--Describe the documentation added.--> #### Documentation n/a <!--Please delete paragraphs that you did not use before submitting.-->
…NopSettingsWithType` (#12452) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add `component.Type` parameter to `NewNopSettings` And deprecate `NewNopSettingsWithType` cc @mx-psi <!-- Issue number if applicable --> #### Link to tracking issue Relevant to #12305 <!--Describe what testing was performed and which tests were added.--> #### Testing Updated <!--Describe the documentation added.--> #### Documentation Added <!--Please delete paragraphs that you did not use before submitting.-->
Description
Explicitly error out if the passed
component.ID
does not have a matchingcomponent.Type
Link to tracking issue
Updates #12221