Pagination of Bitbucket Server Importer ignores first 25 repositories

Summary

The Bitbucket Server Importer ignores the first 25 repositories cause they aren't even requested from the Bitbucket Server.

Steps to reproduce

  1. Navigate to the creation of a new repository, import from Bitbucket Server
  2. enter your credentials and server url
  3. Click on 'List your Bitbucket Server repositories'
  4. only the 26.-n. repositories are shown (probably alphabetically ordered)

What is the current bug behavior?

The importer asks the Bitbucket server only from the 26. repo upwards. A webserver-access log to the bitbucket-server from GitLab:

<IPADDRESS> - <USERNAME> [06/Oct/2020:01:29:25 +0200] "GET /rest/api/1.0/repos?start=25&limit=25 HTTP/1.1" 200 6379 "-" "-"
<IPADDRESS> - <USERNAME> [06/Oct/2020:01:29:26 +0200] "GET /rest/api/1.0/repos?start=50&limit=25 HTTP/1.1" 200 73 "-" "-"

As seen above, a request with GET-Parameter start=0 isn't made, so the first 25 repos are ignored by GitLab. If I add dummy repos with a low alphanumeric value (e.g. a0 ... a24), they are count as the first 25 repos and all my real repos are showing up in the importer. This was probably introduced with code belongs to gitlab-foss!22825 (merged), but I'm not sure at that.

What is the expected correct behavior?

Also the first 25 repos should be imported, so a additional request with start=0 has to be made.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:         Debian 10
Current User:   git
Using RVM:      no
Ruby Version:   2.6.6p146
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  5.0.9
Git Version:    2.28.0
Sidekiq Version:5.2.9
Go Version:     unknown

GitLab information
Version:        13.4.2
Revision:       b08b36dccc3
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     11.9
URL:            https://git.alex-detsch.de
HTTP Clone URL: https://git.alex-detsch.de/some-group/some-project.git
SSH Clone URL:  git@git.alex-detsch.de:some-group/some-project.git
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        13.7.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.7.0 ? ... OK (13.7.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... Checking yes Init.d configured correctly? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 6/3 ... yes 7/4 ... yes 5/6 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.24.0 ? ... yes (2.28.0) Git user has default SSH configuration? ... yes Active users: ... 2 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by Alexander Detsch