pub struct HostState {
pub version: u32,
pub authenticated_user: String,
pub changes: Vec<ChangeRequest>,
pub heads: BTreeMap<ChangeId, String>,
pub titles: BTreeMap<ChangeId, String>,
pub checks: BTreeMap<ChangeId, Vec<Check>>,
pub check_logs: BTreeMap<ChangeId, BTreeMap<String, String>>,
pub check_sources: Option<BTreeSet<CheckSource>>,
pub merges: BTreeMap<ChangeId, MergeOutcome>,
}Expand description
Everything the remote-host side of a run knows about itself.
Omitted-when-empty and versioned for the same reasons VcsState is.
Fields§
§version: u32The schema version this state was written at. A document that names none is the one this build writes.
authenticated_user: StringWho the host says is calling. Empty is refused, exactly as a gh that
reports no authenticated user is.
changes: Vec<ChangeRequest>Every change request that has been opened or seeded.
heads: BTreeMap<ChangeId, String>The head branch each change request was opened from.
Beyond the sketch, and unavoidable: ChangeRequest records only the base
it targets, and find_changes matches on the head as well.
titles: BTreeMap<ChangeId, String>The title each change request was opened under.
Beyond the sketch, and for the same reason heads is:
ChangeRequest records neither, and the title is what a publication’s
commit subject becomes — so a journey asserting that the subject it asked
for is the one the host was given has nowhere else to read it.
checks: BTreeMap<ChangeId, Vec<Check>>The checks the host reports on each change request. A change with no entry has no checks, which is what a repository with no CI reports.
check_logs: BTreeMap<ChangeId, BTreeMap<String, String>>The log the host hands over for a check, keyed by change request and then by
check name. Beyond the sketch: check_log is one of the six methods, and
without this the only log a journey could asssert on is a synthesized one.
check_sources: Option<BTreeSet<CheckSource>>Which sources this host answers about its checks from, which is what the real implementation reports alongside them.
Unset is a credential allowed to read everything: the whole rollup, exactly
what a host with nothing to hide reports. A journey states a narrower set to
be the credential the real one meets in CI — a fine-grained token, which
cannot read check runs at all and sees GitHub Actions and nothing else — and
states an empty one to be a credential that can read no source at all,
which is a refusal rather than “no checks”. Unset and empty are therefore
different scenarios, which is why this is an Option rather than a set whose
emptiness means “not stated”.
merges: BTreeMap<ChangeId, MergeOutcome>What merging each change request did.
Both a script and a record: an entry seeded here is what merge answers,
whatever the policy asks for — which is how a journey expresses a host that
queues or refuses — and a merge the policy decided is written back here.
Trait Implementations§
Source§impl Checked for HostState
A seeded host side is refused if it holds a change nothing could address.
impl Checked for HostState
A seeded host side is refused if it holds a change nothing could address.