Skip to content

#307 - InputAggregatorTask: drop the items skipped by a branch, remove the deprecation - #308

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

njoubert-cleverage merged 1 commit into
mainfrom
307

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #307. Reproduction: demo processes demo.blocking.* and demo.input_aggregator.* (cleverage/process-bundle-demo#88).

The fix

  • ProcessState: new getExecutionCount() (number of executions of the task: execute, proceed or flush, not reset between the items) and @internal incrementExecutionCount(), called by ProcessManager::processExecution() before each execution.
  • InputAggregatorTask records, for each received input, the execution count of its ancestors (getPreviousState() chain). When an input arrives, the inputs received from the other branches are dropped if a common ancestor has been executed again since: they belong to a previous item that a branch skipped. Unchanged:
    • the inputs of keep_inputs are never dropped;
    • an input received twice from the same branch keeps the clean_input_on_override behaviour;
    • inputs without a common ancestor are always joined.

demo.input_aggregator.skipped_branch (branch_a skips the item 2, branch_b the item 4):

Outputs
Before {"a":"a1","b":"b1"}, {"b":"b2","a":"a3"}, {"b":"b3","a":"a4"}, {"a":"a5","b":"b5"}
After {"a":"a1","b":"b1"}, {"a":"a3","b":"b3"}, {"a":"a5","b":"b5"}

Deprecation removed

Tests

  • InputAggregatorTaskTest: deprecation test removed; new tests with a common ancestor: item skipped by the first branch, by the last branch, keep_inputs, no common ancestor.
  • KernelTest::testInputAggregatorDropsTheItemsSkippedByABranch(): the processes run by the ProcessManager (filter in both branches, error with error_strategy: skip). Both fail without the fix (checked).

Checked in the container (977 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. Demo processes run with this branch: demo.input_aggregator.skipped_branch gives the expected output, the 4 others are unchanged.

Requirements

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

Breaking changes

None. The deprecation removed was never released. Only the outputs that were wrong change: the inputs of an item skipped by a branch are dropped instead of being joined with the next item.

🤖 Generated with Claude Code

…e the deprecation

- InputAggregatorTask no longer joins the inputs of two items when a branch
  skips one (filter, error with the skip strategy): the inputs received from
  the other branches are dropped when a common ancestor has been executed
  again since they were received (keep_inputs excepted). Inputs without a
  common ancestor are still joined.
- New ProcessState::getExecutionCount(), incremented by the ProcessManager
  before each execution of a task (execute, proceed, flush).
- Remove the deprecation of InputAggregatorTask (2018, notice added by #305,
  not released): the limits of the blocking tasks it referred to no longer
  exist, and a blocking task is not a replacement. Marked @Final since 5.4
  like the other concrete tasks.
- Tests: unit tests of the task (first / last branch skipping, keep_inputs,
  no common ancestor), functional tests running the processes (filter and
  error with the skip strategy). Documentation and CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 9505b63 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.

InputAggregatorTask: remove the deprecation, fix the items mixed when a branch skips one

1 participant