Commit 1f3b2ff0 authored by Nate Geslin's avatar Nate Geslin Committed by Heinrich Lee Yu

removes `export_designs` feature flags from ee files

closes #32535

* removes ee/project_tree_restorer and documentation line calling out incomplete support since they are no longer needed
* removes remove_feature_dependent_sub_relations method from project_tree_restorer
parent 13f10a0d
---
title: Removes `export_designs` feature flag
merge_request: 18507
author: nate geslin
type: other
......@@ -38,8 +38,6 @@ to be enabled:
- Files uploaded must have a file extension of either `png`, `jpg`, `jpeg`, `gif`, `bmp`, `tiff` or `ico`.
The [`svg` extension is not yet supported](https://gitlab.com/gitlab-org/gitlab/issues/12771).
- Design uploads are limited to 10 files at a time.
- Design Management is
[not yet supported in the project export](https://gitlab.com/gitlab-org/gitlab/issues/11090).
- Design Management data
[isn't deleted when a project is destroyed](https://gitlab.com/gitlab-org/gitlab/issues/13429) yet.
- Design Management data [won't be moved](https://gitlab.com/gitlab-org/gitlab/issues/13426)
......
......@@ -12,8 +12,6 @@ module EE::Projects::ImportExport::ExportService
end
def design_repo_saver
return unless Feature.enabled?(:export_designs, project, default_enabled: true)
Gitlab::ImportExport::DesignRepoSaver.new(project: project, shared: shared)
end
end
......@@ -12,8 +12,6 @@ module EE::Gitlab::ImportExport::Importer
end
def design_repo_restorer
return unless Feature.enabled?(:export_designs, project, default_enabled: true)
Gitlab::ImportExport::DesignRepoRestorer.new(
path_to_bundle: design_repo_path,
shared: shared,
......
# frozen_string_literal: true
module EE
module Gitlab
module ImportExport
module ProjectTreeRestorer
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
private
override :remove_feature_dependent_sub_relations!
def remove_feature_dependent_sub_relations!(relation_item)
export_designs_disabled = ::Feature.disabled?(:export_designs, project, default_enabled: true)
if relation_item.is_a?(Hash) && export_designs_disabled
relation_item.except!('designs', 'design_versions')
end
end
end
end
end
end
......@@ -17,7 +17,6 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
describe 'restoring design management data' do
context 'when the `export_designs` feature is enabled' do
before do
restored_project_json
end
......@@ -65,27 +64,4 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
end
end
context 'when the `export_designs` feature is disabled' do
before do
stub_feature_flags(export_designs: false)
restored_project_json
end
it_behaves_like 'restores project correctly', issues: 2
it 'does not restore any Designs' do
expect(DesignManagement::Design).not_to exist
end
it 'does not restore any Versions' do
expect(DesignManagement::Version.exists?).to be false
end
it 'does not restore any DesignVersions' do
expect(DesignManagement::Action.exists?).to be false
end
end
end
end
......@@ -29,17 +29,5 @@ describe Gitlab::ImportExport::Importer do
importer.execute
end
context 'when the `export_designs` feature is disabled' do
before do
stub_feature_flags(export_designs: false)
end
it 'does not restore the design repo' do
expect(Gitlab::ImportExport::DesignRepoRestorer).not_to receive(:new)
importer.execute
end
end
end
end
......@@ -15,17 +15,5 @@ describe Projects::ImportExport::ExportService do
service.execute
end
context 'when the `export_designs` feature is disabled' do
before do
stub_feature_flags(export_designs: false)
end
it 'does not save the design repo' do
expect(Gitlab::ImportExport::DesignRepoSaver).not_to receive(:new)
service.execute
end
end
end
end
......@@ -120,10 +120,6 @@ module Gitlab
end
end
def remove_feature_dependent_sub_relations!(_relation_item)
# no-op
end
def project_relations
@project_relations ||= reader.attributes_finder.find_relations_tree(:project)
end
......@@ -175,8 +171,6 @@ module Gitlab
# Avoid keeping a possible heavy object in memory once we are done with it
while relation_item = tree_array.shift
remove_feature_dependent_sub_relations!(relation_item)
# The transaction at this level is less speedy than one single transaction
# But we can't have it in the upper level or GC won't get rid of the AR objects
# after we save the batch.
......@@ -241,5 +235,3 @@ module Gitlab
end
end
end
Gitlab::ImportExport::ProjectTreeRestorer.prepend_if_ee('::EE::Gitlab::ImportExport::ProjectTreeRestorer')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment