currently testing upgrading from 10.0 to 10.3, we are facing a blocking issue related to our usage of Default Quality Gate.
Currently, any newly created project will by default have the quality gate “CUSTOM Quality Gate” applied to it, as it is configured as the default Quality Gate.
With 10.3 and new Quality Gate rules for Clean As You Code criteria with zero new issues on new code, it is not possible anymore to configure a default quality gate not compliant with Clean As You Code! See screenshot below:
Turns out we cannot make the “CUSTOM Quality Gate” compliant, as our projects don’t have code coverage (yeah i know …)
So all our new projects won’t have by default our “CUSTOM Quality Gate” applied, and this will require extra configuration from admin.
It is an expected feature (regression?) of new version 10.3?
Hello SCM INVN Team,
How to make your custom quality gate Clean as You Code compliant without coverage:
- You can add a condition on the new code for coverage with any value of your choice including zero.
- Make sure that your custom quality gate satisfies all other conditions to be Clean as You Code-compliant.
- Now you should be able to set your custom quality gate as default.
- Only a Clean as You Code-compliant quality gate can be set as default. This change was introduced in SonarQube 9.9 LTS (not new in 10.3)
- A Clean as You Code-compliant quality gate can have any coverage target, including zero (condition should be present)
- Read more about Clean as You Code-compliant quality gate conditions here.
What changed in SonarQube 10.3?
A new Clean as You Code criteria of Zero new issues is introduced. However, this is optional. You may read about it here.
Thanks, i tried this and it seems to work, but i am concerned with the “0 issue” rule for new code.
I mean, even Minor Code Smell is considered an issue right?
SonarQube will now fail on PR even for such low criticity finding?
Edit: after checking in doc, seems it is possible to be less restrictive but still get a valid as a “Clean As You Code” Quality gate, ie. remove the “0 issue” constraint
All quality gates that comply with the Clean as You Code approach ensure that:
* No new issues are introduced
* Reliability Rating for new code is not worse than A
* Security Rating for new code is not worse than A
* Maintainability Rating for new code is not worse than A
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.