Extract Bitbucket client into gitlab-bitbucket gem
What does this MR do?
Extracts the Bitbucket:: namespace (lib/bitbucket, the Bitbucket Cloud REST API client) and the OmniAuth Bitbucket strategy into a new standalone gem at gems/gitlab-bitbucket. Constant names are unchanged; only the file location moves, so the Gitlab::BitbucketImport importer keeps referencing Bitbucket::Client etc. as before. No EE overrides (EE only extends the importer, a consumer).
All Rails/monolith couplings are removed so the gem is Rails-free:
- a required injected
http_client:keyword argument onBitbucket::Client(mirroringrefresh_strategy:). The monolith passesImport::Clients::HTTP, which already applies the response parser (Gitlab::HttpResponseParser), the SSRF settings and the default response-size limit. The gem no longer referencesGitlab::HTTP_V2nor depends ongitlab-http. - an injected
logger:defaulting to a null logger (fixes a would-beNoMethodErroron the controller retry path) - injected OAuth credentials (
app_id:/app_secret:/oauth_options:)
The importer injects these at the client-construction sites and keeps DI config out of the persisted import_data.credentials.
Repository visibility mapping stays in the monolith: the gem exposes a Rails-free Bitbucket::Representation::Repo#private? predicate, and Gitlab::BitbucketImport::ProjectCreator maps it to Gitlab::VisibilityLevel::PRIVATE / PUBLIC — the gem carries no GitLab visibility constants.
Gem
gems/gitlab-bitbucket— runtime deps:activesupport,httparty,oauth2,omniauth-oauth2,rack- Defines
Bitbucket::VERSION; the gemspec loads only the dependency-freeversion.rb - Wired into the root
Gemfilewithrequire: 'bitbucket' - Gem specs: 205 examples, 0 failures (Rails-free), incl. an OmniAuth strategy smoke test
httpartyis the only remaining HTTP coupling (the gem rescuesHTTParty::ResponseErrorfor retry classification). Follow-up to remove it now that the client is injected: #604233
Relationship to BitbucketServer
Independent — the two namespaces share zero code and diverge in pagination/auth. Extracted as a separate gem (see the sibling MR for gitlab-bitbucket-server).
Implements #603745 (closed)