pub struct GateDecl {
pub id: String,
pub job: String,
pub runs: String,
pub summary: String,
pub always: bool,
pub on_demand: bool,
pub at_finish: bool,
pub implies: Vec<String>,
pub requires: Vec<String>,
}Expand description
use majordomus_cli::gates::GateDecl;
// one gate as `.ai/repo/ci/gates.yaml` declares it
let decl: GateDecl = serde_json::from_value(serde_json::json!({
"id": "shell-lint",
"job": "structure",
"runs": "shellcheck lib/*.sh",
"summary": "every script parses",
"always": true
}))
.unwrap();
assert_eq!(decl.id, "shell-lint");
// `always` is what makes every plan select it, so any change can invalidate its evidence
assert!(decl.always);
assert!(!decl.on_demand);One gate of the model, as the file declares it.
Fields§
§id: StringThe gate’s identity, unique in the model.
job: StringThe CI job that runs it.
runs: StringThe command it runs.
summary: StringOne line saying what it proves.
always: boolTrue when every plan selects it, whatever changed.
on_demand: boolTrue when only a plan that asks for it selects it: its runner cannot be had on demand, so planning it on every push is planning a verdict that never arrives.
at_finish: boolTrue when the gate measures the deployment rather than the tree, so no change to
any file can select it and the path classes can never reach it. finish asks it
instead: the question “is what the public is being served still a projection of
the trunk” has no answer a commit can give, and its moment is when a session
claims to be done.
implies: Vec<String>Gates that are selected whenever this one is.
requires: Vec<String>Gates this one cannot run without.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GateDecl
impl<'de> Deserialize<'de> for GateDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for GateDecl
impl JsonSchema for GateDecl
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more