Skip to content

feat/config provider refactoring candidate#13

Merged
ralflang merged 5 commits intoFRAMEWORK_6_0from
feat/config-provider-refactoring-candidate
Mar 2, 2026
Merged

feat/config provider refactoring candidate#13
ralflang merged 5 commits intoFRAMEWORK_6_0from
feat/config-provider-refactoring-candidate

Conversation

@ralflang
Copy link
Member

@ralflang ralflang commented Mar 2, 2026

Major refactor with breaking changes - Move from the old Configs framework to the new ConfigProvider framework.

ralflang added 5 commits March 2, 2026 10:50
Introduce a new ConfigProvider system to replace the legacy Config/Configs
architecture with a modern, layered configuration approach.

New ConfigProvider System:
- CliConfigProvider: CLI arguments with kebab-case → dot notation
- EnvironmentConfigProvider: Environment variables
- PhpConfigFileProvider: PHP config files (~/.config/horde/components.php)
- BuiltinConfigProvider: Default fallback values
- ConfigProviderFactory: Builds provider chains with proper precedence
- EffectiveConfigProvider: Hierarchical access (CLI > Env > User > Legacy > Builtin)

Features:
- Clear precedence order with layer introspection
- Dot notation for config keys (e.g., github.token, author.name)
- Type-safe with proper defaults
- Supports merging config from multiple sources

This is the foundation for removing the legacy Config system.

Part of config system modernization.
BREAKING CHANGE: Module::handle() signature changed

Changed Module interface from:
  handle(Config $config): bool
To:
  handle(array $options, array $arguments, ?Component $component): bool

Updated all 22+ modules to use new signature:
- Modules receive options/arguments/component directly as parameters
- Get ConfigProvider via DI when needed (ConfigProviderFactory)
- No Config wrapper object needed

Updated Components.php:
- Parse CLI options/arguments once
- Identify component once
- Pass directly to module->handle()
- Removed _prepareConfig() and _prepareConfigAdapter()

This decouples the Module system from the legacy Config architecture
and enables the next step: removing Config/Configs entirely.

Breaks compatibility: Any external modules implementing Module interface
must update their handle() signature.
BREAKING CHANGE: Removed Config/Configs classes

Deleted legacy Config system:
- src/Config/Base.php, Bootstrap.php, CliConfig.php, File.php
- src/Configs.php (multi-config container)

Added minimal Config interface for Component compatibility:
- src/Config.php: Minimal interface (35 lines)
- src/Config/MinimalConfig.php: Runtime implementation (85 lines)

Updated all 21 runners to remove Config dependency:
- Website, Init, Git, Github, Qc, Release, Pullrequest
- Change, Composer, ConventionalCommit
- CiSetup, CiPrebuild, Dependencies, Snapshot, Status
- Update, Fetchdocs, Webdocs, Installer, Pipeline, Distribute

Runners now use constructor injection with explicit parameters
instead of Config wrapper. Component classes still use minimal
Config interface for backward compatibility within Component hierarchy.

Net deletion: 1,557 lines removed from legacy system.
Fix multiple broken commands: release (missing GithubApiConfig), PR commands (undefined config property), status (not instantiating runner), package (print_r type), changed (wrong doc directory), git (missing path separators and return statement).
Display clear usage instructions with examples when changed command is invoked without a changelog message.
@ralflang ralflang merged commit 9d0eb79 into FRAMEWORK_6_0 Mar 2, 2026
1 check failed
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