Skip to content

Environments are not stopped when project is archived and cannot be stopped after archiving

Summary

When a project is archived it's existing environments are not stopped automatically and the stop buttons in the UI become unavailable.

Steps to reproduce

  • Create an empty project
  • Add a .gitlab-ci.yml file with the following content:
image: alpine:3.8

stages:
  - deploy

deploy:
  stage: deploy
  script:
    - echo "Deploy a review app"
  environment:
    name: production
    url: https://$CI_ENVIRONMENT_SLUG.example.com
    on_stop: stop_review

stop_review:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  script:
    - echo "Remove review app"
  when: manual
  environment:
    name: production
    action: stop
  • Commit the changes

  • Let the pipeline run The UI will show a red button to stop the production environment in the project's Operations > Environments screen.

  • Archive the project and verify that the production environment is still available, the job associated with on_stop wasn't executed and the stop button is also not available.

What is the current bug behavior?

When the project is archived the existing environments remain available and it is not possible to stop them.

What is the expected correct behavior?

When a project is archived it is expected that it is no longer in use. The environments declared in the project should be stopped automatically if the proper configuration exists in .gitlab-ci.yml or at least an option to that should be available in the UI.

Edited by 🤖 GitLab Bot 🤖