SonarSource / sonar-scanner-msbuild

SonarScanner for .NET
http://redirect.sonarsource.com/doc/msbuild-sq-runner.html
GNU Lesser General Public License v3.0
362 stars 143 forks source link

Add publish Sonar Quality Gate results to Sonar Scanner for MSBuild #863

Open HofmeisterAn opened 4 years ago

HofmeisterAn commented 4 years ago

Is your feature request related to a problem? Please describe. To analyse our projects in our build pipeline at Azure DevOps we use Sonar Scanner for MSBuild and pass the required properties to the executable. This is a very convenient way to customize the build. However, it’s still necessary to call the SonarQubePrepare@4 and SonarQubePublish@4 tasks too, to receive the quality gate results in Azure DevOps to include them into the related pull request. It should not be necessary to call the tasks.

  1. The SonarScanner has all sonar.pullrequest.* properties.
  2. GitLab CI/CD supports sonar.qualitygate.wait=true.

Describe the solution you'd like SonarScanner.MSBuild.exe sould support something like sonar.qualitygate.wait=true and be able to report the quality gate result back to Azure without the additional tasks.

Describe alternatives you've considered -

Additional context -

mrmartan commented 3 years ago

The intended way of usage confuses me. Are supposed to use Sonar Scanner for MSBuild for analysis and then Sonar Scanner CLI in a different job to wait for quality gate?

I second that the Sonar Scanner for MSBuild should support the sonar.qualitygate.wait argument.