|
3 | 3 | from typing import Any |
4 | 4 |
|
5 | 5 | import arrow |
6 | | -from models_library.projects_state import RunningState |
| 6 | +from models_library.projects_state import RUNNING_STATE_COMPLETED_STATES, RunningState |
7 | 7 | from models_library.services import ServiceKeyVersion |
8 | 8 | from models_library.services_regex import SERVICE_KEY_RE |
9 | 9 | from models_library.users import UserID |
|
15 | 15 |
|
16 | 16 | _logger = logging.getLogger(__name__) |
17 | 17 |
|
18 | | -_COMPLETED_STATES = (RunningState.ABORTED, RunningState.FAILED, RunningState.SUCCESS) |
| 18 | + |
19 | 19 | _RUNNING_STATES = (RunningState.STARTED,) |
20 | 20 | _TASK_TO_PIPELINE_CONVERSIONS = { |
21 | 21 | # tasks are initially in NOT_STARTED state, then they transition to published |
|
50 | 50 | RunningState.NOT_STARTED, |
51 | 51 | ): RunningState.NOT_STARTED, |
52 | 52 | # if there are only completed states with FAILED --> FAILED |
53 | | - (*_COMPLETED_STATES,): RunningState.FAILED, |
| 53 | + (*RUNNING_STATE_COMPLETED_STATES,): RunningState.FAILED, |
54 | 54 | # if there are only completed states with FAILED and not started ones --> NOT_STARTED |
55 | 55 | ( |
56 | | - *_COMPLETED_STATES, |
| 56 | + *RUNNING_STATE_COMPLETED_STATES, |
57 | 57 | RunningState.NOT_STARTED, |
58 | 58 | ): RunningState.NOT_STARTED, |
59 | 59 | # the generic case where we have a combination of completed states, running states, |
60 | 60 | # or published/pending tasks, not_started is a started pipeline |
61 | 61 | ( |
62 | | - *_COMPLETED_STATES, |
| 62 | + *RUNNING_STATE_COMPLETED_STATES, |
63 | 63 | *_RUNNING_STATES, |
64 | 64 | RunningState.PUBLISHED, |
65 | 65 | RunningState.PENDING, |
|
0 commit comments