VSTS Pull Request integration is not quite working.
Foreword. I had lots of useful screenshots but I’m a new user and can only include a single image.
I’ve followed the steps described here: https://almvm.azurewebsites.net/labs/vstsextend/sonarcloud/
I’ve then created a branch with some deliberately poor code as to fail the quality gates and to observe my PR build fail and for sonar to create comments within. However, within the PR, no comments are presented and the build reports a successful completion even though the quality gate has failed when you inspect the build itself.
To extend this out and demonstrate…
I have a build with the SonarCloud steps wrapped around it. The only difference I can observe from the demo is that we do not use VSTS Tasks to construct my build - instead we run a build.cake script.
As such my build definition looks like this:
[Image removed due to restriction] Image shows SonarCloud Prepare, Run and Publish steps wrapped a round a Powershell step and a Publish Test Results to VSTS step
When I queue this build and it completes, I get my feedback from SonarCloud as shown:
[Imaged Removed] Image shows that the Sonar Quality Gate fails
I’ve got this same build definition set as a build validation requirement in the branch policy of my master branch. When I create a PR into master, the build auto-triggers but then I get no PR comments and it reports back as successful:
If I follow the links through into SonarCloud you can see that the PR has issues but they do not block the merge:
[Image removed] Image showed 5 quality issues in the SonarCloud dashboard. 1 Critical, 1 Major, and 3 Minor.
Is there any help you can offer to overcome this?
Let me know if you need any further details.