Skip to content

Draft: Add branch mirror model

Robert May requested to merge mirror-branches into master

What does this MR do?

Adds a new model and database table for branch mirroring.

Related #285459

Migrations

> rake db:migrate:up VERSION=20210701120832                                                                                 
== 20210701120832 CreateProjectBranchMirrors: migrating =======================
-- create_table(:project_branch_mirrors, {})
-- quote_column_name(:from_branch)
   -> 0.0000s
-- quote_column_name(:to_branch)
   -> 0.0000s
   -> 0.0118s
-- quote_table_name("check_197ea5a284")
   -> 0.0000s
-- quote_table_name("check_e84fd9e1d1")
   -> 0.0000s
-- quote_table_name(:project_branch_mirrors)
   -> 0.0000s
-- execute("ALTER TABLE \"project_branch_mirrors\"\nADD CONSTRAINT \"check_197ea5a284\" CHECK (char_length(\"from_branch\") <= 4096),\nADD CONSTRAINT \"check_e84fd9e1d1\" CHECK (char_length(\"to_branch\") <= 4096)\n")
   -> 0.0006s
== 20210701120832 CreateProjectBranchMirrors: migrated (0.0158s) ==============

> rake db:migrate:down VERSION=20210701120832                                                                               
== 20210701120832 CreateProjectBranchMirrors: reverting =======================
-- drop_table(:project_branch_mirrors, {})
   -> 0.0014s
== 20210701120832 CreateProjectBranchMirrors: reverted (0.0054s) ==============                                                                                                                                     

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sean Carroll

Merge request reports