pub struct ImpliedObligation {
pub id: String,
pub title: String,
pub applicable: bool,
pub declared: bool,
pub reason: String,
pub because: Vec<String>,
pub remediation: String,
}Expand description
use majordomus_cli::gates::ImpliedObligation;
let owed = ImpliedObligation {
id: "tests".into(),
title: "The cases the change obliges were run".into(),
applicable: true,
declared: false,
reason: "lib/check.sh is an input of this obligation".into(),
because: vec!["lib/check.sh".into()],
remediation: "majordomus start --requires tests".into(),
};
// applicable and undeclared is the gap nothing else reports: the change owes it and
// the task promised nothing, so no validator holds anybody to it
assert!(owed.applicable && !owed.declared);One obligation the change set implies, and whether the task promised it.
Applicability is derived and nothing else: a token’s own inputs in
share/obligations.yaml name the files it is about, so a change to one of them is what
makes the token owed. A token with no inputs names a fact outside the tree — a push, a
publication, a deployment — which no change to a tree can imply, so those are owed when
the task declares them and reported as not applicable when it does not.
Fields§
§id: StringThe token.
title: StringThe obligation as a heading, from the vocabulary.
applicable: boolTrue when the change set, or the task’s own declaration, makes it owed.
declared: boolTrue when the task’s requires names it, so finish already holds the task to it.
reason: StringWhy it applies, or why it does not.
because: Vec<String>The changed paths that implied it, when paths did.
remediation: StringWhat would discharge it.
Trait Implementations§
Source§impl Clone for ImpliedObligation
impl Clone for ImpliedObligation
Source§fn clone(&self) -> ImpliedObligation
fn clone(&self) -> ImpliedObligation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImpliedObligation
impl Debug for ImpliedObligation
Source§impl<'de> Deserialize<'de> for ImpliedObligation
impl<'de> Deserialize<'de> for ImpliedObligation
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 ImpliedObligation
impl JsonSchema for ImpliedObligation
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