Skip to main content

GithubApi

Trait GithubApi 

Source
pub trait GithubApi: Send + Sync {
    // Required methods
    fn queued_jobs(
        &self,
        repository: &str,
    ) -> impl Future<Output = Result<Vec<QueuedJob>, Error>> + Send;
    fn runners(
        &self,
        repository: &str,
    ) -> impl Future<Output = Result<Vec<Runner>, Error>> + Send;
    fn jit_config(
        &self,
        repository: &str,
        name: &str,
        labels: &[String],
    ) -> impl Future<Output = Result<(Runner, JitConfig), Error>> + Send;
    fn delete_runner(
        &self,
        repository: &str,
        id: u64,
    ) -> impl Future<Output = Result<Deleted, Error>> + Send;
    fn job(
        &self,
        repository: &str,
        id: u64,
    ) -> impl Future<Output = Result<JobDetails, Error>> + Send;
    fn run_trigger(
        &self,
        repository: &str,
        run: u64,
    ) -> impl Future<Output = Result<RunTrigger, Error>> + Send;
    fn pull_request(
        &self,
        repository: &str,
        number: u64,
    ) -> impl Future<Output = Result<PullRequest, Error>> + Send;
    fn default_branch(
        &self,
        repository: &str,
    ) -> impl Future<Output = Result<String, Error>> + Send;
    fn on_branch(
        &self,
        repository: &str,
        branch: &str,
        sha: &str,
    ) -> impl Future<Output = Result<bool, Error>> + Send;
    fn cancel_run(
        &self,
        repository: &str,
        run: u64,
    ) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description

The GitHub calls the scheduler makes. Github is the real client; the engine’s tests use a fake.

Required Methods§

Source

fn queued_jobs( &self, repository: &str, ) -> impl Future<Output = Result<Vec<QueuedJob>, Error>> + Send

The repository’s jobs waiting for a runner, in queued runs and in runs that started some of their jobs.

Source

fn runners( &self, repository: &str, ) -> impl Future<Output = Result<Vec<Runner>, Error>> + Send

The repository’s self-hosted runners.

Source

fn jit_config( &self, repository: &str, name: &str, labels: &[String], ) -> impl Future<Output = Result<(Runner, JitConfig), Error>> + Send

Registers a runner for one job and returns it with the config the runner’s listener takes.

Source

fn delete_runner( &self, repository: &str, id: u64, ) -> impl Future<Output = Result<Deleted, Error>> + Send

Removes a runner from the repository.

Source

fn job( &self, repository: &str, id: u64, ) -> impl Future<Output = Result<JobDetails, Error>> + Send

One job’s progress and steps.

Source

fn run_trigger( &self, repository: &str, run: u64, ) -> impl Future<Output = Result<RunTrigger, Error>> + Send

What started a workflow run.

Source

fn pull_request( &self, repository: &str, number: u64, ) -> impl Future<Output = Result<PullRequest, Error>> + Send

One pull request: who opened it and where its head branch is.

Source

fn default_branch( &self, repository: &str, ) -> impl Future<Output = Result<String, Error>> + Send

The repository’s default branch.

Source

fn on_branch( &self, repository: &str, branch: &str, sha: &str, ) -> impl Future<Output = Result<bool, Error>> + Send

Whether branch of the repository has the commit sha: its head or an ancestor of it. A tag of the same name, which git would take for it, does not count.

Source

fn cancel_run( &self, repository: &str, run: u64, ) -> impl Future<Output = Result<(), Error>> + Send

Cancels a workflow run, and so every job in it: GitHub cancels runs, not single jobs. A run that already completed is left as it is.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§