Destruction jobs (action: stop) often not triggered on branch/environment deletion

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

I found that some of our environments stopped destroying when the branch is merged and deleted.

We have environments deployed per branch:

deploy:
  environment:
    name: name
    url: URL
    on_stop: delete

delete:
  environment:
    name: name
    action: stop
  when: manual

It was working well, but last few days I have had a bunch of environments where the destruction job was not triggered. For example, pipeline https://gitlab.com/rhdjapan/code/mage2/-/pipelines/634280397 The pipeline has the destruction job available:

image

It was deploying to the following environment:

image

The branch was merged and deleted with a merge request:

image

image

The environment associated with the pipeline gets deleted:

image

But the on_stop job was not triggered.

How to fix that?

Edited by 🤖 GitLab Bot 🤖