Add request_channel to file-based and Git-URL importers
What
Follow-up to #627877 (closed). That task wires request_channel (API/UI/Congregate)
through:
- Direct Transfer / Offline Transfer (
BulkImport+BulkImports::Entity), viaImport::BulkImports::EphemeralData. - Standard project importers that inherit
Import::BaseService: GitHub, Bitbucket, Bitbucket Server, Gitea, Fogbugz.
What this task covers
The remaining standard importers that do not inherit Import::BaseService
and so are not picked up by that MR:
- File-based project import (
gitlab_project) —Projects::GitlabProjectsImportService,app/controllers/import/gitlab_projects_controller.rb,lib/api/project_import.rb - Manifest import —
Import::Manifest::ProjectCreator,app/controllers/import/manifest_controller.rb - Git repository by URL —
app/controllers/import/url_controller.rb - File-based group import (
gitlab_group_export) —Groups::ImportExport::ImportService,app/controllers/groups/import_export_controller.rb,lib/api/group_import.rb
The plumbing is already in place from #627877 (closed):
ProjectImportState#request_channel=/#request_channel(Redis-backed viaGitlab::Cache::Import::Caching)GroupImportState#request_channel=/#request_channel(same)ProjectImportState#track_project_import_eventandGroupImportState#track_group_import_eventalready readrequest_channeland include it inadditional_properties.compact- Event YAMLs already declare
request_channel Gitlab::Import::RequestChannel.detect(request)helper (returns:api/:congregate; controllers pass:uiexplicitly)
What each importer needs
For each entry point:
- Detect the channel at the boundary (controller passes
:ui; API endpoint callsGitlab::Import::RequestChannel.detect(request)). - Thread the channel into the create service.
- Set
project.import_state.request_channel = channel(orgroup.import_state.request_channel = channel) after the record is created and before the import worker enqueues.
References
- Parent: #617884
- Sibling MRs already merged: !253895 (merged), !253927 (merged), !254680 (merged), !255888 (merged), !256405 (merged)
- Direct Transfer / Offline Transfer + BaseService importers landed in #627877 (closed)