-
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
[confmap] - new feature flag for append merging strategy #12097
base: main
Are you sure you want to change the base?
[confmap] - new feature flag for append merging strategy #12097
Conversation
3ac6d58
to
9059b29
Compare
@Aneurysm9 @evan-bradley @mx-psi can you take another look? i've removed feature flag and added command line argument to control the paths user wants merged. I'll work on the documentation once we've established a common ground. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12097 +/- ##
==========================================
+ Coverage 92.00% 92.01% +0.01%
==========================================
Files 469 470 +1
Lines 25355 25409 +54
==========================================
+ Hits 23327 23381 +54
Misses 1619 1619
Partials 409 409 ☔ View full report in Codecov by Sentry. |
7b5fe09
to
5685baa
Compare
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.
Thanks for taking this Vihas! I have two comments:
- I think this is the kind of thing that is hard to get right on the first try, so I would want to do this under some sort of experimental flag.
- I would like to do this if possible with little to no modification of stable confmap APIs. confmap is 1.0, it is a very important piece of the Collector, and if we get it wrong it would be quite difficult to reverse course.
@mx-psi Thanks for your comments!
|
0f66985
to
95913fd
Compare
My concern is not only about the ordering but about controlling that it's applied to configuration parts where it's expected. For example: I want to define a component in another config file and add it to a "standard" pipeline defined in a "base" config, but the "base" config may already have it as well (I don't have control over it). In the case of a conflict, I'd like to be able to choose whether to override the original component's config or keep it as is. Overriding maps is currently impossible, given that we have parts with meaningful @VihasMakwana @mx-psi I'm ok with this as an initial version. I'm just afraid that it'll be stuck in this state for a long time, and users will be relying on the behavior of this feature gate going forward. Can we have another issue where we track the progress? @VihasMakwana, will you be able to keep working on this until it's stabilized? |
yes. This is one of my top priorities and I'll open up an follow up issue to track progress. |
ed0ee33
to
68a63c0
Compare
68a63c0
to
8cc3fe4
Compare
6769f33
to
e2aef3f
Compare
@mx-psi @evan-bradley @dmitryax I think we can go forward this PR as an initial version. I have reverted the command line for now. I'll open up an RFC as a follow-up and discuss how to address concerns related to ordering and controlling of specific parts of configuration. |
e2aef3f
to
a6c03ad
Compare
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.
LGTM
Please update the nolint comment to fix CI |
A few of test cases are failing but they seem unrelated to my PR. |
Koanf's default merging strategy currently overrides static values such as slices, numbers, and strings. However, lists of components should be treated as a special case. This pull request introduces a new command line option to allow for merging lists instead of discarding the existing ones.
With this new merging strategy:
Link to tracking issue
Related issues:
Testing
Documentation
Example
Consider the following configs,
If you run the collector with following command,
then the final configuration after config resolution will look like following:
For backward compatibly, the default behaviour is not to merge lists. Users who want to explicitly merge lists can enable the command line option.
Note: I’d appreciate your feedback on this 🙏