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: ...@@ -38,8 +38,6 @@ to be enabled:
- Files uploaded must have a file extension of either `png`, `jpg`, `jpeg`, `gif`, `bmp`, `tiff` or `ico`. - 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). 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 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 - Design Management data
[isn't deleted when a project is destroyed](https://gitlab.com/gitlab-org/gitlab/issues/13429) yet. [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) - Design Management data [won't be moved](https://gitlab.com/gitlab-org/gitlab/issues/13426)
......
...@@ -12,8 +12,6 @@ module EE::Projects::ImportExport::ExportService ...@@ -12,8 +12,6 @@ module EE::Projects::ImportExport::ExportService
end end
def design_repo_saver def design_repo_saver
return unless Feature.enabled?(:export_designs, project, default_enabled: true)
Gitlab::ImportExport::DesignRepoSaver.new(project: project, shared: shared) Gitlab::ImportExport::DesignRepoSaver.new(project: project, shared: shared)
end end
end end
...@@ -12,8 +12,6 @@ module EE::Gitlab::ImportExport::Importer ...@@ -12,8 +12,6 @@ module EE::Gitlab::ImportExport::Importer
end end
def design_repo_restorer def design_repo_restorer
return unless Feature.enabled?(:export_designs, project, default_enabled: true)
Gitlab::ImportExport::DesignRepoRestorer.new( Gitlab::ImportExport::DesignRepoRestorer.new(
path_to_bundle: design_repo_path, path_to_bundle: design_repo_path,
shared: shared, 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 ...@@ -17,7 +17,6 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end end
describe 'restoring design management data' do describe 'restoring design management data' do
context 'when the `export_designs` feature is enabled' do
before do before do
restored_project_json restored_project_json
end end
...@@ -65,27 +64,4 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -65,27 +64,4 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end end
end 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 end
...@@ -29,17 +29,5 @@ describe Gitlab::ImportExport::Importer do ...@@ -29,17 +29,5 @@ describe Gitlab::ImportExport::Importer do
importer.execute importer.execute
end 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
end end
...@@ -15,17 +15,5 @@ describe Projects::ImportExport::ExportService do ...@@ -15,17 +15,5 @@ describe Projects::ImportExport::ExportService do
service.execute service.execute
end 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
end end
...@@ -120,10 +120,6 @@ module Gitlab ...@@ -120,10 +120,6 @@ module Gitlab
end end
end end
def remove_feature_dependent_sub_relations!(_relation_item)
# no-op
end
def project_relations def project_relations
@project_relations ||= reader.attributes_finder.find_relations_tree(:project) @project_relations ||= reader.attributes_finder.find_relations_tree(:project)
end end
...@@ -175,8 +171,6 @@ module Gitlab ...@@ -175,8 +171,6 @@ module Gitlab
# Avoid keeping a possible heavy object in memory once we are done with it # Avoid keeping a possible heavy object in memory once we are done with it
while relation_item = tree_array.shift 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 # 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 # 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. # after we save the batch.
...@@ -241,5 +235,3 @@ module Gitlab ...@@ -241,5 +235,3 @@ module Gitlab
end end
end 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