Hi SonarCloud users,
when we added the support for PRs (Pull Requests), we first started to report only issues - because this is what brings the most useful information to development teams. At that time, a PR was considered “failed” if there was at least one open issue on it.
Since yesterday, PRs now display a real Quality Gate Status, based on the quality gate defined for the project they belong to. So if you have a condition on the coverage on your new code, it will now be taken into account!
Visible changes on the PRs
In GitHub, the SonarCloud page now displays the status of the quality gate as the first entry, with details of failed conditions if any:
On Bitbucket Cloud, a similar status overview is visible - the analysis details being collapsed by default to not eat too much space:
On Azure DevOps, there is no space to display an overview of the quality gate status, so mainly the following label was updated:
In SonarCloud, PRs get a brand new page
PRs would not be considered as first class citizen if they did not get a dedicated page inside SonarCloud. This is now done. Clicking on the quality gate status link from GitHub / Bitbucket Cloud / Azure DevOps will lead to a brand new page which looks like this:
Quality Gate conditions checked on PRs
One important detail to keep in mind: the conditions used to compute the quality gate status are the ones define on new code only. And this works perfectly out of the box with the built-in “Sonar way” quality gate since it focuses on the new code (“Fix the leak!”). For custom quality gates, some conditions might be ignored. For instance, the first condition on this custom quality gate will not be checked (the second is the one which be used instead):
Hope you will enjoy all this!