Pull Requests get a real Quality Gate status

sonarcloud

(Fabrice Bellingard) #1

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!


(Peter Connor) #2

Great addition! This was the missing piece from PR decoration. Status page looks really nice too :slight_smile:


(Fabrice Bellingard) pinned #3

(Roy Sela) #4

So if i’m using a custom quality gate with all of the rules pointing to the overall code metrics - then every PR will automatically pass the quality gate? I think it will be misleading, especially as i’m using Bitbucket Cloud the actual metrics are collapsed…


(Fabrice Bellingard) #5

That’s a very good feedback @Roy_Sela, this point needs to be clarified! I’ll create a ticket on our end.

Thanks!