Add ConfigFileStoreAdapter to bridge ConfigFile to ConfigAggregator#4858
Draft
tarek-y-ismail wants to merge 8 commits intoadd-config-aggregatorfrom
Draft
Add ConfigFileStoreAdapter to bridge ConfigFile to ConfigAggregator#4858tarek-y-ismail wants to merge 8 commits intoadd-config-aggregatorfrom
tarek-y-ismail wants to merge 8 commits intoadd-config-aggregatorfrom
Conversation
019c166 to
7563575
Compare
d8d6e9e to
109697c
Compare
ConfigAggregator merges configuration state across multiple files by combining a set of Sources (for format-specific parsing) with a BasicStore (for config value accumulation). Attribute registrations are forwarded to both: the parser accumulates raw string values into the aggregated store, and the store holds the user handlers and presets. load_all() clears prior state, loads each file in order through the parser, then dispatches all handlers once with the merged result and calls done handlers with the list of loaded paths.
18f47be to
2801040
Compare
7563575 to
9e50ae8
Compare
update_source was replacing the source entry with a fresh IniFile that had no registered attributes, causing reload_all() to log "Config key not recognised" warnings and deliver nullopt to handlers. Mirror what add_source already does: iterate foreach_scalar_attribute and foreach_array_attribute to register all known keys on the replacement store before swapping it in.
Tests cover: - empty span is a no-op - base config is loaded on first call - base config is updated on subsequent calls (uses update_source path) - single override takes precedence over base - later override takes precedence over earlier override - removed override falls back to base value - new override introduced on second call takes effect - retained override with updated stream delivers new value - override for one key does not clobber an unrelated key from base
2801040 to
5c5a932
Compare
5f707f5 to
0093d49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #4830
What's new?
ConfigFileStoreAdapter, a class that bridges betweenConfigFileandConfigAggregatorby managing creating/updating/removing sources.How to test
Checklist