Scanner command used when applicable – pipe: sonarsource/sonarcloud-scan:1.4.0
Languages of the repository – Java, Javascript, Typescript
Link to pull request: private repo
Issue: Only 2 of the 3 sonar widgets are showing on the pull request (1 Java, 2 JS/TS), and several errors in chrome dev tools on bitbucket pull request page (below). All 3 analysis for the pull request are available in sonarcloud
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-vendor-512d10dc.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-messages-f65e614b.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-SonarCloudLogo-eee9be78.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/integration/bitbucketcloud/pr_widget/plugin.min.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-CardHeaderTitle-5b418037.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-lodash-d59f9db2.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-integration/bitbucketcloud/pr_widget/index-3ebc1317.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-bitbucketcloud-c9508a64.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://sonarcloud.io/bbc-sentry-a174240d.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
Steps to Reproduce: Run any build with the three analysis’ configured
I don’t see the widget with quality information whereas I configured everything.
Make sure that your browser is not using some extensions like AdBlocks. They tend to break the integration of third-party applications in Bitbucket Cloud.
ganncamp
You have one project with all three languages? Or is this three different projects/analyses?
The repository has all three languages, and there are three sonar analyses, so… one project in bitbucket, and three projects in sonarcloud.
ganncamp
Am I correct in guessing the projects these errors are for are all private?
Correct, private repo, private in sonarcloud.
ganncamp
403 is a permissions error
Right, but the permissions seem to be correct… at least partly, since I can see the two PR decorations just fine, and in sonarcloud I can appropriately link to bitbucket from all three. Also, the reports in bitbucket show correctly for all three. It’s just the decoration widgets. Only two of the three show.
Would you mind providing a screenshot - redacted as necessary - of the page where the widgets do/don’t show up, please? It will help me understand which widget we’re talking about.
You can see the green and blue rectangles match up… but the red one is missing from the section on the left… and it says only 2 of 2… but there are 3 analyses.
Thanks Ann… here’s some more info on the repo setup:
The entire application is a multi-module gradle project. The main project is a Java backend, and uses two separate audience Javascript/Typescript frontend client projects that are built as gradle project dependencies.
The pipeline does the unit tests (and sonar scans) in parallel. The frontend clients are scanned using the bitbucket sonar “pipe” after being tested using npm. The backend uses jacoco for coverage and then uses the gradle scanner task (sonar plugin).
We kind of prefer the separation… but I’m curious to hear your ideas on combining them.
I’ve also reached out to Atlassian to see if there is some kind of hard limit of 2 on those decorations.
Greetings,
I can confirm that those DevTools failed to load source map errors are not related to the BitBucket widget not loading, our source map files are used for development but are not accessible publicly.
Regarding the third widget not loading, It sounds like you are using the monorepo approach to integrating with SonarCloud.
There is a section titled Configuring your CI service which describes how to configure multiple SonarCloud projects to the one repository.
In the build procedure for each monorepo project, make sure to specify the SonarCloud project key that you designated for it. This provides the binding between the project within the monorepo and the corresponding project in SonarCloud. This enables SonarCloud to correctly process the analysis results and to dispatch pull request decorations back to the DevOps platform for each project individually.
Could you verify all three projects have configuration sections defined?
I did finally get this fixed, where all 3 analyses are showing up on the bitbucket pull request. After your suggestions regarding the monorepo setup and the links you provided… I checked the settings in sonarcloud and only one of the three was marked as “enable monorepo”… I initially ignored this, since the subtext says it only works for Azure.
When I tried to enable it for the other two projects however, it said that the first project was already configured. So I removed all three projects from sonarcloud and started fresh, enabled the monorepo setting on all of them… as well as another setting: General > Pull Requests > Provider > Set this to Bitbucket. I don’t think this last setting existed when I originally setup the first project (a year or two ago), so I don’t think that was configured originally either.