pub enum AttemptOutcome {
CompletedJob,
ExitedIdleWithoutWork,
Failed {
reason: FailureReason,
},
Orphaned,
}Expand description
What terminally happened to an attempt.
The state and the outcome are not two independent fields that a caller has to
keep consistent: AttemptOutcome::terminal_state derives the state from the
outcome, and RunnerAttempt::conclude is the only way to set either. A
failed attempt whose outcome says it ran a job is therefore not a bug this
code can have.
Variants§
CompletedJob
The runner accepted its one job and the job ended. This says the runner
finished, never that the workflow succeeded — GitHub remains the source of
truth for workflow outcome (03-control-flows.md, flow 2, Failure).
ExitedIdleWithoutWork
The surplus case. The runner registered, no job arrived, and it exited on its idle timeout (flow 2.7). Normal, bounded, and not a failure.
Failed
The attempt failed.
Fields
reason: FailureReasonOrphaned
Supervision was lost: the process is gone and the attempt could not be
reconciled with GitHub (e3, restart recovery).
Implementations§
Source§impl AttemptOutcome
impl AttemptOutcome
pub fn failed(reason: FailureReason) -> Self
Sourcepub const fn terminal_state(&self) -> AttemptState
pub const fn terminal_state(&self) -> AttemptState
The one terminal state this outcome corresponds to.
Sourcepub const fn is_failure(&self) -> bool
pub const fn is_failure(&self) -> bool
True for the outcomes an operator should be told to look at.
g2 renders this differently from Self::is_idle_exit, and e1’s
Definition of Done requires that a surplus attempt “is not reported as a
failure”.
Sourcepub const fn is_idle_exit(&self) -> bool
pub const fn is_idle_exit(&self) -> bool
True only for the surplus case.
Trait Implementations§
Source§impl Clone for AttemptOutcome
impl Clone for AttemptOutcome
Source§fn clone(&self) -> AttemptOutcome
fn clone(&self) -> AttemptOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more