pub struct GitHub { /* private fields */ }Expand description
The GitHub implementation of RemoteHost, driven through gh.
Every method is one gh invocation, and the program that answers as gh is the
seam a journey substitutes: GitHub’s decisioning is what a test replaces, never
the git underneath it.
Implementations§
Source§impl GitHub
impl GitHub
Sourcepub fn new(repo: impl Into<String>) -> Result<Self>
pub fn new(repo: impl Into<String>) -> Result<Self>
Address this host at one repository, named owner/name.
Checked here rather than at each call: the slug is interpolated into every
gh --repo invocation, and a value that is not one repository is a value
that addresses something nobody asked for.
Trait Implementations§
impl Eq for GitHub
Source§impl RemoteHost for GitHub
impl RemoteHost for GitHub
Source§fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
Store one check’s log as an artifact, or refuse.
A fetch that did not produce the log is an error and no artifact: an
artifact reads as what the check printed, so one holding the reason there is
none is a lie in the only record a consumer has. A caller that must not fail
over a missing log declines to fail over this error, as crate::publish
does.
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<()>
One gh pr edit, handing the body over as a file.
A file rather than --body, because a body is prose of unbounded size and an
argument vector is not where multi-line Markdown belongs: the same reason
onevcs publish takes --body-file. The file is written under a scratch
directory that goes when this returns, and gh reads it before then.
Source§fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
One gh pr view, reading exactly the two fields a description is.
A response missing either is refused rather than read as empty: “the change request has no body” and “the host would not say what the body is” are different facts, and a caller finishing a description off what it reads here would otherwise start from a blank the host never answered.
Source§fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
One gh pr view, reading the one field the host decides a draft by.
A response that does not carry it is refused rather than read as “not a draft”: what this decides is whether a change may be asked to merge, and “could not look” reported as “nothing is holding it” is the one answer that lands work somebody held back.
Source§fn merged_at(&self, cr: &ChangeRequest) -> Result<Option<Sha>>
fn merged_at(&self, cr: &ChangeRequest) -> Result<Option<Sha>>
One gh pr view, reading exactly the two fields a merge is decided from —
the same read merge makes, through the same parser, so watching a change
request and merging one cannot come to disagree about what merged means.
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 merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
fn merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
Source§fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
Source§fn required_checks_on(&self, base: &str) -> Result<RequiredChecks>
fn required_checks_on(&self, base: &str) -> Result<RequiredChecks>
base, asked
of the branch itself rather than of a change request targeting it. Read moreimpl StructuralPartialEq for GitHub
Auto Trait Implementations§
impl Freeze for GitHub
impl RefUnwindSafe for GitHub
impl Send for GitHub
impl Sync for GitHub
impl Unpin for GitHub
impl UnsafeUnpin for GitHub
impl UnwindSafe for GitHub
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.