Skip to main content

CiExecutor

Trait CiExecutor 

Source
pub trait CiExecutor {
    // Required methods
    fn info(&mut self) -> Result<ExecutorInfo, ExecutorError>;
    fn run(&mut self, jobs: &[Job]) -> Result<Vec<Verdict>, ExecutorError>;
}
Expand description

The CI executor seam (D18).

Implementations must pass crate::conform::conform, which the in-tree backends run from choir-queue/tests/it/executor.rs and a helper built elsewhere runs through choir-ci-conform. A seam with one implementation has never been tested against disagreement, which is how the trait this replaces stayed plausible while being unable to carry a real executor.

Required Methods§

Source

fn info(&mut self) -> Result<ExecutorInfo, ExecutorError>

Identity and protocol version. Called once before any job, so a mismatched provider is refused before it can return a verdict that means something else than it appears to.

§Errors

ExecutorError::Unavailable if the provider cannot be reached, ExecutorError::Protocol if it speaks a version we do not.

Source

fn run(&mut self, jobs: &[Job]) -> Result<Vec<Verdict>, ExecutorError>

Runs one train’s worth of jobs. The provider chooses its own concurrency.

The returned vector is index-aligned with jobs, so a provider that drops or reorders a job fails a length check rather than silently attributing one change’s result to another.

§Errors

ExecutorError when the call as a whole produced no verdicts. A per-job fault is Verdict::Errored, not an error here.

Implementors§