Skip to content

Change logic for the redeploy button of deployment widget

What does this MR do and why?

This allows redeploying stopped deployments inside the merge request page without leaving the page. This is behind the review_apps_redeploy_mr_widget feature flag

The feature flag review_apps_redeploy_mr_widget was introduced in !118260 (merged)

#220838 (closed)

Screenshots or screen recordings

Before

Stop the deployment and it takes you to the environments page

Screen_Recording_2023-05-04_at_16.45.20

After

Stop the deployment and the redeploy button appears

Screen_Recording_2023-05-04_at_16.04.41

Redeploy environment (takes a little bit of time)

Deployed

How to set up and validate locally

  1. Enable the review_apps_redeploy_mr_widget feature flag
echo "Feature.enable(:review_apps_redeploy_mr_widget)" | bundle exec rails c
  1. Create a new project and add a runner for that project
  2. Create a .gitlab-ci.yml file with the following configuration
image: alpine:latest

deploy-review:
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    url: http://example.com
  script: echo review/$CI_COMMIT_REF_SLUG 
  1. Create a Merge Request for the project and wait until the pipeline finishes running
  2. Stop the environment from the deployments widget and redeploy said environment using the redeploy button.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jose Ivan Vargas

Merge request reports