Is there a way to get all of the Bitbucket projects and repositories that are using the app Include Quality for Bitbucket as checking manually is not possible via REST API or the Database?
Using REST API
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
Calling the app’s REST endpoint for each repository by https://{YOUR_BITBUCKET_SERVER}/rest/sonar4stash/1.0/projects/{projectKey}/repos/{repositorySlug}/settings
and checking for the property sonarEnabled
in the response:
{ project": { "sonarEnabled": true, ... } }
Using Database
The tables of our app start with AO_C716BC_
. Here is the query with project key/name and repository name included.
SELECT PROJECT_KEY, PROJECT.NAME, REPO_ID, SLUG, REPOSITORY.NAME, SONAR_ENABLED FROM AO_C716BC_REPO_CONFIG001 JOIN REPOSITORY on REPOSITORY.ID = REPO_ID JOIN PROJECT on PROJECT.ID = PROJECT_ID
This query will work in all app versions, but it does not show the configured SonarQube server.