18 from enum
import IntEnum
24 List of possible TaskRun statuses during the TaskRun lifetime
30 completedWithSuccess = 4
31 completedWithError = 5
40 List of supported statuses:
41 - preparingToStart : TaskRun preparing to start
42 - completedWithSuccess : TaskRun is completed without errors
43 - completedWithError : TaskRun is completed with error
44 - stopped : TaskRun is stopped manually
45 - stopping : TaskRun is stopping
49 str -> Appropriate message based on TaskRun status
53 ValueError -> if unsupported status is provided
56 if self == TaskRunStatus.preparingToStart:
57 return "Preparing to start the Task Run."
59 if self == TaskRunStatus.completedWithSuccess:
60 return "Task Run completed successfully."
62 if self == TaskRunStatus.completedWithError:
63 return "Task Run failed due to an error. View console output for more details."
65 if self == TaskRunStatus.stopped:
66 return "User stopped the Task Run."
68 if self == TaskRunStatus.stopping:
69 return "Stopping the Task Run."
71 raise ValueError(f
">> [Coretex] {self.name} has no default message")
76 List of final statuses:
77 - TaskRunStatus.completedWithSuccess : TaskRun finished without error
78 - TaskRunStatus.completedWithError : TaskRun finished with an error
79 - TaskRunStatus.stopped : TaskRun is manually stopped
83 bool -> True if a status is a final status for a run
87 self == TaskRunStatus.completedWithSuccess
or
88 self == TaskRunStatus.completedWithError
or
89 self == TaskRunStatus.stopped