Skip to content

Map 'Require review from Code Owners' GitHub rule with GitLab setting

What does this MR do and why?

When importing project from GitHub we import branch protection rules al well. Here we import Require a pull request before merging - Require review from Code Owners GitHub rule and map it to Code owner approval GitLab rule (on Premium and Ultimate GL). If the imported protected branch is also protected on GitLab, we will apply the strictest rule.

It solves Require code owner approval.

Screenshots or screen recordings

import-Require-review-from-Code-Owners-rule

How to set up and validate locally

  1. Have a project on GitHub
  2. On GitHub create a protection rule with Require a pull request before merging - Require review from Code Owners enabled for any branch
  3. Import the project from GitHub to GitLab
  4. Go to project -> Settings -> Repository -> expand Protected branches section
  5. Ensure the same branch is protected on GitLab with such setting:
  • Code owner approval - Enabled

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tetiana Zavediuk

Merge request reports