Fix protected branches deploy key selection for FOSS
What does this MR do and why?
Contributes to #464470 (closed)
Problem
for_role
method returns only roles like Developer
, No one
without
deploy keys. As a result, we don't mark Deploy keys as selected.
When users try to select the already existing deploy key, the application returns an error, because it treats a provided deploy key as a duplicate.
Solution
Return all possible push access levels for FOSS version of GitLab.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
In both cases Deploy key is added to the protected branch.
Before | After |
---|---|
How to set up and validate locally
- Remove GitLab license
- Create a protected branch
- Add deploy key to the protected branch
- Enable/disable the deploy key
- (without fix) You should see a
Failed to update branch error
- (with fix) Deploy key can be added/removed without any problems
Edited by Vasilii Iakliushin