Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 51,007
    • Issues 51,007
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,561
    • Merge requests 1,561
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #367943
Closed
Open
Issue created Jul 15, 2022 by Kevin Chu@kbychuMaintainer

Don't automatically run a deployment job post approval when using Unified Approval Setting

Problem

The current behavior of unified approval setting is to automatically execute a deployment job after approval.

However, this is not always desired. Some customers set deployment jobs to manual, even with approvals, they do not want the job to run automatically.

Proposal

  • Remove the hard-coded auto-execution logic. Like Multi Approval Rules, it just unblocks the deployment job after sufficient approvals have been collected. So that deployment executors can execute the job later at a preferred moment.
  • When the last approver comes to approve and has permission to execute the deployment, they see two approval options: Approve and Approve and Deploy.
  • When users click Approve, the deployment will not run. The deployment job stays as manual.
  • When users click Approve and Deploy, the deployment will run.
    • Frontend additionally requests to the play job endpoint if the user clicked this button.
  • Change the subtext in the modal to: View approval/rejection history for deployment 8. By selecting Approve and Deploy the job will run, by selecting approve the job will wait to be manually run, and rejecting will fail the job.
Screenshot
Screen_Shot_2022-10-06_at_11.51.29_AM

Technical details

  • Frontend can perform GraphQL query for fetching the job execution permission - deployment.job.userPermissions.updateBuild.
  • Frontend can perform GraphQL mutation for executing the job - Mutations::Ci::Job::Play. Alternatively, we should introduce a new mutation in the DeploymentType.
  • It's preferred to use a feature flag for gradually rolling out the change.
  • There are two places that show the deploy approval model - one is in Environment Index page, another is in Environment Details page. We update both.

Future Proposal (if needed)

Future Proposal (if needed)
  • Add a setting to the protected environments page that allows users to customize whether they would like deployments to automatically run after a final approval.
  • If users select not to automatically run, give a third CTA to the approval modal that lets them choose to either Approve or Approve and Deploy.
  • If users select to automatically run, change main CTA of the last approver to Approve and Deploy so they understand by clicking approve a deployment will also happen.
Proposed UX Flow
Screen_Shot_2022-10-04_at_11.07.45_AM
New Settings Page New Modal (When deployments are not automatic)
Screen_Shot_2022-10-04_at_11.11.36_AM Screen_Shot_2022-10-05_at_2.51.24_PM
  • Figma File
  • Full UX Flow

Workaround

Switch to Multiple approval rules. This configuration doesn't automatically run deployment jobs and will supersede Unified Approval Setting. #357798

Edited Dec 08, 2022 by Shinya Maeda
Assignee
Assign to
Time tracking