Commit c44316d1 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'remove-feature-flag-import-graceful-failures' into 'master'

Remove feature flag for import graceful failures

See merge request gitlab-org/gitlab!22707
parents f40c4c06 c8f72cc5
---
title: Remove feature flag for import graceful failures
merge_request:
author:
type: other
...@@ -75,9 +75,6 @@ module Gitlab ...@@ -75,9 +75,6 @@ module Gitlab
save_id_mapping(relation_key, data_hash, relation_object) save_id_mapping(relation_key, data_hash, relation_object)
rescue => e rescue => e
# re-raise if not enabled
raise e unless Feature.enabled?(:import_graceful_failures, @importable.group, default_enabled: true)
log_import_failure(relation_key, relation_index, e) log_import_failure(relation_key, relation_index, e)
end end
......
...@@ -76,11 +76,6 @@ describe 'gitlab:import_export:import rake task', :sidekiq do ...@@ -76,11 +76,6 @@ describe 'gitlab:import_export:import rake task', :sidekiq do
let(:not_imported_message) { /Total number of not imported relations: 1/ } let(:not_imported_message) { /Total number of not imported relations: 1/ }
let(:error) { /Validation failed: Notes is invalid/ } let(:error) { /Validation failed: Notes is invalid/ }
context 'when import_graceful_failures feature flag is enabled' do
before do
stub_feature_flags(import_graceful_failures: true)
end
it 'performs project import successfully' do it 'performs project import successfully' do
expect { subject }.to output(not_imported_message).to_stdout expect { subject }.to output(not_imported_message).to_stdout
expect { subject }.not_to raise_error expect { subject }.not_to raise_error
...@@ -90,23 +85,4 @@ describe 'gitlab:import_export:import rake task', :sidekiq do ...@@ -90,23 +85,4 @@ describe 'gitlab:import_export:import rake task', :sidekiq do
expect(project.import_state.status).to eq('finished') expect(project.import_state.status).to eq('finished')
end end
end end
context 'when import_graceful_failures feature flag is disabled' do
before do
stub_feature_flags(import_graceful_failures: false)
end
it 'fails project import with an error' do
# Catch exit call, and raise exception instead
expect_any_instance_of(GitlabProjectImport).to receive(:exit)
.with(1).and_raise(SystemExit)
expect { subject }.to raise_error(SystemExit).and output(error).to_stdout
expect(project.merge_requests).to be_empty
expect(project.import_state.last_error).to match(error)
expect(project.import_state.status).to eq('failed')
end
end
end
end end
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