diff options
Diffstat (limited to 'lib/bulk_imports/groups/stage.rb')
-rw-r--r-- | lib/bulk_imports/groups/stage.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/bulk_imports/groups/stage.rb b/lib/bulk_imports/groups/stage.rb index bc27220391d..97a423b6ea9 100644 --- a/lib/bulk_imports/groups/stage.rb +++ b/lib/bulk_imports/groups/stage.rb @@ -47,7 +47,7 @@ module BulkImports end def project_entities_pipeline - if project_pipeline_available? && ::Feature.enabled?(:bulk_import_projects, default_enabled: :yaml) + if project_pipeline_available? && feature_flag_enabled? { project_entities: { pipeline: BulkImports::Groups::Pipelines::ProjectEntitiesPipeline, @@ -62,6 +62,18 @@ module BulkImports def project_pipeline_available? @bulk_import.source_version_info >= BulkImport.min_gl_version_for_project_migration end + + def feature_flag_enabled? + destination_namespace = @bulk_import_entity.destination_namespace + + if destination_namespace.present? + root_ancestor = Namespace.find_by_full_path(destination_namespace)&.root_ancestor + + ::Feature.enabled?(:bulk_import_projects, root_ancestor, default_enabled: :yaml) + else + ::Feature.enabled?(:bulk_import_projects, default_enabled: :yaml) + end + end end end end |