Skip to main content

Configure quality gates

Learn how to use the CI/CD Manager API to configure your quality gates.

All sample requests in this guide include the following path parameters:

Parameter nameDescription
tenantIdTenant ID.
starSystemIdID of the logical star system that includes the InsuranceSuite application for which you configure quality gates.
applicationIdInsuranceSuite application which includes the build. For example:
- PC for PolicyCenter
- BC for BillingCenter
- CC for ClaimCenter
- CM for ContactManager
qualityGateIDID of a quality gate.

Create a quality gate

To create a new quality gate, send the following POST request:

curl -X 'POST' \
{baseUrl}/api/v3/tenants/{tenantId}/starsystems/{starSystemId}/applications/{applicationId}/quality-gates
-H 'accept: application/json' \
-H 'Authorization: Bearer {access_token}'
-d '{body}'

Where {body} is a JSON object that represents a quality gate:

Example request body
{
"name": "Custom Smoke Test",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "FUNCTIONAL",
"method": "UI",
"level": "UNIT",
"type": ["SMOKE"]
},
"description": "This Quality Gate verifies that an additional custom smoke test suite was run."
}

A response body contains a JSON object representing the newly created quality gate:

Example response body
{
"id": "custom_smoke_test",
"name": "Custom Smoke Test",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "FUNCTIONAL",
"method": "UI",
"level": "UNIT",
"type": ["SMOKE"]
},
"description": "This Quality Gate verifies that an additional custom smoke test suite was run.",
"branchFilter": null
}

Get a list of all the quality gates configured for a given stage

To list the already existing quality gates for a given stage, send the following GET request:

curl -X 'GET' \
{baseUrl}/api/v3/tenants/{tenantId}/starsystems/{starSystemId}/applications/{applicationId}/quality-gates?stage={STAGE}
-H 'accept: application/json' \
-H 'Authorization: Bearer {access_token}'

Where STAGE represents the stage of the quality gates that you want to list. Currently, these are the supported quality gate stages:

  • PRE_MERGE
  • PRE_PROMOTION_PREPROD
  • PRE_PROMOTION_PROD

A response body contains a JSON object with a list of all the existing quality gates. For example, a request to list all the PRE_MERGE quality gates might get the following response:

Example response body
[
{
"id": "custom_smoke_test",
"name": "Custom Smoke Test",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "FUNCTIONAL",
"method": "UI",
"level": "UNIT",
"type": ["SMOKE"]
},
"description": "This Quality Gate verifies that an additional custom smoke test suite was run.",
"branchFilter": null
},
{
"id": "bc_static_check",
"name": "BC Static Check",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "NON_FUNCTIONAL",
"method": "STATIC_ANALYSIS",
"level": "UNIT",
"type": ["STATIC"]
},
"description": "This Quality Gate verifies that an additional static analysis check was run before merging any changes.",
"branchFilter": null
}
]

Update a quality gate

To update a quality gate, send the following PUT request:

curl -X 'PUT' \
{baseUrl}/api/v3/tenants/{tenantId}/starsystems/{starSystemId}/applications/{applicationId}/quality-gates/{qualityGateId}
-H 'accept: application/json' \
-H 'Authorization: Bearer {access_token}'
-d '{body}'

Where {body} is a JSON object that represents an updated quality gate:

Example request body
{
"name": "Custom Smoke Test",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "FUNCTIONAL",
"method": "UI",
"level": "UNIT",
"type": ["SMOKE"]
},
"id": "custom_smoke_test",
"description": "This Quality Gate verifies that an additional custom smoke test suite was run before merging to master.",
"branchFilter": {
"filter": "refs/heads/master",
"type": "BRANCH_NAME"
}
}

A response body contains a JSON object representing the updated quality gate:

Example response body
{
"id": "custom_smoke_test",
"name": "Custom Smoke Test",
"stage": "PRE_MERGE",
"required": true,
"testMetadata": {
"category": "FUNCTIONAL",
"method": "UI",
"level": "UNIT",
"type": ["SMOKE"]
},
"description": "This Quality Gate verifies that an additional custom smoke test suite was run before merging to master.",
"branchFilter": {
"filter": "refs/heads/master",
"type": "BRANCH_NAME"
}
}

Delete a quality gate

To delete a quality gate that you no longer need, send the following DELETE request without any request body:

curl -X 'DELETE' \
{baseUrl}/api/v3/tenants/{tenantId}/starsystems/{starSystemId}/applications/{applicationId}/quality-gates/{qualityGateId}
-H 'Authorization: Bearer {access_token}'

You'll receive a response with HTTP code 204 and without any response body.