Use allowlist of allowed attributes for imported models

This change changes the behavior that is reponsible for filtering out
attributes when importing new project. We were cleaning attributes based
on list of excluded patterns and attributes. For ProtectedBranch,
ProtectedTag, ProtectedEnvironment and Releases we are changing that
behavior.

Changelog: changed
parent 72981f3d
...@@ -11,6 +11,9 @@ RSpec.describe Gitlab::ImportExport::AttributesPermitter do ...@@ -11,6 +11,9 @@ RSpec.describe Gitlab::ImportExport::AttributesPermitter do
where(:relation_name, :permitted_attributes_defined) do where(:relation_name, :permitted_attributes_defined) do
:push_rule | true :push_rule | true
:issuable_sla | false :issuable_sla | false
:unprotect_access_levels | true
:deploy_access_levels | true
:protected_environments | true
end end
with_them do with_them do
......
...@@ -225,6 +225,53 @@ included_attributes: ...@@ -225,6 +225,53 @@ included_attributes:
- :updated_at - :updated_at
- :start_date - :start_date
- :state - :state
protected_branches:
- :project_id
- :name
- :created_at
- :updated_at
- :code_owner_approval_required
- :allow_force_push
protected_tags:
- :project_id
- :name
- :created_at
- :updated_at
create_access_levels:
- :access_level
- :created_at
- :updated_at
- :user_id
- :group_id
merge_access_levels:
- :access_level
- :created_at
- :updated_at
- :user_id
- :group_id
push_access_levels:
- :access_level
- :created_at
- :updated_at
- :user_id
- :group_id
releases:
- :tag
- :description
- :project_id
- :author_id
- :created_at
- :updated_at
- :name
- :sha
- :released_at
links:
- :url
- :name
- :created_at
- :updated_at
- :filepath
- :link_type
# Do not include the following attributes for the models specified. # Do not include the following attributes for the models specified.
excluded_attributes: excluded_attributes:
...@@ -593,3 +640,20 @@ ee: ...@@ -593,3 +640,20 @@ ee:
- :reject_unsigned_commits - :reject_unsigned_commits
- :commit_committer_check - :commit_committer_check
- :regexp_uses_re2 - :regexp_uses_re2
unprotect_access_levels:
- :access_level
- :user_id
- :group_id
deploy_access_levels:
- :created_at
- :updated_at
- :access_level
- :user_id
- :group_id
protected_environments:
- :project_id
- :group_id
- :name
- :created_at
- :updated_at
...@@ -92,6 +92,13 @@ RSpec.describe Gitlab::ImportExport::AttributesPermitter do ...@@ -92,6 +92,13 @@ RSpec.describe Gitlab::ImportExport::AttributesPermitter do
:boards | true :boards | true
:custom_attributes | true :custom_attributes | true
:labels | true :labels | true
:protected_branches | true
:protected_tags | true
:create_access_levels | true
:merge_access_levels | true
:push_access_levels | true
:releases | true
:links | true
end end
with_them do with_them do
......
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