Azure DevOps: Poor code coverage report should be added to Pull Request when Quality Gate fails

Hi.

When a Pull Request is active in Azure DevOps and the Quality Gate fails due to poor code coverage,
we actually don’t see any comment added to the Pull Request, but only that the status check failed.
The only possibility to see if poor code coverage is the culprit, is to click the status check and browse the SonarQube report.

I think SonarQube can decorate the Pull Request with a comment when such condition is met.
This comment would say: Quality Gate Failed due to code coverage < X, where X is your code coverage percentage set in your Quality Gate, if your Quality Gate is evaluating code coverage.
The comment would also include a link to SonarQube report for quick evaluation.

Code coverage is a good metric for us and it lets us analyse if the new code is unit-tested, which is a must-have for us.

Reasons:

  • current behaviour is not great of terms of user experience. Besides getting subscribed to a project and enabling Quality Gate failure notifications, no developer would see why the Quality Gate failed, but just only that it failed;
  • productivity boost: you need to click SonarQube Status Check (and you might have more than one active Status Check for your Pull Request), then go to SonarQube report to actually know what the reason behind the Quality Gate failure;
  • consistency with Quality Gate rules: if we consider the standard Sonar Quality Gate, there’re rules for security hotspots, bugs, code smells, code coverage, etc.
    I don’t understand why comments about breaking most of these rules are added to the Pull Request, except when code coverage is poor or missing.

We recently started a Developer Edition trial and we don’t understand why such important and useful feature is missing. I wouldn’t say it’d be a game changing feature, but it’d be appreciated to be there, as we see lots of value in it.

1 Like