Hi,
We've been testing the new required builds functionality and found out that it seemingly doesn't work out of the box in Bitbucket Data Center for build statuses published from TeamCity's Commit Status Publisher build feature.
To configure the required build check in Bitbucket, a user is asked for a build key. We assumed that this is the value that is passed in the "key" field when commit statuses are published to Bitbucket. Yet it is seemingly not the case. At least the add required build form doesn't find any such keys (despite some statuses already published to various commits in our test repo) and if they key is added manually, Bitbucket claims that the merge operation is not allowed, even if a success status is published to the top commit in the respective branch.
Could it be the case that some add-on on Bitbucket Data Center side is required? Or are these different kind of keys?
The build result API for a certain commit as per REST API spec [1] can have the following payload:
{
"key": "TEST-REP123",
"state": "SUCCESSFUL",
"url": "https://bamboo.url/browse/TEST-REP1-3",
"buildNumber": "3",
The required build form lets you configure a merge-check based on successful build results for
At runtime the build result will be recorded by Bitbucket and if there is a pull request with a source-ref hash identical to the the {commitId} and a matching build key the build result will be considered when checking if the PR can be merged, or should be blocked because of a failing build.
We at Izymes have made an add-on called Workzone that lets you specify the number of successful builds (usually 1) for a protected target branch and also triggers an automatic merge if the build was successful. We have found that for most teams a successful build is the last step in their PR merge process, and it's easy to automate. Trigger build, build pass, automatic merge, done.
I hope this helps your integration. Best, Ulrich
Izymes - Remove boring from work
[1] https://docs.atlassian.com/bitbucket-server/rest/7.17.0/bitbucket-rest.html#idp228
... forgot to mention, Workzone does not require a 'build key' in its configuration for build result merge-checks and auto-merge.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.