Update bitbucket cloud importer to fetch workspace scoped repositories

What does this MR do and why?

This MR updates Bitbucket Cloud Importer client and adds an ability to fetch repositories across multiple workspaces user has access to. Instead of /repositories that returns repos across all workspaces we now use /repositories/<workspace> to fetch from each workspace and combine the results, to be presented on the importer status page (where user can select which repo to migrate).

Reason for replacement: bitbucket announced deprecation of this endpoint and it's going to be no longer available after ⚠️ Feb 27, 2026. So we don't have much wiggle room and will likely have to backport this change.

Since we fetch from individual workspaces and need to combine results into one, we have to track each workspace pagination state separately. For this reason, the statu.json endpoint workspace_page_infos that looks like this:

image

Behind bitbucket_cloud_importer_multi_workspace_repos feature flag.

References

#589153

Screenshots or screen recordings

Demo with page length 3 and workspace page length 1, to force fetch multiple pages of workspaces and workspace repos.

Before After

How to set up and validate locally

  1. Enable bitbucket_cloud_importer_multi_workspace_repos feature flag
  2. Setup bitbucket oauth locally https://docs.gitlab.com/user/import/bitbucket_cloud/#prerequisites
  3. Create a bunch of projects on bitbucket across multiple workspaces (get invited by others or use integrations account in 1p)
  4. Go to /import/bitbucket/status page and. observe repos getting fetched from multiple workspaces
  5. Disable bitbucket_cloud_importer_multi_workspace_repos feature flag
  6. Check the old behavior still works as expected
  7. Try other importers (e.g. github) status page, should still work as expected and these changes should not affect other importers.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports

Loading