Protected Branches/Tags error when adding a Maintainer role after a deploy key
Summary
Protected Branches and Tags encounter an error when attempting to add the Maintainer role after adding a Deploy Key. This is because they both have the same access_level value of 40.
Steps to reproduce
- Create a new project
- Navigate to
Settings > Repository - Expand
Deploy keysand add a deploy key - Expand
Protected branches- Open the
Allowed to push and mergedropdown- Remove
Maintainersand close the dropdown to save - Add the deploy key and close the dropdown to save
- Add the
Maintainersrole and close the dropdown to save
- Remove
- Observe the error
- Open the
- Expand
Protected tags- Open the
Allowed to createdropdown- Remove
Maintainersand close the dropdown to save - Add the deploy key and close the dropdown to save
- Add the
Maintainersrole and close the dropdown to save
- Remove
- Observe the error
- Open the
Example Project
What is the current bug behavior?
Protected branches
- The user receives
Failed to update branch!alert. - The browser receives a 422 status code with the following response:
{"push_access_levels.access_level":["has already been taken"]}
Protected tags
- The user receives
Failed to update tag!alert. - The browser receives a 422 status code with the following response:
{"create_access_levels.access_level":["has already been taken"]}
What is the expected correct behavior?
The Maintainer role can be added as expected.