Add ExportedProtectedBranch model for Import/Export
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.
# 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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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é