Skip to content

#222 - Deprecate going on with a process after a task initialization failure - #226

Merged
njoubert-cleverage merged 1 commit into
mainfrom
222
Sep 28, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
222

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #222.

An exception thrown by initialize() (for instance an invalid option of a configurable task) is logged as critical and flags the task as stopped, but it does not abort the process:

  • the tasks upstream of the misconfigured task are executed (with their side effects: files written, database updates, API calls...), then the process fails when the misconfigured task is first reached;
  • if the misconfigured task is never reached (filtered branch...), the process ends with "executed successfully", in spite of the critical log. If the task is flushable, it fails anyway during the flush: the result depends on the task type.

Initialization errors are configuration errors, they do not depend on the data: the process should fail before executing any task.

Failing at initialization changes the behaviour of existing processes, so it is done in two steps. This PR implements the v5 step:

  • v5 (this issue): keep the current behaviour, and trigger an E_USER_DEPRECATED error for each initialization failure: The initialization of the task "<task>" of the process "<process>" has failed with message "<message>". Going on with the process after an initialization failure is deprecated since v5: in v6.0, the process will fail before executing any task. Document the deprecation (02-task_types.md, 03-custom_tasks.md, 04-advanced_workflow.md), add tests.
  • v6.0: rethrow the initialization exception (wrapped with the task and process codes), before any task is executed.

The new regression tests fail on main and pass with this fix. PHPUnit, PHPStan, PHP-CS-Fixer and Rector pass.

Requirements

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

Breaking changes

None in v5 (deprecation only). In v6.0, a process with a misconfigured task will fail before executing any task, even if this task is never reached.

🤖 Generated with Claude Code

… exception thrown by a task `initialize()` is deprecated (an `E_USER_DEPRECATED` error is triggered). In v6.0, the process will fail before executing any task.

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

An exception thrown by initialize() does not abort the process: upstream tasks run, or the process succeeds

1 participant