Skip to content

#305 - Bundle best practices: residues of the review - #306

Merged
njoubert-cleverage merged 1 commit into
mainfrom
305
Oct 20, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
305

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #305: residues of the bundle best practices work (#149, #273, #275, #279).

Generic transformers

  • CleverAgeProcessExtension: no more setAutowired(true) on the GenericTransformer definitions, their arguments are explicit.

ProcessHelpCommand

  • The service receives @cleverage_process.registry.task instead of @service_container.
  • Constructor: (ProcessConfigurationRegistry, TaskRegistry|ContainerInterface). Passing a container, as in v5.3, still works and triggers a deprecation (5.4); the $container property is only set in that case and is @deprecated. The third argument ?TaskRegistry, added after v5.3 and never released, is removed.

Application tasks public through the autoconfiguration

  • New internal PublicTaskDeprecationCompilerPass (before ResolveInstanceofConditionalsPass): an autoconfigured service implementing TaskInterface, made public only by the autoconfiguration of the bundle, gets the container.private tag (cleverage/process-bundle 5.4), like the tasks of the bundle. Fetching it directly from the container is deprecated, it will be private in v6.0 (v6.0: remove the deprecated code #292).
  • Not concerned, because they stay public in v6.0: tasks made public by the application itself (public: true on the service or in _defaults, _instanceof rule, #[Autoconfigure(public: true)]).

Deprecation notices

  • InputAggregatorTask: trigger_deprecation() in a new constructor, @deprecated since 5.4. The good practices page no longer suggests it.
  • CheckSerializerCompilerPass: trigger_deprecation() in a new constructor (same as RegistryCompilerPass), @deprecated since 5.4.
  • errors task configuration key: setDeprecated() in the configuration tree (same as service).
  • TaskConfiguration::getErrors(): @deprecated PHPDoc instead of the native #[\Deprecated] attribute, so a single notice on PHP 8.4+; $logErrors marked @deprecated (unused).

@final: CleverAgeProcessBundle is @final since 5.4.

Tests: new CheckSerializerCompilerPassTest and PublicTaskDeprecationCompilerPassTest (with the passes of the container compilation, AliasDeprecatedPublicServicesPass included), deprecation tests for InputAggregatorTask, errors and the help command; KernelTest ignores the expected InputAggregatorTask deprecation.

Checked in the container (972 tests): highest dependencies (PHP 8.5, Symfony 8.1), lowest dependencies (PHP 8.2, Symfony 6.4.0), Symfony 6.4.48 on PHP 8.2 and 8.5, Symfony 7.4: no deprecation, no risky test (with pcov coverage). PHPStan, PHP-CS-Fixer and Rector OK. cleverage:process:help run from the test kernel: works, no deprecation.

#292 (v6.0 removals) is updated with these deprecations.

Requirements

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

Breaking changes

None. New deprecation notices (5.4): ProcessHelpCommand built with a container, InputAggregatorTask, CheckSerializerCompilerPass, errors key, direct access from the container to the application tasks made public only by the autoconfiguration.

🤖 Generated with Claude Code

- The generic transformers are no longer autowired (explicit arguments).
- ProcessHelpCommand receives the TaskRegistry as second argument instead of
  the service container; passing a container (constructor of v5.3) is
  deprecated. The unreleased third argument is removed.
- New internal PublicTaskDeprecationCompilerPass: the tasks of the
  application made public only by the TaskInterface autoconfiguration get the
  container.private tag (fetching them from the container is deprecated, as
  for the tasks of the bundle). Tasks made public by the application itself
  (service, _defaults, _instanceof, #[Autoconfigure]) are not concerned.
- Missing deprecation notices: InputAggregatorTask, CheckSerializerCompilerPass,
  "errors" task configuration key (setDeprecated(), use "error_outputs").
- TaskConfiguration::getErrors(): @deprecated PHPDoc instead of the native
  #[\Deprecated] attribute (a single notice on PHP 8.4+); $logErrors marked
  @deprecated.
- CleverAgeProcessBundle marked @Final since 5.4.
- Documentation and CHANGELOG updated, tests added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit a32602b into main Oct 20, 2026
18 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.

Bundle best practices: residues (generic transformers autowiring, help command container, deprecation notices)

1 participant