Protected Environment allow to deploy list is not updated properly
Summary
When the protected environment was created. Any new user added to the list later cannot deploy to the environment.
Steps to reproduce
- Create a protected environment and allow specific users to deploy to the environment
- Start a pipeline and see that only the users mentioned are allowed to deploy
- Add a new user to the
Allow to deploy
list for the protected environment - Using the Protected environment API will show the new user in the list
- Create a new pipeline to deploy to the protected environment
- Try to deploy as the new user and observe there's no play button to deploy
Additionally, if approval is required, only the original users in the list can give the approval.
Example Project
https://gitlab.com/gitlab-gold/rotanak/338686
In the example project, the new user even has Owner role but only the original 2 users can approve and deploy to the protected environment.
What is the current bug behavior?
Users who are added to the Protected Environment Allow to Deploy
list cannot deploy or approve deployment.
What is the expected correct behavior?
Users in the Protected Environment Allow to Deploy
list can deploy or approve deployment.
Relevant logs and/or screenshots
The new user added to the list see the following
If approval is required, the new user see the following when try to approve:
Output of checks
This happens on GitLab.com; GitLab Enterprise Edition 15.7.0-pre a1f7c8e9
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)