Include Code Quality for Bitbucket

Is there a way to get all of the Bitbucket projects and repositories that are using the app Include Quality for Bitbucket?

Using REST API

  1. You can check which repositories are using the app actively by iterating over all your repositories in Bitbucket with GET /rest/api/latest/repos: https://developer.atlassian.com/server/bitbucket/rest/v804/api-group-repository/#api-api-latest-repos-get

  2. Calling the app’s REST endpoint for each repository by

and checking for the property sonarEnabled in the response:

{
  project": {
    "sonarEnabled": true,
    ...
  }
}

 

Using Database

The table of the repo’s Sonar configuration is called AO_C716BC_REPO_CONFIG001 .

Query for the entries where Sonar is enabled:

select * from "AO_C716BC_REPO_CONFIG001"
where "SONAR_ENABLED" = TRUE

To get the repository with enabled Sonar configuration:

select  PROJ.PROJECT_KEY, REPO.SLUG, * from "AO_C716BC_REPO_CONFIG001" as SONAR
join "repository" as REPO on REPO.ID = SONAR."REPO_ID"
join "project" as PROJ on PROJ.ID = REPO.PROJECT_ID
where "SONAR_ENABLED" = TRUE