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
sourceimpl 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>
) -> Result<Value, Error>
pub async fn builds(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
organization: Option<&str>,
repository: Option<&str>,
sha: 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>
) -> Result<String, Error>
pub fn builds_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
organization: Option<&str>,
repository: Option<&str>,
sha: 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>,
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>,
ttl: Duration
) -> Result<String, Error>
Generate a signed URL for the builds endpoint
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 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