Skip to main content

Module executor

Module executor 

Source
Expand description

The CI executor seam (D18): what runs a candidate merge, and what it is allowed to say about the result.

This replaces a fn verdict(&Change, &str) -> bool that could not carry a real executor. Three things the bool could not express, each of which changed a decision the queue makes:

  1. A provider fault is not a test failure. A VM that fails to boot and a test that legitimately fails both returned false, and the queue ejected the change either way — along with everything that transitively depended on it. Verdict::evicts is now the single place that rule lives, and only Verdict::Failed says yes.
  2. A batch is the unit, so a provider may be concurrent. The train’s cost model assumes every member’s CI runs in parallel; a one-job-at-a-time method with &mut self made that impossible to implement no matter what the model said.
  3. A job is content-addressed, so a shared build cache has something to key on. A queue-local change id does not survive being asked the same question twice.

§Examples

use choir_queue::executor::{CiExecutor, Job, Synthetic, Verdict};
use choir_hash::ContentHash;

let mut ci = Synthetic::passing();
let job = Job::new(ContentHash::blake3(b"tree"), vec!["true".into()]);
assert_eq!(ci.run(&[job]).unwrap(), vec![Verdict::Passed]);

Structs§

ExecutorInfo
Who a provider says it is, established once before any job.
Job
One unit of work, addressed by content so a shared cache can hit.
Synthetic
An executor that answers from a caller-supplied function instead of running anything.

Enums§

ExecutorError
Why an executor produced no verdicts at all.
Verdict
What an executor found. Four cases, because the queue’s response to each of them differs.

Constants§

DEFAULT_DEADLINE
Default wall-clock ceiling for one job.
PROTOCOL
Wire-protocol version a provider must echo before receiving work.

Traits§

CiExecutor
The CI executor seam (D18).