How to silence warnings about sonar.pullrequest.provider being deprecated

  • SonarQube Enterprise, Azure DevOps, GitHub
  • Remove deprecation warning from SonarQube reports

When running Azure pipelines against a Pull Request in GitHub, we see the following warning against each report on our SonarQube server:

Usage of parameter ‘sonar.pullrequest.provider’ from the scanner is deprecated. Please configure this parameter in the configuration of your project.

Presumably this parameter is set by one of the Azure tasks: SonarQubePrepare@4, SonarQubeAnalyze@4, or SonarQubePublish@4 so it’s not something we directly have any control over. Is there a way to silence this warning so that we don’t end up in the “broken windows” syndrome of having a warning that is always there but can be ignored?

5 Likes

This parameter is being set in SonarQubePrepare@4 which we don’t control.

Shouldn’t this task be updated by SonarQube eventually. Can we get a small update on this please?

We are using version 9 of the server and the DevOps extensions is automatically updated I believe.

Thank you

1 Like

Actually I found a dirty solution to temporary get rid of those notifications.
On Azure build agent(s) navigate to agent’s work tasks folder:
ex.: C:\work\_tasks

Then for each Sonarqube related task (SonarQubePrepare, SonarQubeAnalyze and SonarQubePublish) open sources of its latest version and open file under: “common\prepare-task.js”.

In these files just comment out lines where sonar.pullrequest.provider setting is set:
ex.: /* props["sonar.pullrequest.provider"] = "vsts"; */

Regards,
Mitja