Coverage on modified code only

Hello,

We are using SonarCloud on our project and there are some few things that I don’t understand.
First, we connected our github repository to sonarcloud.
The way we work is that we have a main branch called “dev”, and we do create new branches (and new PR) whenever we want to do a fix or add a new feature, and when everything is good, we push the new branch into “dev”.

Our goal is to be able to push the new branch into the main one only and only if we reach a certain coverage percent. The coverage that we are looking forward to is just based on the new code that we added/modified. So only the coverage of the code diff that we see on github between the “dev” branch and the new branch, and not the coverage of all the repository. I thought that this is done just by using coverage on new code but apparently it’s not the case.

Can you guys explain for me please how can I do this?

NB: the new code is based on the previous version (I did not understand what is a version in my case).

Thank you in advance,
Mia

Hey there.

Maybe you can share some screenshots of what you are seeing in SonarCloud that doesn’t map to your expectations.