used software:
- SonarQube 7.6
- nuget dotnet-sonarscanner https://www.nuget.org/packages/dotnet-sonarscanner,
- TFS on prem
We are using SonarQube and the dotnet-sonarscanner from nuget which works great. Unfortunately, we are not able to get the information about the sonarqube scan and quality gates back to TFS.
We want to prevent PullRequests from being merged if the quality gate is not passed. I understood that you don't want to break the build anymore if the quality gate is broken.
I found something on the documentation (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS) but I am not finding the mentioned settings like “Administration -> General Settings -> Pull Requests”
The background is that we use the sonarqube scanner within our docker builds:
dotnet tool install --global dotnet-sonarscanner --version 4.4.2
apt-get -yqq update && apt-get -yqq install openjdk-8-jre-headless > /dev/null
dotnet-sonarscanner begin /k:$BUILD_NAME /d:sonar.host.url="$SONAR_HOST" /d:sonar.login="$SONAR_LOGIN" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*" /d:sonar.cs.opencover.reportsPaths=/src/opencover.xml /v:$BUILD_ID
dotnet build $UNITTEST_PROJECT
coverlet $UNITTEST_ASSEMBLY --target "dotnet" --targetargs "test $UNITTEST_PROJECT --no-build" --output /src/opencover.xml --format opencover
dotnet publish $PROJECT -c Release -o /app
dotnet-sonarscanner end /d:sonar.login="$SONAR_LOGIN"