pub struct Host<T> { /* private fields */ }Expand description
The remote-host side of a run, over whichever store holds its state.
It is both interfaces at once: a RemoteHost a journey can call directly, and
the Hosting factory a run is handed. A host taken from the factory shares
this one’s state, so what a publication did is read back through the value the
journey created.
Implementations§
Source§impl Host<MemoryStore<HostState>>
impl Host<MemoryStore<HostState>>
Source§impl Host<FileStore<HostState>>
impl Host<FileStore<HostState>>
Sourcepub fn create(path: impl Into<PathBuf>) -> Result<Self>
pub fn create(path: impl Into<PathBuf>) -> Result<Self>
A host keeping its state at path: whatever is already there, or nothing
opened against it.
Attaching rather than replacing, so a second host over the same path answers about the change requests the first one opened.
Source§impl<T: Store<HostState>> Host<T>
A person’s moves on a stack of change requests, which no interface method makes: the
real host takes them from people — a merge on its page, a branch deleted, a change
request closed or moved — so a journey takes them here.
impl<T: Store<HostState>> Host<T>
A person’s moves on a stack of change requests, which no interface method makes: the real host takes them from people — a merge on its page, a branch deleted, a change request closed or moved — so a journey takes them here.
Sourcepub fn merge_by_person(
&self,
change: &ChangeId,
how: PersonMerge,
at: &str,
head: HeadAfter,
) -> Result<Sha>
pub fn merge_by_person( &self, change: &ChangeId, how: PersonMerge, at: &str, head: HeadAfter, ) -> Result<Sha>
A person merges change on the host into the base it targets now — how a squash
or a merge commit — at at, an RFC 3339 moment on the host’s clock, and then keeps
or deletes its head as head says: a deleted head closes or retargets every open
change request based on it. Answers the commit the base reached. Nothing is
written to the ledger: nobody on this host made a call.
Sourcepub fn close_unmerged(&self, change: &ChangeId) -> Result<()>
pub fn close_unmerged(&self, change: &ChangeId) -> Result<()>
A person closes change on the host without merging it.
Sourcepub fn retarget_by_person(&self, change: &ChangeId, base: &str) -> Result<()>
pub fn retarget_by_person(&self, change: &ChangeId, base: &str) -> Result<()>
A person moves change onto base on the host.
Source§impl<T: Store<HostState>> Host<T>
A reviewer’s moves on a change request’s feedback, which no interface method makes:
the real host takes them from people, so a journey takes them here.
impl<T: Store<HostState>> Host<T>
A reviewer’s moves on a change request’s feedback, which no interface method makes: the real host takes them from people, so a journey takes them here.
Sourcepub fn add_comment(&self, change: &ChangeId, comment: HostComment) -> Result<()>
pub fn add_comment(&self, change: &ChangeId, comment: HostComment) -> Result<()>
Post one more comment on change, as a reviewer would — a review-thread
comment, a review’s summary or a conversation comment, whichever comment’s
kind says. Its revision is this host’s to set, and is set past every read so
far.
Trait Implementations§
Source§impl<T: Store<HostState>> RemoteHost for Host<T>
impl<T: Store<HostState>> RemoteHost for Host<T>
Source§fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
Take the change request out of its draft state.
The call itself is what is recorded, rather than a flag that would read the same whether it was made once or twice: what a journey asks of this is whether a second publication over an already-lifted change asked the host for anything, and only the calls can answer that. A change already open for review is already what this asks for, so it succeeds — the caller wanted it ready, and it is.
Source§fn required_checks_on(&self, _base: &str) -> Result<RequiredChecks>
fn required_checks_on(&self, _base: &str) -> Result<RequiredChecks>
What the repository requires before a merge into base: the seeded answer,
or — unset — exactly the checks seeded as required, completely.
Source§fn describe_change(
&self,
cr: &ChangeRequest,
title: Option<&str>,
body: &str,
) -> Result<()>
fn describe_change( &self, cr: &ChangeRequest, title: Option<&str>, body: &str, ) -> Result<()>
Replace the description, recording the call.
The title and body go where open_change put the ones it was given, so what
change_description reads back is the same record whichever call wrote it —
and the call itself is kept, for the reason ready_for_review’s is: a journey
about a closeout asks what was written and in what order, and the current
description cannot say. A title that names nothing is refused as the real host
refuses one; a body is prose, and an empty one is a description a caller may
mean.
Source§fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
The description as this host holds it: the title it was opened or last described with, and the body — empty where it was opened with none and never described since, which is what the real host answers for one.
Source§fn review_comments(
&self,
change: &ChangeId,
since: Option<&ReadMarker>,
) -> Result<ReviewRead>
fn review_comments( &self, change: &ChangeId, since: Option<&ReadMarker>, ) -> Result<ReviewRead>
What changed in the change request’s review feedback since since, by this
host’s own count of changes to it — see review.
Source§fn reply_to_comment(
&self,
change: &ChangeId,
comment: &CommentId,
body: &str,
key: &str,
) -> Result<PostedReply>
fn reply_to_comment( &self, change: &ChangeId, comment: &CommentId, body: &str, key: &str, ) -> Result<PostedReply>
One reply, posted in the comment’s thread where it has one and as a
conversation comment linking it otherwise, and recorded in
HostState::replies.
Source§fn mergeability(&self, cr: &ChangeRequest) -> Result<Mergeability>
fn mergeability(&self, cr: &ChangeRequest) -> Result<Mergeability>
Recorded on the ledger and answered as the trait’s default answers: this host holds no mergeability, and a publication reads the refusal as a host that said nothing, which is no conflict — so it watches as it always did here.
Source§fn head_activity(&self, cr: &ChangeRequest) -> Result<HeadActivity>
fn head_activity(&self, cr: &ChangeRequest) -> Result<HeadActivity>
What HostState::head_activity scripts for this call about cr, answered about
the commit cr names; unscripted, nothing is running there, by every source.
Charged as the two REST reads the real host makes — the workflow runs and the
check suites on that commit.
Source§fn requires_up_to_date(&self, _base: &str) -> Result<bool>
fn requires_up_to_date(&self, _base: &str) -> Result<bool>
Whether this host requires an up-to-date branch: HostState::up_to_date_required.
Charged as the two protection reads the real host makes.
Source§fn allows_auto_merge(&self) -> Result<bool>
fn allows_auto_merge(&self) -> Result<bool>
Whether the repository allows auto-merge: HostState::allow_auto_merge.
Charged as the one query the real host makes.
Source§fn visibility(&self) -> Result<Visibility>
fn visibility(&self) -> Result<Visibility>
Recorded on the ledger and answered as the trait’s default answers: this host holds no visibility, so the boundary records it unknown and screens every write, as it always did here.
Source§fn change_standings(
&self,
root: &str,
changes: &[ChangeId],
) -> Result<ChangeStandings>
fn change_standings( &self, root: &str, changes: &[ChangeId], ) -> Result<ChangeStandings>
Where each change request stands, one per change request asked about — see
landings. Charged as the real host’s one query per 50.
Source§fn review_standings(
&self,
root: &str,
changes: &[(ChangeId, Option<ReadMarker>)],
) -> Result<ReviewStandings>
fn review_standings( &self, root: &str, changes: &[(ChangeId, Option<ReadMarker>)], ) -> Result<ReviewStandings>
Each change request’s standing and its review feedback since its marker, in one read charged as the real host’s one aliased query per 150.
Source§fn retarget_change(
&self,
change: &ChangeId,
base: &str,
body: Option<&str>,
) -> Result<ReadCost>
fn retarget_change( &self, change: &ChangeId, base: &str, body: Option<&str>, ) -> Result<ReadCost>
Move a change request onto base, writing body with it — refused, as the real
host refuses, for one that is merged or closed and for a base the origin no
longer has. Its draft state never changes. One REST request.
Source§fn reopen_change(&self, change: &ChangeId) -> Result<ReadCost>
fn reopen_change(&self, change: &ChangeId) -> Result<ReadCost>
Reopen a closed change request, as the draft it was — refused, as the real host refuses, for one that is not closed and for one whose base is still gone. One REST request.
Source§fn authenticated_user(&self) -> Result<String>
fn authenticated_user(&self) -> Result<String>
Source§fn open_change(&self, req: ChangeSpec) -> Result<ChangeRequest>
fn open_change(&self, req: ChangeSpec) -> Result<ChangeRequest>
Source§fn find_changes(&self, head: &str, base: &str) -> Result<Vec<ChangeRequest>>
fn find_changes(&self, head: &str, base: &str) -> Result<Vec<ChangeRequest>>
head into base.Source§fn change_checks(&self, cr: &ChangeRequest) -> Result<ChangeChecks>
fn change_checks(&self, cr: &ChangeRequest) -> Result<ChangeChecks>
Source§fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
Source§fn merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
fn merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
Source§fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
Source§fn merge_time(&self, cr: &ChangeRequest) -> Result<Option<String>>
fn merge_time(&self, cr: &ChangeRequest) -> Result<Option<String>>
None while it has not merged it. Read moreSource§fn merged_head(&self, cr: &ChangeRequest) -> Result<Option<MergedChange>>
fn merged_head(&self, cr: &ChangeRequest) -> Result<Option<MergedChange>>
None while the host has not merged it. Read more