We’re using Sonarcloud integration for Bitbucket Cloud repository and CI/CD with Azure DevOps.
We’ve set up pull-request validation builds. Sonarscanner analisys takes too much time, so we’ve split our PR-validation to two builds:
- Regular build+test run to validate that code actually builds and tests pass
- Sonar build - to perform static analysis and provide pull-request page with all the code metrics needed.
So now we have problem with build statuses in Bitbucket cloud.
First build has ‘report build status’ checked in Azure DevOps, so after every run we see
1 of 1 passedand we understand, that build and tests passed. The second build has this option off. But it still reports its status trough analyzer itself, because we’ve set it up to decorate our pull-requests.
So later the second build finishes and it OVERWRITES build statuses: we now see
1 of 2 builds passed
First link targets to Azure DevOps sonar build (
second build from above two). Second link targets to sonarcloud branch overview.
First build link is lost. So if something goes wrong - we’re forced to search trough Azure DevOps pipelines results to find that FIRST build and see what gone wrong (second build sometimes fails only because it were killed by timeout - because analysis build is really slow).
Is there any way to preserve already existing build statuses whenever sonarcloud reports itself to Bitbucket cloud?