doc/development/bitbucket_cloud_importer.md
You must be authenticated with Bitbucket:
The importer's codebase is broken up into the following directories:
lib/gitlab/bitbucket_import: this directory contains most of the code such as
the classes used for importing resources.app/workers/gitlab/bitbucket_import: this directory contains the Sidekiq
workers.When a Bitbucket Cloud project is imported, work is
divided into separate stages, with each stage consisting of a set of Sidekiq
jobs that are executed. Between every stage, a job is scheduled that periodically
checks if all work of the current stage is completed, advancing the import
process to the next stage when this is the case. The worker handling this is
called Gitlab::BitbucketImport::AdvanceStageWorker.
This worker imports the repository, wiki and labels, scheduling the next stage when done.
This worker imports members of the source Bitbucket Cloud workspace.
This worker imports all pull requests. For every pull request, a job for the
Gitlab::BitbucketImport::ImportPullRequestWorker worker is scheduled.
This worker imports notes (comments) for all merge requests.
For every merge request, a job for the Gitlab::BitbucketImport::ImportPullRequestNotesWorker worker is scheduled which imports all notes for the merge request.
This worker imports all issues. For every issue, a job for the
Gitlab::BitbucketImport::ImportIssueWorker worker is scheduled.
This worker imports notes (comments) for all issues.
For every issue, a job for the Gitlab::BitbucketImport::ImportIssueNotesWorker worker is scheduled which imports all notes for the issue.
This worker completes the import process by performing some housekeeping such as marking the import as completed.
In order to handle rate limiting, requests are wrapped with Bitbucket::ExponentialBackoff.
This wrapper catches rate limit errors and retries after a delay up to three times.
To set up Bitbucket authentication on GDK:
Follow the documentation up to step 9 to create Bitbucket OAuth credentials.
Add the credentials to config/gitlab.yml:
# config/gitlab.yml
development:
<<: *base
omniauth:
providers:
- { name: 'bitbucket',
app_id: '...',
app_secret: '...' }
Run gdk restart.
Sign in to your GDK, go to <gdk-url>/-/profile/account, and connect Bitbucket.