Skip to content

Add ConfigFileStoreAdapter to bridge ConfigFile to ConfigAggregator#4858

Draft
tarek-y-ismail wants to merge 8 commits intoadd-config-aggregatorfrom
add-config-file-store-adapter
Draft

Add ConfigFileStoreAdapter to bridge ConfigFile to ConfigAggregator#4858
tarek-y-ismail wants to merge 8 commits intoadd-config-aggregatorfrom
add-config-file-store-adapter

Conversation

@tarek-y-ismail
Copy link
Copy Markdown
Contributor

Related: #4830

What's new?

  • Adds ConfigFileStoreAdapter, a class that bridges between ConfigFile and ConfigAggregator by managing creating/updating/removing sources.

How to test

  • TODO??

Checklist

  • Tests added and pass
  • Adequate documentation added
  • (optional) Added Screenshots or videos

@tarek-y-ismail tarek-y-ismail self-assigned this Apr 16, 2026
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-aggregator branch from 019c166 to 7563575 Compare April 16, 2026 15:19
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-file-store-adapter branch from d8d6e9e to 109697c Compare April 16, 2026 15:22
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.
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-file-store-adapter branch from 18f47be to 2801040 Compare April 16, 2026 15:47
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-aggregator branch from 7563575 to 9e50ae8 Compare April 16, 2026 15:53
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
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-file-store-adapter branch from 2801040 to 5c5a932 Compare April 21, 2026 16:31
@tarek-y-ismail tarek-y-ismail force-pushed the add-config-aggregator branch 5 times, most recently from 5f707f5 to 0093d49 Compare April 30, 2026 15:01
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.

1 participant