Importing a private Project from a group with a plan into No plan group fails due to protected ref access levels

Summary

Importing a Project from a group with a plan into No plan group fails due to protected ref access levels

Steps to reproduce

  • Create a new private group, PlanGroup
  • Promote PlanGroup to have a plan
  • Create a new private group, NoPlanGroup
  • Create a new private project project-to-export in PlanGroup
  • Export project-to-export
  • Create a new project in NoPlanGroup by importing project-to-export archive

Example Project

https://gitlab.com/no-plan-group/project-for-import/import/new

What is the current bug behavior?

Error importing repository  into no-plan-group/project-for-import - Failed to replace protected_branches because one or more of the new records could not be saved. Merge access levels group must be blank Push access levels group must be blank

What is the expected correct behavior?

Project should be imported

Relevant logs and/or screenshots

N/A

Output of checks

Results of GitLab environment info

reproduced on GitLab.com v10.7.2-ee

Code

  • https://gitlab.com/gitlab-org/gitlab-ee/blob/d81891da908ad75fed3a2aee29e72c8fff82ad60/ee/app/models/concerns/ee/protected_ref_access.rb#L22-24
Assignee Loading
Time tracking Loading