Protected Environments - Backend
What does this MR do?
It includes backend structure for Protected Environments functionality. When building Protected Environments feature (#2747 (closed)) on !6303 (closed), the MR got too big (since it involves changing several parts of the codebase). To facilitate the reviews, we decided to split the original MR in two: one for the backend and another one for the frontend.
CE port gitlab-ce!20859 (merged)
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Environments can be used for different scopes, so some of them are just for testing while others are for production. As deploy jobs could be raised by different users with different roles, it is very important that specific environments are "protected" to avoid unauthorized people to affect them. This feature ensures that only people with the right privileges can deploy code to the "protected" environments, keeping them safe.
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Tests added for this feature/bug
- Conforms to the code review guidelines
EE specific content should be in the top level
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
- If you have multiple commits, please combine them into a few logically organized commits by squashing them
- Internationalization required/considered
- If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan
End-to-end tests pass (
package-and-qamanual pipeline job)