We have just updated to v9.4 of SonarQube, and suddenly PR comments have been re-enabled on projects where previously we had them disabled.
I’ve checked the project settings, and there doesn’t seem to be an option for “Pull Request Decoration” anymore.
We are unable to use the PR decoration due to the lack of support for monorepos in Developer edition. Please can you let me know how to disable PR decoration on some projects
Thanks, I gave that a go and unfortunately PR comments are still appearing. I guess because we have the token to Azure Devops set globally still, for project importing & for other teams that dont use monorepos to use the PR integration.
After doing that, no new PR decoration should be triggered for your project’s PR. However, previously created comments on your Azure PRs won’t be deleted by turning this off.
I’ve tried reproducing this locally and the behaviour seems consistent to what I have described.
Could you confirm if the PR decoration comments you’re seeing are appearing after the DevOps settings were reset for all relevant projects of the monorepository?
With @jlawless’s help we were able to determine what was the reason behind PR Decoration still taking place:
Even with the DevOps Platform information being cleared out from the project on SQ, PR Decoration can still happen if there are global DevOps Platform settings for Azure, and if the analysis for that wrongly-decorated project is being triggered through an Azure pipeline using the SQ Azure DevOps extension.
The “Prepare Analysis on SonarQube” task provided by this extension defines a value for the sonar.pullrequest.provider scanner parameter.
This parameter can act as a fallback mechanism for also triggering PR Decoration. When it is used, a warning will be displayed on the analyzed Pull Request on SQ.
After checking with the team responsible for the extension, I confirmed that the definition of this parameter cannot be removed, as it is needed for SonarCloud.
Here is a workaround to avoid PR decoration:
Edit the pipeline that is triggering the SQ analysis
On the “Prepare Analysis on SonarQube” task, open the “Advanced” section and add
Going forward:
I understand this is not the ideal hack and that we should provide a better solution, like explicitly “turning off” PR decoration from SQ’s UI. Therefore I’ll raise this subject internally with our PMs.