Skip to content

Conversation

@manusa
Copy link

@manusa manusa commented Dec 4, 2025

Refactors drop-in configuration loading to use deep merge strategy:

  • Add DefaultDropInConfigDir constant ("conf.d") for auto-discovery
  • Implement deepMerge() for recursive merging of nested config maps
  • Merge raw TOML maps before parsing to preserve extended configs (cluster_provider_configs, toolset_configs) across multiple drop-ins
  • Simplify Read() signature to (configPath, dropInConfigDir string)
  • Auto-resolve relative drop-in paths against config file directory

Add comprehensive test coverage:

  • Unit tests for deepMerge() function (flat, nested, type mismatch, arrays)
  • Tests for default conf.d auto-discovery and resolution
  • Tests for standalone --config-dir mode without main config
  • Tests for extended config merging across multiple drop-in files
  • SIGHUP signal handler integration tests verifying:
    • Config reload from file triggers tool updates
    • Drop-in directory changes are reloaded
    • Invalid config gracefully continues with old config
    • Config-dir only mode works with SIGHUP

…ests

Refactors drop-in configuration loading to use deep merge strategy:
- Add DefaultDropInConfigDir constant ("conf.d") for auto-discovery
- Implement deepMerge() for recursive merging of nested config maps
- Merge raw TOML maps before parsing to preserve extended configs
  (cluster_provider_configs, toolset_configs) across multiple drop-ins
- Simplify Read() signature to (configPath, dropInConfigDir string)
- Auto-resolve relative drop-in paths against config file directory

Add comprehensive test coverage:
- Unit tests for deepMerge() function (flat, nested, type mismatch, arrays)
- Tests for default conf.d auto-discovery and resolution
- Tests for standalone --config-dir mode without main config
- Tests for extended config merging across multiple drop-in files
- SIGHUP signal handler integration tests verifying:
  - Config reload from file triggers tool updates
  - Drop-in directory changes are reloaded
  - Invalid config gracefully continues with old config
  - Config-dir only mode works with SIGHUP

Signed-off-by: Marc Nuri <[email protected]>
@nader-ziada nader-ziada merged commit 8e4258a into nader-ziada:server-drop-in-config Dec 4, 2025
@manusa manusa deleted the review/server-drop-in-config branch December 4, 2025 16:13
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.

2 participants