Error when importing "instance admin" push rule from SM to dotcom
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
SM allows users to create a branch protection rule limiting push/merge to instance admins. This is not available on dotcom.
When importing a project from SM to dotcom, if any protect branch rules exist targeting instance admins, those rules will fail to be imported properly with the failure:
RecordInvalid: Access level is not included in the list
The result is a protected branch with no access level set:
Proposed solution
- Leave these blank, but make it a deliberate choice that doesn't result in raised errors. If a branch is set to "instance admins" on SM and it's not clear what the user would choose on dotcom, we should lean towards security and allow the user to manually select the next best choice for their use-case. (see comment)
Set these rules to "No one". Essentially the same as above, but makes use of an existing dropdown option.Set these rules whatever the default would be if a new project were created.
We do display the number of imported push rules. Display not imported push rules, similar as in issue for MRs skipped due to invalid diffs: Backend: Record skipped MR import and make available via... (#537939)
Frontend: Show skipped MRs in project import statistics (#537943)