Skip to content
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

[confmap] Add mapstructure hook function for unmarshalling confmap.Conf #6029

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

djaglowski
Copy link
Member

This also moves the Unmarshallable interface from config to confmap in order to avoid
an import cycle. This makes some sense anyways because the interface is concerned
specifically with unmarshalling a confmap.Conf. The config.Unmarshallable interface
is deprecated and changed to an alias of confmap.Unmarshallable.

Rehash of #4879

@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Base: 91.99% // Head: 92.01% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (de697ef) compared to base (35cf596).
Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6029      +/-   ##
==========================================
+ Coverage   91.99%   92.01%   +0.01%     
==========================================
  Files         213      213              
  Lines       13340    13333       -7     
==========================================
- Hits        12272    12268       -4     
+ Misses        850      846       -4     
- Partials      218      219       +1     
Impacted Files Coverage Δ
confmap/confmap.go 93.51% <80.00%> (+4.04%) ⬆️
pdata/plog/json.go 98.13% <0.00%> (-0.06%) ⬇️
pdata/internal/json/attribute.go 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@djaglowski djaglowski force-pushed the confmap-unmarshallable branch 2 times, most recently from fc7460e to 25a8413 Compare September 6, 2022 15:31
@djaglowski djaglowski marked this pull request as ready for review September 6, 2022 15:43
@djaglowski djaglowski requested a review from a team as a code owner September 6, 2022 15:43
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Let's start with a small PR to deprecate/move current interface and then the other PR.

config/common.go Outdated Show resolved Hide resolved
This allows structs to implement custom unmarshaling behaviors when
being unmarshaled from confmap.Conf.
confmap/confmap.go Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
confmap/confmap_test.go Outdated Show resolved Hide resolved
@djaglowski
Copy link
Member Author

Contrib tests should pass once open-telemetry/opentelemetry-collector-contrib#14011 (review) is merged

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.

None yet

2 participants