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)
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)
How to set up and validate locally
- Enable the
review_apps_redeploy_mr_widget
feature flag
echo "Feature.enable(:review_apps_redeploy_mr_widget)" | bundle exec rails c
- Create a new project and add a runner for that project
- 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
- Create a Merge Request for the project and wait until the pipeline finishes running
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jose Ivan Vargas