Access reason
from the execution status of a taskRun
in finally
#8110
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
Feature request
A
finally
task can access both thereason
andstatus
of apipelineTask
from thetasks
section.Use case
When these tests are executed as part of a task called
checks
, compliance checks must pass inprod
but can be ignored indev
mode. While the finally task can access the status of thechecks
, it cannot distinguish between modes or decide whether to report a failure.Running
checks
withonError
set tocontinue
indev
mode can report success. In this context, success means informing the developer about the failed checks but not preventing the code from being merged into thedev
branch.Running
checks
withonError
set tostopAndFail
inprod
mode must report failure. This means notifying both the developer and the release manager about the failed checks and preventing the code from being merged into theprod
branch.When
onError
is set to eithercontinue
orstopAndFail
and the task fails, the status remainsFailed
, making it indistinguishable whether the failure was allowed or not. However, whenonError
is set tocontinue
, the reason is assignedFailureIgnored
. This additional information can be used to identify that the checks failed, but the failure can be ignored.When designing the
onError
feature at the step level, the step exit code is made available to subsequent steps. Similarly, we are seeking a method to classify a task that failed but hadFailureIgnored
.A sample finally task:
Logs from this
finally
task:References:
onerror
Tasks to beta #8090 (comment)/kind feature
The text was updated successfully, but these errors were encountered: