Skip to content

Add ExportedProtectedBranch model for Import/Export

Etienne Baqué requested to merge 30769-update-protected-branch-export into master

What does this MR do?

The goal of this MR is to extract some code from that other bigger MR.

The extracted code is related to exporting protected branches without the new added deploy_key_id foreign key, and to exclude ProtectedBranch::PushAccessLevel instances that have a deploy_key_id set.

Manual testing and screenshots

This is a new MR, so I redid some manual testing, even though it was already done before in the main backend MR.

Screenshot_from_2020-11-16_10-41-18

# tree/project/protected_branches.ndjson
{
  "id":106,
    "project_id":3,
    "name":"test-job",
    "created_at":"2020-10-20T12:20:38.880Z",
    "updated_at":"2020-10-20T12:20:38.880Z",
    "code_owner_approval_required":false,
    "merge_access_levels":[{"id":143,
      "access_level":40,
      "created_at":"2020-10-20T12:20:38.882Z",
      "updated_at":"2020-10-20T12:20:38.882Z",
      "user_id":null,
      "group_id":null}],
    "push_access_levels":[{"id":317,
      "access_level":0,
      "created_at":"2020-10-28T10:03:59.172Z",
      "updated_at":"2020-10-28T10:03:59.172Z",
      "user_id":null,
      "group_id":null}],
    "unprotect_access_levels":[]
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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

Related to #30769 (closed)

Edited by Etienne Baqué

Merge request reports