Skip to content

Resolve "Environments should not show as stopped if on_stop fails"

What does this MR do and why?

Environments are now updated to stopping state from available when stopped, then only updated to stopped status once the on_stop job has completed successfully.

UX changes to reflect this will be a follow-up MR

How to set up and validate locally

deploy:
  script: echo "Deploy"
  environment:
    name: development
    on_stop: teardown

teardown:
  script: exit 1
  environment:
    name: development
    action: stop
  when: manual
  1. Enable the feature flag Feature.enable(:env_stopped_on_stop_success)
  2. Setup a .gitlab-ci.yml file with an on_stop step that will fail
  3. Run the pipeline
  4. Click stop for the environment (i.e. development)
  5. Note how the environment is not stopped

MR acceptance checklist

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

Related to #332301 (closed)

Edited by Allen Cook

Merge request reports