Main Branch Quality Gate Is For New Code Only and Not Overall

Hello All,

My main branch is analyzed but the quality gate seems to be based off of new code changes. The new code merged into main has 100% coverage but when I look at the overall coverage inside of main it is only about 60%. The quality gate still passed because for some reason it is only taking into account the newly added code. I thought the main branch quality gate should have failed due to overall being less than 80%.

Did I set something up wrong?

Any help is greatly appreciated!

Hey there.

Have you configured your Quality Gate to consider Overall Code? By default, the Quality Gate only focuses on New Code in line with our Clean as You Code philosophy.

Hi Colin,

Thanks for the reply! I am not sure how to do that. When setting up a new code definition it is set to analyze new code.

I could misunderstand the way SC works but I thought the main branch was automatically configured to analyze over all code. In the docs:

For the main branch:

  • Both the conditions defined on overall code and conditions defined on new code are applied.

It did work in the way that I thought I understood it in a previous project. But for some reason this one, the new code passed the quality gate, as did the overall. But overall it was only 60% coverage which is why I was confused.

This is true… but by default, there are no conditions on Overall Code defined in the built-in Quality Gate.