Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d3028f19
Commit
d3028f19
authored
Jan 09, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag import_graceful_failures
parent
5c25fa80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
31 deletions
+8
-31
lib/gitlab/import_export/relation_tree_restorer.rb
lib/gitlab/import_export/relation_tree_restorer.rb
+0
-3
spec/tasks/gitlab/import_export/import_rake_spec.rb
spec/tasks/gitlab/import_export/import_rake_spec.rb
+8
-28
No files found.
lib/gitlab/import_export/relation_tree_restorer.rb
View file @
d3028f19
...
...
@@ -75,9 +75,6 @@ module Gitlab
save_id_mapping
(
relation_key
,
data_hash
,
relation_object
)
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
)
end
...
...
spec/tasks/gitlab/import_export/import_rake_spec.rb
View file @
d3028f19
...
...
@@ -76,37 +76,17 @@ describe 'gitlab:import_export:import rake task', :sidekiq do
let
(
:not_imported_message
)
{
/Total number of not imported relations: 1/
}
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
expect
{
subject
}.
to
output
(
not_imported_message
).
to_stdout
expect
{
subject
}.
not_to
raise_error
expect
(
project
.
merge_requests
).
to
be_empty
expect
(
project
.
import_state
.
last_error
).
to
be_nil
expect
(
project
.
import_state
.
status
).
to
eq
(
'finished'
)
end
before
do
stub_feature_flags
(
import_graceful_failures:
true
)
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
it
'performs project import successfully'
do
expect
{
subject
}.
to
output
(
not_imported_message
).
to_stdout
expect
{
subject
}.
not_to
raise_error
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
expect
(
project
.
merge_requests
).
to
be_empty
expect
(
project
.
import_state
.
last_error
).
to
be_nil
expect
(
project
.
import_state
.
status
).
to
eq
(
'finished'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment