Skip to content

Support auto approval for deployment

What does this MR do and why?

Closes #381418 (closed)

Add a configuration in Project Settings > CI/CD > Protected environments, to control whether pipeline triggerer to approve deployment is allowed.

Specific changes

  • Backend - Project Controller: support the modification of the new field allow_pipeline_trigger_approve_deployment
  • Backend - Workers: Add a sidekiq worker Deployments::AutoApprovalWorker to complete approve
  • Backend - Deployments Model: add a run_after_commit job to execute AutoApprovalWorker when creating a new deployment
  • Backend - Deployments Service: update Deployments::ApprovalService#validate to adapt to the new configration allow_pipeline_trigger_approve_deployment
  • Frontend: Add a new haml file _approval_settings.haml to provide a new UI interface for allow_pipeline_trigger_approve_deployment

Screenshots or screen recordings

When a pipeline trigger tries to approve a deployment

Before After (When checkbox is not checked) After (When checkbox is checked)
image image image image image

How to set up and validate locally

Subscription version: Premium

GitLab type: SaaS & Self-managed

Feature flag: Considering the low risk of the function, the feature flag is not set


cc @prajnamas @icbd @zhzhang93 @JeremyWuuuuu

Edited by Shinya Maeda

Merge request reports