Mark stage as failed
You can mark a specific stage as failed during pipeline execution by selecting the Mark Stage As Failed
option.
This lets you do the following:
- Abort a step that is running.
- Trigger configured failure strategy after the step is aborted.
Important
- You must have
Execute
pipeline permission to be able to mark as stage as failed. - You must enable
Allow users to mark a running Step as failure
in the default settings. For more information, go to Default settings. - The option
Mark Stage As Failed
is at a stage level in the execution phase. During the execution of parallel stages (like a matrix), you must either mark each one as a failure or let the other steps complete before applying the failure strategy. - Harness aborts any delegate task currently running after you mark a stage as failed.
Mark a stage as failed
To mark a stage as failed during pipeline execution:
Select your pipeline, and then select Run.
Enter runtime input, if any, and then select Run Pipeline.
Select Mark Stage As Failed.
Select Confirm.
The Error Summary for the stage displays
User Initiated Failure
. The failure type of this stage is set toUSER_MARKED_FAILURE
.
Configure failure strategy
To configure failure strategy for a stage marked as failure:
Select your pipeline, and then select the stage for which you want to configure failure strategy.
Select Advanced.
In Failure Strategy, select Add.
Select User Marked Failure in On failure of type.
Select desired action in Perform Action, for example, Rollback or Retry. The action you select here gets triggered after you mark a stage as failed.
Select Save.
If you mark a stage as failed, and its failure strategy is not defined, Harness triggers the default failure strategy.