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
ddd4b3af
Commit
ddd4b3af
authored
Nov 14, 2019
by
Aleksei Lipniagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ci_cd_settings Import, project_feature spec
parent
7f1f1bd7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+6
-1
spec/fixtures/lib/gitlab/import_export/complex/project.json
spec/fixtures/lib/gitlab/import_export/complex/project.json
+4
-1
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+4
-0
No files found.
lib/gitlab/import_export/relation_factory.rb
View file @
ddd4b3af
...
...
@@ -327,7 +327,12 @@ module Gitlab
end
def
find_or_create_object!
return
relation_class
.
find_or_create_by
(
project_id:
@project
.
id
)
if
UNIQUE_RELATIONS
.
include?
(
@relation_name
)
if
UNIQUE_RELATIONS
.
include?
(
@relation_name
)
unique_relation_object
=
relation_class
.
find_or_create_by
(
project_id:
@project
.
id
)
unique_relation_object
.
assign_attributes
(
parsed_relation_hash
)
return
unique_relation_object
end
# Can't use IDs as validation exists calling `group` or `project` attributes
finder_hash
=
parsed_relation_hash
.
tap
do
|
hash
|
...
...
spec/fixtures/lib/gitlab/import_export/complex/project.json
View file @
ddd4b3af
...
...
@@ -7209,7 +7209,7 @@
}
],
"project_feature"
:
{
"builds_access_level"
:
0
,
"builds_access_level"
:
2
0
,
"created_at"
:
"2014-12-26T09:26:45.000Z"
,
"id"
:
2
,
"issues_access_level"
:
0
,
...
...
@@ -7257,6 +7257,9 @@
"image_url"
:
"http://www.example.com"
}
],
"ci_cd_settings"
:
{
"group_runners_enabled"
:
false
},
"boards"
:
[
{
"id"
:
29
,
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
ddd4b3af
...
...
@@ -220,6 +220,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect
(
award_emoji
.
map
(
&
:name
)).
to
contain_exactly
(
'thumbsup'
,
'coffee'
)
end
it
'restores `ci_cd_settings` : `group_runners_enabled` setting'
do
expect
(
@project
.
ci_cd_settings
.
group_runners_enabled?
).
to
eq
(
false
)
end
it
'restores the correct service'
do
expect
(
CustomIssueTrackerService
.
first
).
not_to
be_nil
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