Skip to content

Introduce parallelised BitBucket Server Importer

Rodrigo Tomonari requested to merge 411534-bitbucket_server_parallel_import into master

What does this MR do and why?

Introduce parallelised BitBucket Server Importer

Update BitBucket Server to import projects using multiple workers similar to GitHub Importer

Screenshots or screen recordings

https://drive.google.com/file/d/1Mq2L9ybTNoIe8LWyB1iOrczSJ36yU3kA/view?usp=share_link

How to set up and validate locally

  1. Set up a local Bitbucket Server instance docs.

  2. Create a repo, and a PR with comments in Bitbucket

  3. Temporarily patch UrlBlocker to allow all localhost requests:

    diff --git a/lib/gitlab/url_blocker.rb b/lib/gitlab/url_blocker.rb
    index e7aab4fae79a..75502d937b63 100644
    --- a/lib/gitlab/url_blocker.rb
    +++ b/lib/gitlab/url_blocker.rb
    @@ -37,6 +37,9 @@ def validate!(
             dns_rebind_protection: true)
             # rubocop:enable Metrics/ParameterLists
    
    +        allow_localhost = true
    +        allow_local_network = true
    +
             return [nil, nil] if url.nil?
    
             raise ArgumentError, 'The schemes is a required argument' if schemes.blank?

    Or enable local requests in http://gdk.test:3000/admin/application_settings/network by adding

    Screenshot_2023-05-18_at_17.11.43

  4. Import a new project /projects/new#import_project

  5. Choose Bitbucket Server

  6. Enter your server details, and click List your Bitbucket Server repositories

  7. Next to one of your BitBucket repositories, click Import

  8. You can tail -f log/importer.log to watch the import progress

  9. The import should finish and you should have a new project imported with a repo, MR, and comments on the MR

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #411534 (closed)

Edited by Rodrigo Tomonari

Merge request reports