Struct taskcluster::Github

source ·
pub struct Github {
    pub client: Client,
}
Expand description

GitHub Service

The github service is responsible for creating tasks in response to GitHub events, and posting results to the GitHub UI.

This document describes the API end-point for consuming GitHub web hooks, as well as some useful consumer APIs.

When Github forbids an action, this service returns an HTTP 403 with code ForbiddenByGithub.

Fields§

§client: Client

The underlying client used to make API calls for this service.

Implementations§

source§

impl Github

source

pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>

Create a new Github instance, based on the given client builder

source

pub async fn ping(&self) -> Result<(), Error>

Ping Server

Respond without doing anything. This endpoint is used to check that the service is up.

source

pub fn ping_url(&self) -> Result<String, Error>

Generate an unsigned URL for the ping endpoint

source

pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the ping endpoint

source

pub async fn lbheartbeat(&self) -> Result<(), Error>

Load Balancer Heartbeat

Respond without doing anything. This endpoint is used to check that the service is up.

source

pub fn lbheartbeat_url(&self) -> Result<String, Error>

Generate an unsigned URL for the lbheartbeat endpoint

source

pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the lbheartbeat endpoint

source

pub async fn version(&self) -> Result<(), Error>

Taskcluster Version

Respond with the JSON version object. https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md

source

pub fn version_url(&self) -> Result<String, Error>

Generate an unsigned URL for the version endpoint

source

pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the version endpoint

source

pub async fn githubWebHookConsumer(&self) -> Result<(), Error>

Consume GitHub WebHook

Capture a GitHub event and publish it via pulse, if it’s a push, release, check run or pull request.

source

pub async fn builds( &self, continuationToken: Option<&str>, limit: Option<&str>, organization: Option<&str>, repository: Option<&str>, sha: Option<&str>, pullRequest: Option<&str> ) -> Result<Value, Error>

List of Builds

A paginated list of builds that have been run in Taskcluster. Can be filtered on various git-specific fields.

source

pub fn builds_url( &self, continuationToken: Option<&str>, limit: Option<&str>, organization: Option<&str>, repository: Option<&str>, sha: Option<&str>, pullRequest: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the builds endpoint

source

pub fn builds_signed_url( &self, continuationToken: Option<&str>, limit: Option<&str>, organization: Option<&str>, repository: Option<&str>, sha: Option<&str>, pullRequest: Option<&str>, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the builds endpoint

source

pub async fn cancelBuilds( &self, owner: &str, repo: &str, sha: Option<&str>, pullRequest: Option<&str> ) -> Result<Value, Error>

Cancel repository builds

Cancel all running Task Groups associated with given repository and sha or pullRequest number

source

pub async fn badge( &self, owner: &str, repo: &str, branch: &str ) -> Result<(), Error>

Latest Build Status Badge

Checks the status of the latest build of a given branch and returns corresponding badge svg.

source

pub fn badge_url( &self, owner: &str, repo: &str, branch: &str ) -> Result<String, Error>

Generate an unsigned URL for the badge endpoint

source

pub fn badge_signed_url( &self, owner: &str, repo: &str, branch: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the badge endpoint

source

pub async fn repository(&self, owner: &str, repo: &str) -> Result<Value, Error>

Get Repository Info

Returns any repository metadata that is useful within Taskcluster related services.

source

pub fn repository_url(&self, owner: &str, repo: &str) -> Result<String, Error>

Generate an unsigned URL for the repository endpoint

source

pub fn repository_signed_url( &self, owner: &str, repo: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the repository endpoint

source

pub async fn latest( &self, owner: &str, repo: &str, branch: &str ) -> Result<(), Error>

Latest Status for Branch

For a given branch of a repository, this will always point to a status page for the most recent task triggered by that branch.

Note: This is a redirect rather than a direct link.

source

pub fn latest_url( &self, owner: &str, repo: &str, branch: &str ) -> Result<String, Error>

Generate an unsigned URL for the latest endpoint

source

pub fn latest_signed_url( &self, owner: &str, repo: &str, branch: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the latest endpoint

source

pub async fn createStatus( &self, owner: &str, repo: &str, sha: &str, payload: &Value ) -> Result<(), Error>

Post a status against a given changeset

For a given changeset (SHA) of a repository, this will attach a “commit status” on github. These statuses are links displayed next to each revision. The status is either OK (green check) or FAILURE (red cross), made of a custom title and link.

source

pub async fn createComment( &self, owner: &str, repo: &str, number: &str, payload: &Value ) -> Result<(), Error>

Post a comment on a given GitHub Issue or Pull Request

For a given Issue or Pull Request of a repository, this will write a new message.

source

pub async fn renderTaskclusterYml( &self, payload: &Value ) -> Result<Value, Error>

Render .taskcluster.yml file

This endpoint allows to render the .taskcluster.yml file for a given event or payload. This is useful to preview the result of the .taskcluster.yml file before pushing it to the repository. Read more about the .taskcluster.yml file in the documentation

source

pub async fn heartbeat(&self) -> Result<(), Error>

Heartbeat

Respond with a service heartbeat.

This endpoint is used to check on backing services this service depends on.

source

pub fn heartbeat_url(&self) -> Result<String, Error>

Generate an unsigned URL for the heartbeat endpoint

source

pub fn heartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the heartbeat endpoint

Auto Trait Implementations§

§

impl !RefUnwindSafe for Github

§

impl Send for Github

§

impl Sync for Github

§

impl Unpin for Github

§

impl !UnwindSafe for Github

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more