Register Now

Adding Build Status for Bitbucket Pull Requests

Codeship News

Reading Time: 2 minutes

Ever wanted to see a pull request’s Codeship build status in Bitbucket? Our awesome user Chesley Brown has written a small NodeJS app that does just that. He was kind enough to open-source it! Here you will learn how he came up with the idea and how he built his app. Chesley takes it from here:

Github provides beautiful CI integration and after I switched my team over to Bitbucket for a better experience with the rest of our Atlassian products, it quickly became one of our most missed features. Of course, we weren’t the only ones wishing for better CI integration. There is an open issue on Bitbucket with more than 120 votes, 35 comments and currently the 15th most requested feature. This issue has been open for about a year now with no real updates from Atlasssian which told me we might have to take action ourselves if we wanted to improve our development workflow.

I have my team using Codeship for Continuous Integration and Delivery as well as using it for my own personal projects. I’ve yet to have any real complaints, the pricing is fair and their support has been very responsive for the few times I’ve needed it. We already place the Codeship Badge on all our project READMEs for a quick reference on the status of the master branch, but this didn’t provide a whole lot of value for us. We needed to know if the build was complete and successful at the point of the pull request review, just like in the Github CI integration.

I quickly realized that Codeship’s badge allowed for specifying the branch for which it showed the build status. A quick test showed I just needed someway of getting the badge into the pull request description with the right branch set to easily show the current status of the build.

All I needed was a simple app that would work with a Bitbucket Pull Request POST hook. Once a pull request is created, we just needed to automatically append the correct Codeship badge into the description. And so that’s exactly what I built with bitbucket-codeship-status.

Sign up for a free Codeship Account

As always, I’ve open sourced it so it’s available to everyone. It utilizes the Heroku Button which allows anyone to instantly have an instance of this up and running in seconds and for free. There really isn’t much to the code, just a small NodeJS app that uses the Bitbucket API to update the pull request description. But I think that’s the beauty of it. It’s a very elegant workaround for a feature that Bitbucket likely won’t introduce anytime soon.

We want to thank Chesley for providing his app to everyone and for writing his original article, which you can find here.

Subscribe via Email

Over 60,000 people from companies like Netflix, Apple, Spotify and O'Reilly are reading our articles.
Subscribe to receive a weekly newsletter with articles around Continuous Integration, Docker, and software development best practices.



We promise that we won't spam you. You can unsubscribe any time.

Join the Discussion

Leave us some comments on what you think about this topic or if you like to add something.