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
impl Github
sourcepub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
Create a new Github instance, based on the given client builder
sourcepub async fn ping(&self) -> Result<(), Error>
pub async fn ping(&self) -> Result<(), Error>
Ping Server
Respond without doing anything. This endpoint is used to check that the service is up.
sourcepub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the ping endpoint
sourcepub async fn lbheartbeat(&self) -> Result<(), Error>
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.
sourcepub fn lbheartbeat_url(&self) -> Result<String, Error>
pub fn lbheartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the lbheartbeat endpoint
sourcepub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the lbheartbeat endpoint
sourcepub async fn version(&self) -> Result<(), Error>
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
sourcepub fn version_url(&self) -> Result<String, Error>
pub fn version_url(&self) -> Result<String, Error>
Generate an unsigned URL for the version endpoint
sourcepub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the version endpoint
sourcepub async fn githubWebHookConsumer(&self) -> Result<(), Error>
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.
sourcepub 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>
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.
sourcepub 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>
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
sourcepub 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>
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
sourcepub async fn cancelBuilds(
&self,
owner: &str,
repo: &str,
sha: Option<&str>,
pullRequest: Option<&str>
) -> Result<Value, Error>
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
sourcepub async fn badge(
&self,
owner: &str,
repo: &str,
branch: &str
) -> Result<(), Error>
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.
sourcepub fn badge_url(
&self,
owner: &str,
repo: &str,
branch: &str
) -> Result<String, Error>
pub fn badge_url( &self, owner: &str, repo: &str, branch: &str ) -> Result<String, Error>
Generate an unsigned URL for the badge endpoint
sourcepub fn badge_signed_url(
&self,
owner: &str,
repo: &str,
branch: &str,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn repository(&self, owner: &str, repo: &str) -> Result<Value, Error>
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.
sourcepub fn repository_url(&self, owner: &str, repo: &str) -> Result<String, Error>
pub fn repository_url(&self, owner: &str, repo: &str) -> Result<String, Error>
Generate an unsigned URL for the repository endpoint
sourcepub fn repository_signed_url(
&self,
owner: &str,
repo: &str,
ttl: Duration
) -> Result<String, Error>
pub fn repository_signed_url( &self, owner: &str, repo: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the repository endpoint
sourcepub async fn latest(
&self,
owner: &str,
repo: &str,
branch: &str
) -> Result<(), Error>
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.
sourcepub fn latest_url(
&self,
owner: &str,
repo: &str,
branch: &str
) -> Result<String, Error>
pub fn latest_url( &self, owner: &str, repo: &str, branch: &str ) -> Result<String, Error>
Generate an unsigned URL for the latest endpoint
sourcepub fn latest_signed_url(
&self,
owner: &str,
repo: &str,
branch: &str,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn createStatus(
&self,
owner: &str,
repo: &str,
sha: &str,
payload: &Value
) -> Result<(), Error>
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.
sourcepub async fn createComment(
&self,
owner: &str,
repo: &str,
number: &str,
payload: &Value
) -> Result<(), Error>
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.
sourcepub async fn renderTaskclusterYml(
&self,
payload: &Value
) -> Result<Value, Error>
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
sourcepub async fn heartbeat(&self) -> Result<(), Error>
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.
sourcepub fn heartbeat_url(&self) -> Result<String, Error>
pub fn heartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the heartbeat endpoint