-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[config] Deprecate component.UnmarshalConfig #9750
[config] Deprecate component.UnmarshalConfig #9750
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9750 +/- ##
==========================================
+ Coverage 91.98% 92.48% +0.50%
==========================================
Files 361 387 +26
Lines 16965 18244 +1279
==========================================
+ Hits 15605 16873 +1268
- Misses 1020 1025 +5
- Partials 340 346 +6 ☔ View full report in Codecov by Sentry. |
0c0a748
to
311078f
Compare
Contrib tests fix: open-telemetry/opentelemetry-collector-contrib#31727 |
311078f
to
07fa33d
Compare
ccbf4cc
to
f8f4fe6
Compare
This is a split of #9750 that tries to work around mapstructure, which wraps an error around a decoding error. In the case when an error is returned from a top level construct, we get a not so helpful message that says: ``` error decoding '': error running encode hook: marshaling error ``` With this change, the error is unwrapped, giving the following string representation: ``` error running encode hook: marshaling error ``` Because #9750 enforces going through mapstructure, it would change errors returned with this not-so-helpful preamble. Adding this removes the problem.
This change is required in preparation of #9750 This removes the call to `component.UnmarshalConfig` in preparation of its deprecation, and instead has the `Conf` object unmarshal itself into the `Config` struct.
51e5f78
to
dfa57f1
Compare
Can you add 'Fixes #7101' to the PR description? |
**Description:** This is a companion PR to handle recursive state of unmarshalers with open-telemetry/opentelemetry-collector#9750. Changing this behavior will allow the confmap.Conf object to recognize that it has already run the `Unmarshal` method on the struct, and run the mapstructure decoding of fields.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
4445cc4
to
05a0d08
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
05a0d08
to
2d0837a
Compare
2d0837a
to
1757e25
Compare
bd90692
to
8e1360c
Compare
8e1360c
to
616b7ec
Compare
…shalers. (open-telemetry#9862) This is a slice of open-telemetry#9750 focusing on removing the top level condition on unmarshaling structs. --------- Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
…shalers. (open-telemetry#9862) This is a slice of open-telemetry#9750 focusing on removing the top level condition on unmarshaling structs. --------- Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
**Description:** This PR removes the top level if/else in `component.UnmarshalConfig`, handling recursive state in the confmap.Conf object instead. This PR deprecates `component.UnmarshalConfig` in favor of calling directly `Unmarshal` on the confmap.Conf object. **Link to tracking Issue:** Fixes open-telemetry#7102 Fixes open-telemetry#7101 --------- Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Description:
This PR removes the top level if/else in
component.UnmarshalConfig
, handling recursive state in the confmap.Conf object instead.This PR deprecates
component.UnmarshalConfig
in favor of calling directlyUnmarshal
on the confmap.Conf object.Link to tracking Issue:
Fixes #7102
Fixes #7101