Skip to content

Move "Require code owner approval" setting from Project to ProtectedBranches

Kerri Miller requested to merge 10395-COAR-phase-2 into master

What does this MR do?

This MR is the second half of backend work to address #13251 (closed), specifically migrating data from the projects table to the protected_branches table, and unwinding any cases where we inquire of the project rather than the protected_branches themselves as to whether or not "code owner approval required"

This work was originally part of !14900 (merged) (and #10395 (closed)) and received some initial reviews from @tigerwnz and @abrandl.

Database checklist

When adding migrations:

  • Updated db/schema.rb
  • Added a down method so the migration can be reverted
  • Added the output of the migration(s) to the MR body
  • Added tests for the migration in spec/migrations if necessary (e.g. when migrating data)

Migration Output

➜  bin/rails db:migrate:redo VERSION=20190827102026
== 20190827102026 MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches: reverting
== 20190827102026 MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches: reverted (0.0000s)

== 20190827102026 MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches: migrating
== 20190827102026 MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches: migrated (0.0238s)
Edited by 🤖 GitLab Bot 🤖

Merge request reports