Hello all,
I've run into an issue that has me confused with the VSTS/TFS SonarQube extension. For context, I'm on SonarQube 6.2, TFS 2017 (on premises), and the
SonarQube extension for TFS.
My understanding was that the plugin allows for integration into pull request so that we can scan PRs and have some visibility into potential issues before they are merged to master. It was also my understanding that setting the option to fail the build on quality gate failure during PRs would do what it says, fail on quality gate failure. From what I can tell, it works with CI builds but not for PRs. To me this kind of defeats the whole purpose of PR integration. It makes sense that when using this setting, if a PR failed a quality gate, the build would fail and be blocked from a merge until the issues have been resolved and the quality gate has passed. However, this is not what happens.
I've noticed these messages in the build logs of PRs that fail the quality gate Ignoring the setting of breaking the build on quality gate failure because the build was triggered by a pull request.
Why is this a thing? Not failing the PR build on quality gate failures allows people to merge issues to master which seems backwards. Isn't the whole purpose of PR integration to help prevent devs from merging issues into master? Am I misunderstanding the way the plugin is supposed to work or be used? Is there something I should be doing instead to fail PR builds on quality gate failures? I'm not sure why I would even bother scanning pull requests if I can't fail a build on quality gate failure. Here is a screenshot of the setting for pretty much all of the builds we have setup. Please let me know if there is something I can do differently to get this working.

Thanks,
-Andy