Bitbucket Server Importer only shows 25 repositories

Summary

The Bitbucket Server Importer only appears to show 25 repositories on the import page. We expect some form of pagination, but the pagination appears broken. Interestingly, the response from import/bitbucket_server/status.json shows all 30 repositories in the response, but it is not displayed in the front end.

If you attempt to search for a repository that is missing by filtering, it will perform another query like status.json?filter=repository%207 and be able to filter for that repo. But if you clear the filter, the repo disappears again. This is demonstrated in the video below.

Steps to reproduce

  1. Create a Bitbucket Server instance. In this case, I've installed Bitbucket Server 8 and set up a basic trial.
  2. Create a single Project to house repositories.
  3. Create at least 25 repositories, in this case, I've created 30.
  4. In GitLab, go to create a New Project > Import Project > Bitbucket Server, and enter the credentials (In this case, I've used my primary Bitbucket admin user and access token)
  5. Once it is connected, notice how only 25 repositories are shown and some will be missing.

Example Project

What is the current bug behavior?

When you try to import projects from Bitbucket Server, only 25 are shown in the user interface.

What is the expected correct behavior?

We should paginate results to show all available repositories for importing.

Relevant logs and/or screenshots

status.json response below

{"imported_projects":[{"id":9,"name":"Repository 1","full_path":"/root/repository-1","full_name":"Administrator / Repository 1","refs_url":"/root/repository-1/refs","import_source":"http://18.204.231.249:7990/projects/PROJ/repos/repository-1/browse","import_status":"finished","human_import_status_name":"finished","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-1/browse"}],"provider_repos":[{"full_name":"Project 1/Repository 1","sanitized_name":"Repository 1","id":"PROJ/repository-1","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-1/browse"},{"full_name":"Project 1/Repository 10","sanitized_name":"Repository 10","id":"PROJ/repository-10","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-10/browse"},{"full_name":"Project 1/Repository 11","sanitized_name":"Repository 11","id":"PROJ/repository-11","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-11/browse"},{"full_name":"Project 1/Repository 12","sanitized_name":"Repository 12","id":"PROJ/repository-12","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-12/browse"},{"full_name":"Project 1/Repository 13","sanitized_name":"Repository 13","id":"PROJ/repository-13","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-13/browse"},{"full_name":"Project 1/Repository 14","sanitized_name":"Repository 14","id":"PROJ/repository-14","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-14/browse"},{"full_name":"Project 1/Repository 15","sanitized_name":"Repository 15","id":"PROJ/repository-15","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-15/browse"},{"full_name":"Project 1/Repository 16","sanitized_name":"Repository 16","id":"PROJ/repository-16","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-16/browse"},{"full_name":"Project 1/Repository 17","sanitized_name":"Repository 17","id":"PROJ/repository-17","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-17/browse"},{"full_name":"Project 1/Repository 18","sanitized_name":"Repository 18","id":"PROJ/repository-18","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-18/browse"},{"full_name":"Project 1/Repository 19","sanitized_name":"Repository 19","id":"PROJ/repository-19","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-19/browse"},{"full_name":"Project 1/Repository 2","sanitized_name":"Repository 2","id":"PROJ/repository-2","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-2/browse"},{"full_name":"Project 1/Repository 20","sanitized_name":"Repository 20","id":"PROJ/repository-20","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-20/browse"},{"full_name":"Project 1/Repository 21","sanitized_name":"Repository 21","id":"PROJ/repository-21","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-21/browse"},{"full_name":"Project 1/Repository 22","sanitized_name":"Repository 22","id":"PROJ/repository-22","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-22/browse"},{"full_name":"Project 1/Repository 23","sanitized_name":"Repository 23","id":"PROJ/repository-23","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-23/browse"},{"full_name":"Project 1/Repository 24","sanitized_name":"Repository 24","id":"PROJ/repository-24","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-24/browse"},{"full_name":"Project 1/Repository 25","sanitized_name":"Repository 25","id":"PROJ/repository-25","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-25/browse"},{"full_name":"Project 1/Repository 26","sanitized_name":"Repository 26","id":"PROJ/repository-26","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-26/browse"},{"full_name":"Project 1/Repository 27","sanitized_name":"Repository 27","id":"PROJ/repository-27","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-27/browse"},{"full_name":"Project 1/Repository 28","sanitized_name":"Repository 28","id":"PROJ/repository-28","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-28/browse"},{"full_name":"Project 1/Repository 29","sanitized_name":"Repository 29","id":"PROJ/repository-29","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-29/browse"},{"full_name":"Project 1/Repository 3","sanitized_name":"Repository 3","id":"PROJ/repository-3","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-3/browse"},{"full_name":"Project 1/Repository 30","sanitized_name":"Repository 30","id":"PROJ/repository-30","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-30/browse"},{"full_name":"Project 1/Repository 4","sanitized_name":"Repository 4","id":"PROJ/repository-4","provider_link":"http://18.204.231.249:7990/projects/PROJ/repos/repository-4/browse"}],"incompatible_repos":[]}

30 Repos on Bitbucket: image

Import screen on GitLab: image

Filtering for a missing repo: image

Video demonstrating issue:

demo-393100

Output of checks

This is happening in GitLab 15.9.0-ee.

Results of GitLab environment info

Expand for output related to GitLab environment info

System information
System:		Ubuntu 20.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.7.7p221
Gem Version:	3.1.6
Bundler Version:2.3.15
Rake Version:	13.0.6
Redis Version:	6.2.8
Sidekiq Version:6.5.7
Go Version:	unknown

GitLab information
Version:	15.9.0-ee
Revision:	b107c0bae08
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	13.8
URL:		https://sr-env-305341ba-omnibus.env-305341ba.gcp.gitlabsandbox.net
HTTP Clone URL:	https://sr-env-305341ba-omnibus.env-305341ba.gcp.gitlabsandbox.net/some-group/some-project.git
SSH Clone URL:	git@sr-env-305341ba-omnibus.env-305341ba.gcp.gitlabsandbox.net:some-group/some-project.git
Elasticsearch:	yes
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: bitbucket

GitLab Shell
Version:	14.17.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Cleveland Bledsoe Jr