No protected environment approval option available on environment index page
Summary
No approval option exists on the environment index page after logging in as a approver to approve the deployment of a protected environment
Steps to reproduce
- Executor and Approver groups was invited into project to be deployed
- OperatorGroup: Executors of the deployment to the protected environment
- QA tester: Approvers for the deployment
- Security Group: Approvers for the deployment
- Multiple approval rules was configured as below.
{
"name": "production",
"deploy_access_levels": [
{
"access_level": null,
"access_level_description": "OperatorGroup",
"user_id": null,
"group_id": 19,
"id": 8,
"group_inheritance_type": 0
}
],
"required_approval_count": 0,
"approval_rules": [
{
"id": 9,
"user_id": null,
"group_id": 17,
"access_level": null,
"access_level_description": "QA tester",
"required_approvals": 1,
"group_inheritance_type": 0
},
{
"id": 10,
"user_id": null,
"group_id": 18,
"access_level": null,
"access_level_description": "Security Group",
"required_approvals": 1,
"group_inheritance_type": 0
}
]
}
- As the approver, i was directed to the environment index page and click 'approval options' but the approve button is missing.
Example Project
I can't create example project on GitLab.com as this requires multiple accounts, this was reproduced on my self-managed instance and a shared over a zoom session was with @shinya.maeda
What is the current bug behavior?
Approve button is missing on environment index page but navigating into the protected environment, the approve button is available there.
What is the expected correct behavior?
The approve button should be available on the environment index page
Relevant logs and/or screenshots
Output of checks
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)
Possible fixes
Implement the smallest possible graphql query to fetch approval permissions on the environments page, refactoring specifically the environment_approval.vue
component. Make sure this plays nice with the work done in #23036 (closed) as well.