Create new project from Bitbucket Server shows only to letter D

Hi!

When Creating new project and selecting “From a Bitbucket Server repository” I only get Project results until the letter D. I need to be able to search for all results. Is this a bug or is it possible to configure how many results are fetched from Bitbucket?

I am using Sonarqube Developer Edition Version 8.2 and Bitbucket Server v7.1.1

Br,
Imre

Ok I guess Sonarqube uses this API to get list of projects:
/rest/api/latest/projects?name&permission

This is a paged API and returns by default only 25 items. In our case exactly to the projects starting with D. If you add limit parameter to the query then the number of items can be modified. For example /api/latest/projects?name&permission&limit=1000 returns all projects.

Is it possible to change API query that Sonarqube uses to include the limit parameter?

Br,
Imre

Hi, Welcome to the community!

I understand your concern, and at the same time, it does not seems reasonable to display 1000 projects at a time: how would you find the one you are looking for in the list anyway?

Have you tried to use the search box? Any feedback on that ?

Hi!

The search box searches from the same data returned by the API query so as a result its not possible to add repository that is not inclued in first 25 projects. In our case we have 136 projects in Bitbucket. By default the project repo list is not expanded so it would be ok to return ~200 projects but the problem is not displaying the projects/repos but rather its not possible to add them at all.

The api query for 136 projects is lightning fast so there are no performance problems also that should limit the number of returned projects.

Br,
Imre

This is surprising, and it should not be the case. The search query is totally independent from the list query, and allow you to search along all your repositories. For example, what happen if you type the exact name of your repository in the search box ?

Hmm that is indeed strange then. No luck when searching by exact repo name or Project/Repo.

Br,
Imre

If i remember correctly, the BibucketServer API we use for search support only the “start with” pattern. Maybe this is something worth mentioning in the search box in SonarQube.

Sorry can you elaborate how to use this “start with”?

Br,
Imre

If your repository is named, lets say abc def ghi, the search will match only if you enter a, ab, abc d and so on. The search won’t find your project if you type def, or start anywhere after the first character of the name of the repo.

Ah ok, you are correct that search only finds repository if you start typing from beginning but in this case its not the problem. The search bar only finds those repositories that are in the first 25 projects that are displayed on the page. This is regardless how I have input the repository name. If you say that search should be independent from the project display and return results for all repositories in Bitbucket then I guess this can be classified as a bug.

Br,
Imre

This is indeed a bug, I have the same issue

p.s. Something weird is going on. In the web.log file I see that ALL the repos are listed. Something in the UI is filtering them

Also hitting this issue. It’s only showing the top 25 projects. Within one of the first 25 projects, I can search for repositories even if the project contains more than 25 repositories, but I can find nothing past the first 25 projects.

Same issue here. Did someone manage to get the resolution for it ?

Hi, let me try to clarify:

  • without searching, we return max 25 repository for every BBS Project
  • while searching, we return max 25 repository, all projects mixed

Does that clarify? This is the expected behaviour.

Hi!

But the actual behaviour is that even while searching it will display results only from the first 25 repositories. I have in total about 300 repos in BB but I can search only from the first 25 but all the others cannot be found at all regardless of what I write in the search.

Br,
Imre

I’m having a hard time to understand this, do you mean amongst the 25 repositories that you saw without the search?

What happens if you type the exact name of one of the projects you can’t find?

If the repository is not in the list of first 25 repositories of the entire BB instance then this repository is not found when searching.

I’m sorry, I’m not able to reproduce this issue. Under the hood, SonarQube is querying this BitBucketServer endpoint:

https://yourinstance.com/rest/api/1.0/repos?projectname=&name=xxxx

Could you please open this in your browser, replace xxxx with your project name, and see if you get any result?

Sorry, it was my mistake, its not 25 repos. What I mean is that SQ is able to fetch only data from first 25 projects from Bitbucket and when you want to search for a specific repository you only get results from the first 25 projects. If the repo is under lets say the 50th project in BB then it cannot be found

Hi, still, it would be valuable to do the test i indicated in my previous message.