pub struct HostState {Show 13 fields
pub version: u32,
pub authenticated_user: String,
pub changes: Vec<ChangeRequest>,
pub heads: BTreeMap<ChangeId, String>,
pub titles: BTreeMap<ChangeId, String>,
pub bodies: BTreeMap<ChangeId, String>,
pub checks: BTreeMap<ChangeId, Vec<Check>>,
pub check_logs: BTreeMap<ChangeId, BTreeMap<String, String>>,
pub drafts: BTreeMap<ChangeId, DraftReason>,
pub made_ready: Vec<ChangeId>,
pub described: Vec<Described>,
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.
bodies: BTreeMap<ChangeId, String>The body each change request was opened with, for the change requests that were opened with one.
Beside titles and for its reason: the body is what a
caller passes on the PublishRequest and nothing else records it, so a
journey asserting that the body it drafted is the one the host was given has
nowhere else to read it. A change request with no entry was opened with no
body at all, which is what a publication nobody gave one does — the two are
different scenarios, and an empty string is the first rather than the second.
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.
drafts: BTreeMap<ChangeId, DraftReason>The reason each change request that was opened as a draft was drafted with, for the change requests that were.
Beside bodies and for its reason: the reason is what a
caller passes on the PublishRequest and this is where a journey reads back
that the host was given it. A change with no entry is not a draft, which is
what every change request opened without one is.
Nothing is refused about the reason itself here. Its shape — that every field
of it renders as the one line it is printed on — is onevcs’s own rule, and
it is applied where a publication takes one in, before any host is asked.
made_ready: Vec<ChangeId>Every ready_for_review call this host has taken, in the order it took them
— the lifts it was asked to perform, never a request for a reviewer.
A list rather than a set, and beyond the sketch for a reason a set could not
serve: lifting a draft is required to be idempotent, so what a journey
asserts is that a second publication asked the host for nothing — and only a
record of the calls themselves can say that. A change named here is not a
draft any more, whatever drafts says it was opened as.
described: Vec<Described>Every describe_change call this host has taken, in the order it took them:
which change request, the title it was handed when it was handed one, and the
body.
The calls themselves, for the reason made_ready is:
what a journey asks is what a closeout wrote, call by call, and the current
title and body — which each call also writes into
titles and bodies, so
change_description answers from the same record open_change wrote — can
only say where the description ended up.
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.
Source§fn carry_forward(&mut self)
fn carry_forward(&mut self)
A version 2 document held no bodies, and a version 5 document’s checks named
no commit; each reads as what it was — change requests opened with none, and
checks whose head that build never recorded. There is nothing to fill in — an
absent field is already that answer, and a check’s commit is the one thing
that must never be inferred — so this is the version and nothing else. The one
carry a version 8 document needs, the kind its draft reasons lack, is done
where those are read (drafts_of_any_version), because it is a fact about
one value’s shape rather than about the document.