Skip to content

Initialize Confirm Rollback Modal in Env Folders

Andrew Fontaine requested to merge afontaine/391446/fix into master

What does this MR do and why?

I guess this was missed when initially adding it. The modal is used to confirm and fire the redeploy request for environments.

Changelog: fixed

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
see #391446 (closed) Screen_Recording_2023-11-13_at_12.09.08_PM

How to set up and validate locally

  1. In a project, create a pipeline like the following:
stages:
    - check
    - deploy
    - stop
image: alpine:latest

check-cluster:
  stage: check
  needs: []
  image:
    name: bitnami/kubectl:latest
    entrypoint: ['']
  script:
    - kubectl config get-contexts
    - kubectl config use-context h5bp/html5-boilerplate:rancher
    - kubectl get pods

deploy-prod:
    stage: deploy
    script:
        - sleep 10
        - echo "deploying prod"
    needs:
      - check-cluster
    environment:
        name: production
        url: postgres://example.com
        on_stop: stop-prod

deploy-staging:
    stage: deploy
    script:
        - echo "deploying staging I hope"
    needs: []
    environment:
        name: staging
        url: https://example.com

deploy-development:
    stage: deploy
    script:
        - echo "deploying development"
    needs: []
    environment:
        name: development
        url: https://example.com
    when: manual

deploy-review:
    stage: deploy
    script:
        - echo "Deploying review/$CI_COMMIT_REF_NAME"
    environment:
        name: review/$CI_COMMIT_REF_SLUG
        auto_stop_in: 1 week
        on_stop: stop_review_app
        url: postgres://$CI_COMMIT_REF_NAME.example.com
    needs: []
    only:
      - merge_requests


stop_review_app:
  script: stop-review-app
  stage: stop
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    action: stop
  needs:
       - deploy-review
  only:
    - merge_requests
  when: manual

stop-prod:
  script: 
      - echo "stopping staging"
  stage: stop
  needs:
      - deploy-prod
  environment:
    name: production
    action: stop
  when: manual
  1. Create at least 3 MRs to spin up at least 3 review apps
  2. Navigate to the project's Deploy > Environments Page
  3. Expand the review folder
  4. Select See all on the right of the review folder
  5. Select the kebab menu on an environment
  6. Select Re-deploy to environment
  7. Select Re-deploy to environment in the confirm modal
  8. Confirm the deployment job has been retried.

MR acceptance checklist

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

For #391446 (closed)

Edited by Andrew Fontaine

Merge request reports