Skip to content

[FEATURE] Implement hierarchical configuration system with enhanced error handling#2

Draft
dwenzel wants to merge 1 commit intodevelopfrom
feature/015-configuration-overwrites
Draft

[FEATURE] Implement hierarchical configuration system with enhanced error handling#2
dwenzel wants to merge 1 commit intodevelopfrom
feature/015-configuration-overwrites

Conversation

@dwenzel
Copy link
Member

@dwenzel dwenzel commented Jan 11, 2026

Summary

  • Implement hierarchical configuration system with precedence levels for flexible project configuration
  • Add ConfigurationDiscovery for automatic file detection across project hierarchies
  • Implement ConfigurationMerger for intelligent array/object merging with type preservation
  • Replace error_log with proper console error reporting architecture
  • Fix dependency injection issues affecting configuration commands
  • Remove obsolete config/quality-tools.yaml (replaced by built-in defaults)

Changes

  • New Configuration System: HierarchicalConfigurationLoader with discovery and merging
  • Enhanced Error Handling: Proper console error reporting instead of error_log
  • Dependency Injection Fixes: Exclude classes requiring runtime parameters from autowiring
  • Array Merging: Fix indexing preservation during configuration merge operations
  • Documentation: Complete configuration reference with precedence hierarchy
  • Architecture: Improved separation between production and test error handling

Test Results

All 706 tests pass with clean output - no error log clutter in PHPUnit CLI

Closes

Closes #1

🤖 Generated with Claude Code

…rror handling

- Add hierarchical configuration system with precedence levels
- Implement ConfigurationDiscovery for automatic file detection
- Add ConfigurationMerger for intelligent array/object merging
- Replace error_log with proper console error reporting
- Fix dependency injection issues for configuration commands
- Remove obsolete config/quality-tools.yaml (replaced by defaults)
- Update documentation with complete configuration reference
- All 706 tests pass with improved error handling architecture

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@dwenzel dwenzel added the enhancement New feature or request label Jan 11, 2026
@dwenzel dwenzel linked an issue Jan 11, 2026 that may be closed by this pull request
20 tasks
@dwenzel dwenzel marked this pull request as draft January 11, 2026 11:45
@vladimirfalconpiva
Copy link

vladimirfalconpiva commented Feb 19, 2026

@dwenzel

File Configuration override did not work for me in ZUG System

zug-bundle-13 git:(feature/rector-AsEventListener-Attribute)

Test:

  • Tested with a rector.php file in project root
  • Tested with a rector.php file in config folder

Executed ddev composer lint:rector Local file configuration in both location is ignored.

ddev exec ./app/vendor/bin/qt config:show

Trows:

vfalcon@zug-13-web:/var/www/html$ ./app/vendor/bin/qt config:show

                                                                                                                        
 [ERROR] Failed to load configuration:                                                                                  
                                                                                                                        
         Configuration file error [merged]: Invalid merged configuration:                                               
         : The property tool_config_file is not defined and the definition does not allow additional properties         
         : The property custom_config is not defined and the definition does not allow additional properties 

@dwenzel
Copy link
Member Author

dwenzel commented Feb 21, 2026

@vladimirfalconpiva Thank you for testing and reporting this issue!

Your observation is absolutely correct. The configuration file override functionality is broken due to a schema validation conflict. The system discovers custom tool configs (like rector.php) but adds runtime metadata keys (tool_config_file, custom_config) that aren't defined in our JSON schema, causing validation failures.

Where we'll fix it: We've documented this as Issue 022 and plan to resolve it through a config_file key approach in the user YAML schema, eliminating the schema validation conflicts while providing explicit user control.

Why as a side quest: Since this issue affects the configuration system we're refactoring in 019, we decided to address it properly rather than applying a quick fix that might conflict with the new architecture. This ensures a clean, maintainable solution.

The fix will take some time to implement properly with comprehensive testing. Work is tracked in the issue-022-configuration-file-replacement-fix branch. Thanks for helping us catch this early in the refactoring process!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration Overwrites - Feature 015

2 participants