Stop importing issues from Bitbucket Cloud
What does this MR do and why?
Atlassian shut down the Bitbucket Cloud Issues API on 2026-08-20, so the importer has nothing left to import issues from. This MR stops it from trying.
- Pull request notes now hand off to the LFS objects stage. The chain is
repository,users,pull_requests,pull_requests_notes,lfs_objects,finish. - The four issue importers (
IssuesImporter,IssueImporter,IssuesNotesImporter,IssueNotesImporter) and their specs are deleted. Stage::ImportRepositoryWorkerno longer pre-allocates issue IIDs. Merge request IIDs are still pre-allocated.RepositoryImporterno longer creates thebug,enhancement,proposalandtasklabels. Only imported issues used them.RefConverterleaves Bitbucket issue links alone. Other links in the same note are still converted.
Local testing
I ran real imports against Bitbucket Cloud on my GDK, and they finished without import failures. The Bitbucket importer specs pass too.
Details
I used POST /import/bitbucket with a read-only API token (read:repository, read:pullrequest). The gem cleanup branch, which is a separate MR, was checked out on top of this one.
a-test-workspace-1/gkoltsov-repo-1has no pull requests. The repository was imported, with no issues, no default issue labels and no import failures.a-test-workspace-2/sometestrepohas one open pull request with four comments. The import created merge request!1with all four notes. Markdown and image markup came through unchanged. A comment that links tosrc/main/README.mdbecame a link to the blob in the imported project, and the{: data-inline-card='' }markup was dropped.
log/importer.log shows the stages running in the order above, with no issue stages and nothing about issues.
To check an import that was in flight during a deploy, I put a finished project back in started. Then I enqueued two jobs for the no-op per-issue workers with a real JobWaiter key, plus an AdvanceStageWorker job for :issues that waited on them. Both workers finished in about 0.02 seconds. The import then went issues, lfs_objects, finish in roughly five seconds, with no errors and without waiting for the advance stage timeout.
I couldn't test issue links on real data, because Bitbucket now answers 410 Gone for the Issues API. I also didn't test diff comments or LFS objects, since neither repository has any.
Notes for reviewers
I kept the four issue workers. An import that is in flight during the deploy can already have :issues or :issues_notes queued, and per-issue jobs can sit in Sidekiq. Removing worker classes takes three releases, so for now:
Stage::ImportIssuesWorkerandStage::ImportIssuesNotesWorkeronly enqueueAdvanceStageWorkerfor:lfs_objects, with no waiter. TheirSTAGESentries stay.ImportIssueWorkerandImportIssueNotesWorkeronly notify theJobWaiter. Without that, an in-flight import would wait out the 2-hour advance stage timeout and then fail.- The migration that removes queued jobs and the final class deletion are tracked in #634446 (closed) and #634447.
Other things worth knowing:
RefConverternow converts each Bitbucket link on its own and skips only issue links. A converted issue link would point at/-/issues/Nin a project with no imported issues, or at an unrelated issue with the same number. The path conversions apply to the link path instead of the whole note, so a project path likemy-src-projectis no longer rewritten.- The
Bitbucket::Clientissue methods andRepresentation::Issueingems/gitlab-bitbucketstay for now. They go in a separate MR after this one merges, because this MR is what stops calling them. The documentation changes are separate too. .labkit_logging_todo.ymlgets two entries forStage::ImportRepositoryWorker. The offenses are in the existinglog_iid_fetch_errorwarning. The LabKit check flagged them because this MR edits the file. Fixing them properly means renaming log fields for every Bitbucket stage worker.- The two no-op workers use
data_consistency :delayedinstead of:always. They don't read the database, and theSidekiqLoadBalancing/WorkerDataConsistencycop rejects:always.
References
- #601064 (closed)
- Parent epic: gitlab-org#22127
- Deprecation: #601061 (closed)
- Wiki import removal, already merged: !261295 (merged)
Screenshots or screen recordings
No UI changes.
How to set up and validate locally
-
Run the importer specs:
bin/rspec spec/lib/gitlab/bitbucket_import spec/workers/gitlab/bitbucket_import spec/workers/every_sidekiq_worker_spec.rb -
To check that an in-flight import still finishes, start a Bitbucket Cloud import in a GDK with Sidekiq running. Then run this in the Rails console for the importing project:
Gitlab::BitbucketImport::AdvanceStageWorker.perform_async(project.id, {}, :issues)The import moves to the LFS objects stage and then finishes.
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.