Search code examples
azure-devopsazure-pipelinesbitbucket

BitBucket showing Azure DevOps build as unsuccessful when build passed with warning


We have a repo in BitBucket and are using pipelines in Azure DevOps to build the repo. In BitBucket we can see the status of the last build from the pipeline on the pull request and we have branch restrictions that the build needs to have passed before we can merge. This all works well.

However, sometimes the pipeline will succeed with warnings. This happens where our UI tests initially fail and we rerun them and they pass. The succeed with warnings is a good way of displaying this. enter image description here

When we view the pull request in BitBucket it shows the build as having failed and means we aren't able to merge the PR.

enter image description here

How can we make BitBucket treat the succeeded with warnings as a "successful" build rather than an "unsuccessful" build?


Solution

  • It doesn't appear possible to do this.

    We changed our pipeline so that the initial jobs would always return a zero exit code regardless of if there were failed tests. This resolved the issue with BitBucket, but does mean that we can't easily see that a build "passed with warnings" or which steps generated the warnings.