Skip to main content

ReviewProvider

Trait ReviewProvider 

Source
pub trait ReviewProvider {
Show 13 methods // Required methods fn review_for_branch(&self, branch: &str) -> Result<Option<ReviewRequest>>; fn review_for_branch_including_closed( &self, branch: &str, ) -> Result<Option<ReviewRequest>>; fn create_review( &self, branch: &str, base: &str, draft: bool, ) -> Result<String>; fn update_review_base( &self, review: &ReviewRequest, base: &str, ) -> Result<String>; fn review_body(&self, review: &ReviewRequest) -> Result<String>; fn update_review_body( &self, review: &ReviewRequest, body: &str, ) -> Result<String>; fn merge_review( &self, review: &ReviewRequest, strategy: &str, auto: bool, ) -> Result<String>; fn merge_blocker(&self, review: &ReviewRequest) -> Result<MergeBlocker>; fn wait_for_checks(&self, review: &ReviewRequest) -> Result<bool>; fn open_reviews(&self) -> Result<Vec<ReviewRequest>>; fn mark_ready(&self, review: &ReviewRequest) -> Result<String>; fn close_review( &self, review: &ReviewRequest, delete_branch: bool, ) -> Result<String>; fn open_review(&self, review: &ReviewRequest) -> Result<String>;
}

Required Methods§

Source

fn review_for_branch(&self, branch: &str) -> Result<Option<ReviewRequest>>

Source

fn review_for_branch_including_closed( &self, branch: &str, ) -> Result<Option<ReviewRequest>>

Like review_for_branch, but also finds closed reviews. Kept separate so flows that act on a review (submit, sync, cleanup) never mistake a dead review for a live one; only the stack-notes ledger wants closed state, to restyle the entry rather than drop it.

Source

fn create_review(&self, branch: &str, base: &str, draft: bool) -> Result<String>

Open a review for the branch; with draft, as a draft.

Source

fn update_review_base( &self, review: &ReviewRequest, base: &str, ) -> Result<String>

Source

fn review_body(&self, review: &ReviewRequest) -> Result<String>

Source

fn update_review_body( &self, review: &ReviewRequest, body: &str, ) -> Result<String>

Source

fn merge_review( &self, review: &ReviewRequest, strategy: &str, auto: bool, ) -> Result<String>

Merge the review with the given strategy: squash, rebase, or merge. With auto, schedule the merge for when required checks pass instead of merging now.

Source

fn merge_blocker(&self, review: &ReviewRequest) -> Result<MergeBlocker>

Why the platform won’t merge the review right now, read from its structured status. Consulted after a merge is rejected to explain it without parsing the CLI’s error text.

Source

fn wait_for_checks(&self, review: &ReviewRequest) -> Result<bool>

Block until the review’s checks settle. Ok(true) when they pass (or there are none), Ok(false) when something failed.

Source

fn open_reviews(&self) -> Result<Vec<ReviewRequest>>

Every open review, in one call - for annotating the stack with review numbers without a lookup per branch.

Source

fn mark_ready(&self, review: &ReviewRequest) -> Result<String>

Mark a draft review as ready for review.

Source

fn close_review( &self, review: &ReviewRequest, delete_branch: bool, ) -> Result<String>

Close the review without merging, deleting its source branch when delete_branch. Used to retire a review superseded by a branch rename.

Source

fn open_review(&self, review: &ReviewRequest) -> Result<String>

Open the review in the user’s browser.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§