This task is also to do a first pass of the possible most basic states and use those for starters, this would be different for the three different types of jobs:
ContinuousJob
- Pending: from creation until the deployment is healthy
- Running: while the deployment is healthy
- Failing: if there's any errors/has not started for too long/fails to start
- RuntimeError (happy to get other name proposals, InternalError, Inconsistent, Malformed, ...): when the job is missing something on k8s side though it might be running ok (ex. there's the deployment but not the service, or the deployment is missing fields, etc.)
- Unknown: any other (details in status_long)
ScheduledJob
This one is a bit special, we can do something like:
- LastRunFailed
- Question, do we want to add a LastRunTimedOut?
- LastRunPassed
- WaitingFirstRun
- Failing: this one is in case it's not able to run for whichever reason, maybe collapse with LastRunFailed
- Unknown: any other state
OneOffJob
This would be similar to the continuous job:
- Pending: until the container starts
- Running: from the container start to the end
- Success: if it completed ok
- Failed: if it failed
- Unknown: any other state (details in status_long)
This will allow for using those states in any other parts of the code (ex. cli, web ui, external users like T401069: [jobs-api] report status pending until the first container is running, ...)