Show which group user approved for
What does this MR do and why?
This MR updates deployment approval comments section to show a tooltip with the role name for which the user approved/rejected.
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
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Approved | Rejected |
---|---|
How to set up and validate locally
- make sure you have EE version of gitlab enabled
- create a project and add the following
.gitlab-ci.yaml
file
stages:
- deploy
image: alpine:latest
deploy-prod:
stage: deploy
script:
- sleep 10
- echo "deploying prod"
environment:
name: production
url: postgres://example.com
when: manual
deploy-staging:
stage: deploy
script:
- echo "deploying staging"
environment:
name: staging
url: https://example.com
when: manual
- go to Settings -> CI/CD -> Protected environments and protect the production environment (assign at least one more user to approvers so you could test approval logic)
- Run the pipeline to trigger a creation of pending deployment
- Enable the feature flag
deployment_details_page
- Locate your deployment on Deployments -> Environments -> Production,
- click on the status badge to open the Deployment details page or navigate to
http://<gdk-url>/<namespace>/<project>/-/environments/<environment id>/deployments/<deployment iid>
- Select a group to approve/reject for.
- Add a comment before approving/rejecting.
- Verify the comment shows the Approved/Rejected badge.
- Hover the badge and verify the tooltip appears with the information which role the user approved for.