Skip to content

#171 - Fix config:dump-reference, validate the log levels when the container is compiled - #175

Merged
njoubert-cleverage merged 1 commit into
mainfrom
171
Oct 16, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
171

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #171.

  • CleverAgeUiProcessExtension::getConfiguration() returns the Configuration with the kernel environment (default log levels): the parent method returned null, so config:dump-reference clever_age_ui_process and debug:config clever_age_ui_process failed, and no PHP config builder (Symfony\Config\CleverAgeUiProcessConfig) was generated.
  • Configuration: the options are documented with info() instead of PHP comments (shown by config:dump-reference).
  • logs.database_level, logs.file_level and logs.report_increment_level are validated when the container is compiled: a level name (case-insensitive) or value for the first two (as Logger::toMonologLevel() of the handlers), a level name for report_increment_level (Level::fromName()). An invalid level made every process execution fail at runtime. The values are kept as is.
    The validation is done in load(), not in the configuration tree: the validation closures of the tree receive a dummy value ('', 0...) for environment variables, which would reject file_level: '%env(UI_FILE_LEVEL)%' (working today). Levels given by an environment variable are still checked at runtime, by Monolog.

Checked in process-bundle-demo (patch applied to the vendor):

  • config:dump-reference clever_age_ui_process dumps the reference with the descriptions; debug:config clever_age_ui_process logs.file_level → Debug; var/cache/dev/Symfony/Config/CleverAgeUiProcessConfig.php is generated;
  • file_level: Verbose → cache:clear fails with Invalid configuration for path "clever_age_ui_process.logs.file_level": invalid Monolog level "Verbose", use one of: DEBUG, ... (was: every cleverage:process:execute failed);
  • file_level: '%env(UI_FILE_LEVEL)%' with UI_FILE_LEVEL=notice: compiles, demo.transformer passes.

Tests with coverage (pcov): no risky test, no new uncovered line.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: only invalid levels are rejected, they made every process execution fail.

🤖 Generated with Claude Code

…ntainer is compiled

- CleverAgeUiProcessExtension::getConfiguration(): the configuration needs
  the kernel environment (default log levels), the parent method returned
  null: config:dump-reference and debug:config failed, no PHP config
  builder was generated.
- Configuration: the options are documented with info() instead of PHP
  comments.
- The database_level, file_level and report_increment_level options are
  validated in load() (level name or value as accepted by the Monolog
  handlers, level name for Level::fromName()): an invalid level failed
  every process execution at runtime. Not in the configuration tree, whose
  validation closures receive a dummy value for environment variables:
  levels given by an environment variable are still checked at runtime.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 85c69af into main Oct 16, 2026
25 checks passed
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.

Configuration: config:dump-reference fails, and the log levels are only validated at runtime

1 participant