Community Edition does not retrieve/display all Bitbucket repositories for Create Project page

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Community edition 9.5.0
  • what are you trying to achieve
    Big picture goal: I want the full commercial version, but have to prove SQ’s worth first before the purchase will be approved.

For this issue, I have Bitbucket all configured, and successfully scanning. However, from the Bitbucket repository, it is only pulling back 25 of my ~100 repositories when I try to create a new project in SonarQube.

It appears to have pulled them by alphabetical order, and some of our more important projects that have to be scanned to show SQ’s worth are towards the end of the alphabet.

On the “Create Project” page, it states “We’re only displaying the first 25 repositories. If you’re looking for a repository that’s not in this list, use the search above.” However, when I search for my other repos not listed, they do not show up.

  • what have you tried so far to achieve this
    I have reviewed the Bitbucket project and repository permissions, and all looks good for the user in question. I’ve tried restarting the SQ instance, but given it successfully works with other projects, I’m not sure where to begin.

I’ve looked if Community has any limitations on the number of repos it will pull from the CI source, but so far I see no limitations in this area. I’ve also looked through the Sonar Community forums and I do not see anything similar to this issue.

I have tried several browsers thinking it was a display issue, but no luck there either (grasping at straws, I know).

Any other ideas why all of my Bitbucket repositories are not visible when trying to create a new project?

Thanks.

2 Likes

On a related note, I have used the Bitbucket API to retrieve all of the projects, and they all come back as expected. My thoughts were that maybe Bitbucket had some “paging” related limitations that were not compatible with SonarQube, but that does not seem to be the case.

1 Like

Hello @SeanCharles ,

Welcome to the community.

I tried to reproduce the issue on a fresh instance of BitBucket Server v7.21.0 and latest SQ version, but I didn’t get the same problem as you have. I’m not sure what API you have used to test, but could you try to execute the following requests, so that we could check if that is SQ issue or if something is wrong with BitBucket configuration?

SonarQube request:

curl -XGET -u "<SQ_TOKEN>:" "<SQ_URL>/api/alm_integrations/search_bitbucketserver_repos?almSetting=<YOUR_ALM_SETTINGS_NAME>&repositoryName=<YOUR_REPOSITORY_NAME>"

BitBucket Server request:

curl -XGET -u "<USER_NAME>:<TOKEN>" "<BITBUCKET_URL>/rest/api/1.0/repos?projectname=&name=Z"