From 3bb3a6886f3b206a2ec089d6b1e8854615daa0b8 Mon Sep 17 00:00:00 2001 From: James Edwards-Jones Date: Tue, 4 Apr 2017 02:19:04 +0100 Subject: [PATCH] Attempt to fix import/export of push_access_levels for protected tags --- lib/gitlab/import_export/import_export.yml | 2 ++ lib/gitlab/import_export/relation_factory.rb | 3 ++- spec/lib/gitlab/import_export/all_models.yml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index ab74c8782f6..7bf5568a8ee 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -46,6 +46,8 @@ project_tree: - protected_branches: - :merge_access_levels - :push_access_levels + - protected_tags: + - :push_access_levels - :project_feature # Only include the following attributes for the models specified. diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index 9d269c5d384..b1d8e385f2e 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -7,8 +7,9 @@ module Gitlab triggers: 'Ci::Trigger', builds: 'Ci::Build', hooks: 'ProjectHook', - merge_access_levels: 'ProtectedBranch::MergeAccessLevel', #TODO: Tags + merge_access_levels: 'ProtectedBranch::MergeAccessLevel', push_access_levels: 'ProtectedBranch::PushAccessLevel', + #TODO: How to add?- push_access_levels: 'ProtectedTag::PushAccessLevel', labels: :project_labels, priorities: :label_priorities, label: :project_label }.freeze diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index ddeb71730e7..83503c73e75 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -111,10 +111,14 @@ protected_branches: - project - merge_access_levels - push_access_levels +protected_tags: +- project +- push_access_levels merge_access_levels: - protected_branch push_access_levels: - protected_branch +- protected_tag project: - taggings - base_tags @@ -169,6 +173,7 @@ project: - snippets - hooks - protected_branches +- protected_tags - project_members - users - requesters