pub struct GhClient<R: CommandRunner> { /* private fields */ }Expand description
Client for GitHub operations via the gh CLI.
Implementations§
Source§impl<R: CommandRunner> GhClient<R>
impl<R: CommandRunner> GhClient<R>
Sourcepub async fn get_issues_by_label(&self, label: &str) -> Result<Vec<Issue>>
pub async fn get_issues_by_label(&self, label: &str) -> Result<Vec<Issue>>
Fetch open issues with the given label, ordered oldest first.
Sourcepub async fn get_issue(&self, issue_number: u32) -> Result<Issue>
pub async fn get_issue(&self, issue_number: u32) -> Result<Issue>
Fetch a single issue by number.
Source§impl<R: CommandRunner> GhClient<R>
impl<R: CommandRunner> GhClient<R>
Sourcepub async fn add_label(&self, issue_number: u32, label: &str) -> Result<()>
pub async fn add_label(&self, issue_number: u32, label: &str) -> Result<()>
Add a label to an issue.
Sourcepub async fn remove_label(&self, issue_number: u32, label: &str) -> Result<()>
pub async fn remove_label(&self, issue_number: u32, label: &str) -> Result<()>
Remove a label from an issue.
Sourcepub async fn swap_labels(
&self,
issue_number: u32,
remove: &str,
add: &str,
) -> Result<()>
pub async fn swap_labels( &self, issue_number: u32, remove: &str, add: &str, ) -> Result<()>
Remove one label and add another in a single gh CLI call.
Sourcepub async fn ensure_labels_exist(&self) -> Result<()>
pub async fn ensure_labels_exist(&self) -> Result<()>
Ensure all oven labels exist in the repository.
Source§impl<R: CommandRunner> GhClient<R>
impl<R: CommandRunner> GhClient<R>
Sourcepub async fn create_draft_pr(
&self,
title: &str,
branch: &str,
body: &str,
) -> Result<u32>
pub async fn create_draft_pr( &self, title: &str, branch: &str, body: &str, ) -> Result<u32>
Create a draft pull request and return its number.
Sourcepub async fn create_draft_pr_in(
&self,
title: &str,
branch: &str,
body: &str,
repo_dir: &Path,
) -> Result<u32>
pub async fn create_draft_pr_in( &self, title: &str, branch: &str, body: &str, repo_dir: &Path, ) -> Result<u32>
Create a draft pull request in a specific repo directory and return its number.
Used in multi-repo mode where the PR belongs in the target repo, not the god repo.
Sourcepub async fn comment_on_pr(&self, pr_number: u32, body: &str) -> Result<()>
pub async fn comment_on_pr(&self, pr_number: u32, body: &str) -> Result<()>
Post a comment on a pull request.
Sourcepub async fn mark_pr_ready(&self, pr_number: u32) -> Result<()>
pub async fn mark_pr_ready(&self, pr_number: u32) -> Result<()>
Mark a PR as ready for review (remove draft status).
Auto Trait Implementations§
impl<R> Freeze for GhClient<R>where
R: Freeze,
impl<R> RefUnwindSafe for GhClient<R>where
R: RefUnwindSafe,
impl<R> Send for GhClient<R>
impl<R> Sync for GhClient<R>
impl<R> Unpin for GhClient<R>where
R: Unpin,
impl<R> UnsafeUnpin for GhClient<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for GhClient<R>where
R: UnwindSafe,
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
Mutably borrows from an owned value. Read more