Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #60885
Closed
Open
Issue created Apr 23, 2019 by Philippe Charrière@k33g🎱Developer

`on_stop` is not automatically triggered anymore, stopping environment becomes impossible

Summary

Since the 11.10 version, on_stop (in .gitlab-ci.yml) is not automatically triggered anymore. For example, when you merge the MR (deleting the source branch) the review application environment isn't stopped.

Steps to reproduce

  • Create a project (even empty)
  • add .gitlab-ci.yml with this content:
stages:
  - calculations
  - preview

addition:
  only: 
    - master 
  stage: calculations
  script:
    - expr 40 + 2
  environment:
    name: production
    url: http://www.google.com

run_preview:
  stage: preview
  only:
    - merge_requests
  script: |
    echo "creating an environment"
  environment:
    name: preview
    url: http://www.google.com
    on_stop: stop_preview

stop_preview:
  stage: preview
  when: manual
  only:
    - merge_requests
  script: |
    echo "deleting an environment"
  environment:
    name: preview
    action: stop
  • when you commit on master it will create a production environment
  • when you create a MR it will create a preview environment
  • when you merge the MR (deleting the source branch) the preview environment will not be stopped

with the 11.09 version, the preview environment was stopped automatically

Example Project

example: https://gitlab.com/kebab-corp/demo

What is the current bug behavior?

When doing a Review Application, the review environment isn't stopped when merging (and deleting the source branch)

What is the expected correct behavior?

When doing a Review Application, the review environment is stopped when merging (and deleting the source branch)

Output of checks

This bug happens on GitLab.com and on GitLab self-hosted

Edited Apr 23, 2019 by Philippe Charrière
Assignee
Assign to
Time tracking