Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ public DecorationResult decorateQualityGateStatus(AnalysisDetails analysisDetail

updateAnnotations(client, analysisDetails, reportKey);

BuildStatus buildStatus = new BuildStatus(analysisDetails.getQualityGateStatus() == QualityGate.Status.OK ? BuildStatus.State.SUCCESSFUL : BuildStatus.State.FAILED, reportKey, "SonarQube", analysisSummary.getDashboardUrl());
client.submitBuildStatus(analysisDetails.getCommitSha(),buildStatus);
if (!"true".equalsIgnoreCase(System.getenv("SONAR_BITBUCKET_SKIP_BUILD_STATUS"))) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't something that appears to exist in Sonarqube's documentation, so we're diverging from how they're configured. Do they have a property they offer for allowing a similar configuration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@ThibautMarechal ThibautMarechal Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some digging, I found that the feature of blocking a PR from code insight was released in the version 6.9 of Bitbucket.
If I do an additional http call to get the version of bitbucket, and based on that version only submitting a build-status if it's lower than 6.9 ?
The initial issue don't mention any bitbucket version at all.

BuildStatus buildStatus = new BuildStatus(analysisDetails.getQualityGateStatus() == QualityGate.Status.OK ? BuildStatus.State.SUCCESSFUL : BuildStatus.State.FAILED, reportKey, "SonarQube", analysisSummary.getDashboardUrl());
client.submitBuildStatus(analysisDetails.getCommitSha(),buildStatus);
}
} catch (IOException e) {
LOGGER.error("Could not decorate pull request for project {}", analysisDetails.getAnalysisProjectKey(), e);
}
Expand Down