Managing custom quality gates
You can create your own, custom quality gates in SonarQube Cloud. To manage custom quality gates, you must have the Administer Quality Gates permission.
Two built-in quality gates are provided in your organization but you can create your own quality gates, called custom quality gates. To manage custom quality gates, you need the Administer Quality Gates permission. With this permission, you can also associate projects to quality gates in your organization.
For more information about quality gates, read the Understanding quality gates page.
To associate a custom quality gate with projects, check out the Associating a quality gate with projects page.
Creating a custom quality gate
You can create a custom quality gate from scratch or by duplication. When you create a custom quality gate from scratch, the conditions of the built-in quality gate Sonar way are automatically copied to the new record to make your custom quality gate ready for Clean as You Code.
Managing a custom quality gate’s conditions
You can add or remove conditions. You can update the value of an existing condition. Remember that you define failing conditions: if one of the conditions is met, the quality gate fails. For more information about conditions, see the article about Quality gate definition based on conditions.
To update a condition:
Select the pen icon in the far right of the condition row. If there is no pen icon, select first the Unlock editing button, below the Conditions section. The Update Condition dialog opens.
Enter the new condition’s value and select Update Condition.
To add a new condition:
Select Add Condition. The Add Condition dialog opens.
In Where? select to which code, new or overall, the condition applies. New code is defined through the New Code Defintion (NCD). See theQuality standards and new code page for more information.
In Quality Gate fails when, select the metric to which the condition applies. For information about the metrics, see the Understanding measures and metrics page.
In Value, enter the condition’s value.
To remove a condition:
Select the dustbin icon in the far right of the condition row. The Delete Condition dialog opens.
Select Delete.
Upgrading a quality gate for CaYC
We recommend configuring all your quality gates to prevent issues in new code. For more information, see the Quality gate and new code article.
If your quality gate is not configured for CaYC, you can easily upgrade it as follows:
See Retrieving your organizations to access your organization.
In organization’s navigation bar, select Quality Gates.
In the left panel, select the custom quality gate you want to upgrade.
In You are a few conditions away from Clean as You Code, select Review and Update. The Update Quality Gate dialog opens.
Review the proposed update and select Update Quality Gate to execute the update.
Renaming a custom quality gate
See Retrieving your organizations to access your organization.
In organization’s navigation bar, select Quality Gates.
In the left panel, select the custom quality gate you want to rename.
In the top right corner of your quality gate, select the More Actions button and then Rename. The Rename Quality Gate dialog opens.
Enter the new name and select Rename.
Deleting a custom quality gate
See Retrieving your organizations to access your organization.
In organization’s navigation bar, select Quality Gates.
In the left panel, select the custom quality gate you want to delete.
In the top right corner of your quality gate, select the More Actions button and then Delete.
Confirm the deletion.
Related pages
Last updated
Was this helpful?