Create new project from Bitbucket Server shows only to letter D

I’ve run into this problem as well. By watching the network tab in my browser, I can confirm that the search api call works to bring back the repository I was searching for which is found in a project that is dramatically deeper in the list than 25. However, the UI only displays repos grouped by the projects already downloaded.

From the network it appears that the following occurs when the browser loads /projects/create?mode=bitbucket:

  1. Call list_bitbucketserver_projects on bitbucket server which returns first 25 projects
  2. Iterate over the list of projects returned calling search_bitbucketserver_repos for each proejct to show the repos within each

When I search for my repo in the search box, I can see the network call that returns all of the repos that match. However, the UI only displays the repos found in the first 25 projects retrieved in step 1 above when the screen first loaded. To me, it appears there are three options:

  1. Change the code behavior to search for projects instead of repos and display all repos for a given project
  2. Iterate the results of the search and retrieve the project name for each for grouping
  3. Display the repos without grouping by project

Hope that helps with debugging

Hi, Is there a solution to this? I am facing the same problem in my case.

Hi, this has been fixed in SonarQube 8.5 :slight_smile:

Hi, I am using version Version 8.5 (build 37579) of SonarQube but still have this issue, I also tried Version 8.5.1 (build 38104). I can see in the network activity that only 25 projects are fetched and displayed.

Is there any possible workaround for this?

Hi, fetching 25 projects is the expected behaviour. If you are looking for one that is not on the list, use the search directly (search for your repository). Does the project & repository show up that way? (Side note: the search is a start with)

Yes, I did use the search. I look at the request from network tab:

http://localhost:9000/api/alm_integrations/search_bitbucketserver_repos?almSetting=bitbucket&repositoryName=

This returns 4 results, but I can see only 2 results in UI which are part of one of the displayed 25 projects.

I think the issue is, if the returned results is contains a repository which is part of the 25 projects then only those are showed. If the returned results are not contained in the 25 projects, then it is displayed correctly.

I also found a simple workaround who has a similar problem

curl ‘http://localhost:9000/api/alm_integrations/import_bitbucketserver_project’
-H ‘Connection: keep-alive’
-H ‘Accept: application/json’
-H ‘X-XSRF-TOKEN: take-token-from-network-tab
-H ‘User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36’
-H ‘Content-Type: application/x-www-form-urlencoded’
-H ‘Origin: http://localhost:9000
-H ‘Sec-Fetch-Site: same-origin’
-H ‘Sec-Fetch-Mode: cors’
-H ‘Sec-Fetch-Dest: empty’
-H ‘Referer: http://localhost:9000/projects/create?mode=bitbucket
-H ‘Accept-Language: en-GB,en-US;q=0.9,en;q=0.8’
-H ‘Cookie: XSRF-TOKEN=367n5dg4rtc6tmnou0ll35tkna; JWT-SESSION=
–data-raw ‘almSetting=bitbucket&projectKey=project-name&repositorySlug=repository-name
–compressed

Hi, that match 100% the description of SONAR-13900 fixed in SQ 8.5. Which SonarQube version are you using exactly? (It’s visible in the footer)

I am using following version currently, but also tried 8.5.1

Hi @canmrt,

Indeed, this is a bug. I’ve opened a ticket. We will try and fix this for 8.6.

Cheers.

1 Like