We have several hundred projects and would like to view the ones that do not yet have a Quality Gate computed yet so we can try to rectify that. The search filters for projects only have a Passed and a Failed for Quality Gate. Are either of those appropriate to start filtering to find the projects we need to target?
Hi @StingyJack
Unfortunately, project with a “not computed” quality gate are not included in the Quality Gate status filter, neither OK nor Failed. SonarCloud does not offer (yet? you can suggest a feature if you want) an easy way to list such projects.
As a workaround, you can write a script that combines the api/components/search
API (doc) to list the projects inside a given organization, and the api/measures/component
API (doc) with parameter metricsKeys=alert_status
, to get the quality gate status of each project. “Not computed” is not a status, the quality gate really hasn’t been computed, so it’s empty.
Here is an example of result for a project without Quality Gate (measures
is an empty array):
{
"component":{
"id":"the-id",
"key":"component-key",
"name":"project-name",
"qualifier":"TRK",
"measures":[
]
}
}
HTH,
Claire
Cant this just be converted into a feature request?
The Web API is apparently only available to administrators. Due to a lack of auditing on one specific area, this admin access was revoked for all but a select few, so I cant use the API at the moment.