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
efab1677
Commit
efab1677
authored
Aug 11, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix attribute inclusion in import/export config ignored in some cases
parent
34d5426f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
CHANGELOG
CHANGELOG
+3
-0
lib/gitlab/import_export/json_hash_builder.rb
lib/gitlab/import_export/json_hash_builder.rb
+3
-6
spec/lib/gitlab/import_export/reader_spec.rb
spec/lib/gitlab/import_export/reader_spec.rb
+2
-1
spec/support/import_export/import_export.yml
spec/support/import_export/import_export.yml
+4
-0
No files found.
CHANGELOG
View file @
efab1677
...
@@ -90,6 +90,9 @@ v 8.11.0 (unreleased)
...
@@ -90,6 +90,9 @@ v 8.11.0 (unreleased)
- Fix importing GitLab projects with an invalid MR source project
- Fix importing GitLab projects with an invalid MR source project
- Sort folders with submodules in Files view !5521
- Sort folders with submodules in Files view !5521
v 8.10.6 (unreleased)
- Fix import/export configuration missing some included attributes
v 8.10.5
v 8.10.5
- Add a data migration to fix some missing timestamps in the members table. !5670
- Add a data migration to fix some missing timestamps in the members table. !5670
- Revert the "Defend against 'Host' header injection" change in the source NGINX templates. !5706
- Revert the "Defend against 'Host' header injection" change in the source NGINX templates. !5706
...
...
lib/gitlab/import_export/json_hash_builder.rb
View file @
efab1677
...
@@ -57,10 +57,7 @@ module Gitlab
...
@@ -57,10 +57,7 @@ module Gitlab
# +value+ existing model to be included in the hash
# +value+ existing model to be included in the hash
# +json_config_hash+ the original hash containing the root model
# +json_config_hash+ the original hash containing the root model
def
create_model_value
(
current_key
,
value
,
json_config_hash
)
def
create_model_value
(
current_key
,
value
,
json_config_hash
)
parsed_hash
=
{
include:
value
}
json_config_hash
[
current_key
]
=
parse_hash
(
value
,
{
include:
value
})
parse_hash
(
value
,
parsed_hash
)
json_config_hash
[
current_key
]
=
parsed_hash
end
end
# Calls attributes finder to parse the hash and add any attributes to it
# Calls attributes finder to parse the hash and add any attributes to it
...
@@ -69,8 +66,8 @@ module Gitlab
...
@@ -69,8 +66,8 @@ module Gitlab
# +parsed_hash+ the original hash
# +parsed_hash+ the original hash
def
parse_hash
(
value
,
parsed_hash
)
def
parse_hash
(
value
,
parsed_hash
)
@attributes_finder
.
parse
(
value
)
do
|
hash
|
@attributes_finder
.
parse
(
value
)
do
|
hash
|
parsed_hash
=
{
include:
hash_or_merge
(
value
,
hash
)
}
{
include:
hash_or_merge
(
value
,
hash
)
}
end
end
||
parsed_hash
end
end
# Adds new model configuration to an existing hash with key +current_key+
# Adds new model configuration to an existing hash with key +current_key+
...
...
spec/lib/gitlab/import_export/reader_spec.rb
View file @
efab1677
...
@@ -12,7 +12,8 @@ describe Gitlab::ImportExport::Reader, lib: true do
...
@@ -12,7 +12,8 @@ describe Gitlab::ImportExport::Reader, lib: true do
except:
[
:iid
],
except:
[
:iid
],
include:
[
:merge_request_diff
,
:merge_request_test
]
include:
[
:merge_request_diff
,
:merge_request_test
]
}
},
}
},
{
commit_statuses:
{
include: :commit
}
}]
{
commit_statuses:
{
include: :commit
}
},
{
project_members:
{
include:
{
user:
{
only:
[
:email
]
}
}
}
}]
}
}
end
end
...
...
spec/support/import_export/import_export.yml
View file @
efab1677
...
@@ -7,6 +7,8 @@ project_tree:
...
@@ -7,6 +7,8 @@ project_tree:
-
:merge_request_test
-
:merge_request_test
-
commit_statuses
:
-
commit_statuses
:
-
:commit
-
:commit
-
project_members
:
-
:user
included_attributes
:
included_attributes
:
project
:
project
:
...
@@ -14,6 +16,8 @@ included_attributes:
...
@@ -14,6 +16,8 @@ included_attributes:
-
:path
-
:path
merge_requests
:
merge_requests
:
-
:id
-
:id
user
:
-
:email
excluded_attributes
:
excluded_attributes
:
merge_requests
:
merge_requests
:
...
...
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