Attaching Build Statuses To Commits On GitHub

Wercker is a Docker-Native CI/CD Automation platform for Kubernetes & Microservice Deployments

Micha Hernandez van Leuffen
Micha Hernandez van Leuffen
June 13, 2013

At wercker we make heavy use of GitHub and are big fans of what Tom, Chris, PJ, Scott and the rest of the GitHub team have built over the last years.When we started wercker, we wanted to integrate with GitHub to make the user experience for our continuous delivery platform smooth and seamless but also have a strong focus on collaboration. In this post we go into wercker’s integration with the GitHub commit status api for pull requests.

A while back GitHub announced the availability of the commit status api and wercker supports attaching the build result to the commit. There are two scenarios where wercker sets the status. One, is the result of every ‘normal’ build in wercker. These show up in the branch overview and inter-repository pull-requests. Another scenario is when a collaborator sends a pull request of a fork; this pull request will be built and the result will be set in your own repository.

This article is also available on our dev center

You can sign up for wercker for free here.

wercker build status to github

Scenario 1: Status on Commit

Even when pushing to your own repositories and without utilizing pull requests, results of these builds are attached to your commit.

Below you can see that the latest build for this blog has successfully completed on wercker.

wercker blog

If we view the branch of this commit on GitHub you can see that by hovering over the ✓ checkmark will showcase that the build finished with a success status.

wercker blog

Clicking that ✓ checkmark will take you to the build page on wercker and give you more details on the various buildsteps, such as unittests, bundle install andmiddleman processing the build went through.

Scenario 2: Pull Requests

The second scenario is the support for pull requests. Pull requests are an awesome way of collaborating on projects: you fork an existing repository, git push your improvements to your forked repo and do a pull request on the original repository to contribute back your code.

If the original repository is added to wercker, any pull request from a forked repo gets built and the status is attached to the pull request.

wercker commit status

We now know for certain that we can safely merge this pull request! When we hit the 'merge this pull request’ button we still want to build the end result of the merge, which wercker does automatically.

Another way to showcase your latest build status is through the wercker badge which you can add via the 'share button’ as shown below.

image

The build status for this blog is for instance as follows:

Wercker status green

Pull requests are a very powerful mechanism for working together on code and wercker makes them even better.

Sign up for wercker for free here

 

Topics: Product, Tutorials