#222 - Deprecate going on with a process after a task initialization failure - #226
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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:
E_USER_DEPRECATEDerror 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.The new regression tests fail on
mainand pass with this fix. PHPUnit, PHPStan, PHP-CS-Fixer and Rector pass.Requirements
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