Continuous deployment with child pipelines and deployment safety, can't figure out how to implement

Problem to solve

I am trying to build a continuous deployment process using child pipelines (to alleviate complexity, we are deploying to multiple tenants and child pipelines are very helpful to keep our conf maintainable), on a trunk branch with lots of commits during work hours

We would like to have the latest commit trigger a deployment, but if other commits come in for them to wait for the previous deployment to be done

We thought using this conf would do the job, but it’s not working as expected:

job:
  environment:
    name: "${GITLAB_ENVIRONMENT_NAME}"
    action: start
  resource_group: "${GITLAB_ENVIRONMENT_NAME}"
  trigger:
    strategy: depend

When pushing a new job, the trigger job is cancelled instead of blocking the new pipeline, and the child pipelines keeps running:

Steps to reproduce

I’ve created a reproduction repo : Gaëtan Faugère / reproduction-repo-cd-w-subpipelines · GitLab

Configuration

See conf in reproduction repo: main pipeline, child pipeline

The repo has “auto-cancel redundant pipelines” and “prevent outdated deployment jobs” checked