Approval UI - Environments Page MVC
Release notes
We are excited to introduce the Deployment Approval capability in the GitLab interface. Deployment approvers can view a pending deployment and approve or reject it in the Environments page. This capability continues our work to enable teams to create workflows for approving software to go to production or other protected environments.
Problem to solve
#15819 (closed) explains how to implement manual approvals from the gitlab-ci.yml
file but there is no visual representation on the UI.
The goal of this issue is to outline the first MVC for Approving/Rejecting deployment jobs to enable users with the right permissions to approve or reject manual jobs from the environments page.
Intended users
Software Developer (Requester)
As a software developer, I want my code to be approved to go into production quickly, so I can move on to my next tasks
Release Manager (Approver)
As a release manager, I want to make sure every deployment that is approved to go into production is in order, so I can reduce risk to our system's reliability
Development Team Lead (Approver)
As a team lead, I want to approve my developers' code to go into production quickly, without introducing unnecessary risks, so we can deliver value to customers faster
User experience goal
The user should be able to use the environments page within GitLab to approve or deny a specific deployment job to an environment.
Proposal
Requirements / User Stories
- For every stage that the
gitlab-ci.yml
file defines that approvals are required, the pipeline execution of that run should pause before entering a stage that uses the environment. - As an approver, I see the option to approve/deny a manual job that targets the listed environment.
- Only approvers can see this option.
- If a protected environment has a “Deploy to” dropdown as one of its action buttons or dropdown options, then it should be removed.
- Users configured as approvers must review and approve or reject the deployment.
- If there are multiple runs executing simultaneously, each one must be approved or rejected independently.
- As an approver, I can approve the manual job to allow the deployment job to proceed after my review.
- This action is recorded in the audit log.
- As an approver, I can reject the manual job to not allow the deployment job to proceed.
- This action is recorded in the audit log.
- As a product manager, I can view metrics related to usage of this functionality.
- When a user approves a deployment, this is captured and counted.
- When a user rejects a deployment, this is captured and counted.
- When a user approves a protected deployment job from an existing "run manual job" action, this is captured and counted.
UI States
Expand
- All users
- Environments Page - Table |
All States
- Upcoming column moved to the second place on the table
- Environments Page - Table |
Deployment job for a protected environment pending approval
- Upcoming column shows “Needs Approval” badge for protected environments with upcoming deployment
- “Needs Approval” badge shows tooltip on hover
- Single Environment Page - Deployments Table |
All States
- New column with “Approval status” shows “Approved by ” or “Rejected by ” for each deployment that went through approvals
- Column displays popover with details on hover: same metadata from approval popover + comment left by approver at the bottom.
- Environments Page - Table |
- User has approver permissions |
Deployment job for protected environment X pending approval
- Environments Page -Table
- Upcoming deployment block visible under environment X row
- Approval action enabled on environment X row
- Approval Popover
- Button shows popover with metadata, comment field and [Approve] and [Reject] options
- Environments Page -Table
- User does not have approver permissions |
Deployment job for protected environment X pending approval
- Environments Page - Table
- Approval action disabled on environment X row, shows tooltip
- Approval action shows popover with text and link to documentation
- Environments Page - Table
Action | Details |
---|---|
Approval action | approve/deny |
The user | username |
Environment | <Environment name> |
Time | timestamp |
Stage | pipeline stage |
- As an approver, I can approve the manual job to reject the deployment job if I have any concerns.
- This action is recorded in the audit log.
- If a user rejects the manual job, we can either force it to fail, or create a new job status of
rejected
. From the docs, this is what we currently support:
Attribute | Type | Required | Description |
---|---|---|---|
scope | string or array of strings | no | Scope of jobs to show. Either one of or an array of the following: created, pending, running, failed, success, canceled, skipped, or manual. All jobs are returned if scope is not provided. |
backend requirements
Expose the following fields to internal API:
-
environment.tier
- !80440 (merged) -
environment.required_approval_count
- !80440 (merged) -
deployment.pending_approval_count
- !80440 (merged) -
deployment.approvals
- !81487 (merged) -
deployment.approvals.created_at
- !81487 (merged)
What we will do in a future iteration
- Add approval/rejection message (to be added as an MR comment)
- Notifications that your approval is required (TODO, email, slack...)
Permissions and Security
Documentation
Availability & Testing
Available Tier
What does success look like, and how can we measure that?
Users approve/reject deployments from the new UI, and we can see a majority of manual jobs to protected environments being approved from this interface (as opposed to the pipelines page or job page, for example).