I love pull requests
No, really: I love pull requests. But I’ve learned to be more than a little nervous when accepting them. If only I had a dollar for every time an innocent-looking pull request completely threw the spanner in the works, broke every build, and had my team Nerf-pelting me because of the test failures. I’d be a rich man who wouldn’t have to sling code for a living!
To avoid being subjected to guerrilla Nerf warfare, I need to check the build status of the development branch before approving the request. So I go back to my Bamboo server and find the associated branch build. Scanning the history, I can see the results of builds triggered by the commit in question.
If the tests passed, I accept the pull request and merge into master (woo-hoo!). If they failed, I fire a warning shot across the office to the perpetrator. Time spent: 5 minutes (add another 5 minutes if its an unusually enthusiastic Nerf battle).
We wanted a better way to see whether the changes in the pull request are passing the build. A way that takes less time and does not run the risk of a full scale Nerf armageddon.
So the Bamboo and Stash team got together and built a Notification plugin. Using Stash’s new Build Status API, Bamboo sends a build’s result over to Stash. Stash then cross-references the commits included in that build with any open pull requests. If a match is found, a simple pass or fail icon is displayed as part of the pull request. Bingo: the info we need, right where (and when) we need it.
Checking the build status in Stash before you accept the pull request
Ready to try it yourself?
The Bamboo Stash plugin is a free download via the Atlassian Marketplace for all Bamboo 4.3, 4.4 and Stash 2.1 customers. Hurry over and “Git” it before Nerf-ageddon strikes you!