Support dynamic settings sections - #1
Closed
teal-bauer wants to merge 3 commits into
Closed
Conversation
teal-bauer
force-pushed
the
dynamic-settings-sections
branch
from
March 9, 2026 08:47
8fc973e to
609fa3c
Compare
Remove hardcoded section prefixes and allow any dotted-notation keys in the settings hash. All keys with format "section.key" are automatically parsed and organized into TOML sections. Keys without dots are silently ignored to maintain backward compatibility and ensure proper structure.
Add comprehensive tests for ParseRedisSettings and ToRedisFields: - Standard and custom section parsing - Ignoring keys without dots - Handling keys with multiple dots - Round-trip conversion validation
teal-bauer
force-pushed
the
dynamic-settings-sections
branch
from
March 12, 2026 11:13
609fa3c to
1a6068d
Compare
Keys without a dot are stored as top-level TOML entries rather than silently dropped. TOML loading splits by value type (map vs scalar) to distinguish sections from top-level fields. Service layer warns on unknown sections and top-level keys in both directions (TOML→Redis and Redis→TOML).
Member
Author
|
Empty sections ( |
Member
Author
|
Superseded by #4, which drops the |
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.
Summary
Adding
engine-ecuto the service meant touchingConfig,ParseRedisSettings, andToRedisFields— all for a struct field and aHasPrefixcheck. Anysection.keykey already carries its section name; there's no reason to maintain an allowlist.Configfields withmap[string]map[string]interface{}ParseRedisSettingssplits on first dot, creates sections dynamicallyToRedisFieldsiterates all sections genericallyExisting settings (
scooter.*,cellular.*, etc.) work as before. New sections don't require code changes. Includes unit tests for standard sections, arbitrary names, dotless keys, and round-trips.