Reputation: 77
Below is the message shown when I create a pull request(which I configured the sonar for bitbucket plugin).Please advise. Thanks.
Sonar data unavailable
Was not able to fetch data for Sonar project "abc.com". Either your pull request has not been analyzed yet, a non-existing Sonar project is referenced or you use the new branching feature of SonarQube 6.7 but have not enabled this in the repository settings. You can configure the Sonar project in the repository settings.
Upvotes: 1
Views: 5942
Reputation: 2671
There could be many of reasons for this issue. One of the reason we face this issue is when we raise a PR in a new repository.
Now, in a new repository, base/default branch would always be empty and hence there will be no sonar data for that. Now, to add the codebase the very first time, you would create a feature branch and raise a PR for that. Now, if you have enabled the sonar plugin for your repository, bitbucket will try to compare sonar reports of your feature as well as base branch. Now, since there is no sonar data for base branch, bitbucket will throw below error.
Sonar data unvailable
Solution: Disable the sonar plugin on your repository for the very first PR merge. Once PR is merged in base branch, enable the plugin back again and you will be back into business.
Upvotes: 2