Prevent outdated deployment jobs for automatic jobs

Hi,
I am trying to utilize the “Prevent outdated deployment jobs” feature. For testing purposes I have created this simple job:

test-restriction:
  stage: deploy
  environment: release
  resource_group: build-image-release
  script:
    - sleep 40
    - echo "I have done nothing"

The resource group is configured so that the newest pipeline runs first. What I expected to happen was, that all older jobs are cancelled. However this is not the case, as seen in the screenshot:

As you can see deployment jobs with different sha and lower ID are executed after a deployment job with higher ID had finished.

For manual jobs the feature seems to work:

I’m using a self-managed Gitlab.

  • GitLab: 15.10.1-ee
  • Runner: 15.9.1

Has anyone else experienced problems with this feature?

Yes, I am also seeing this issue with self-hosted Gitlab Community Edition 15.10.2, Runner 15.10.0. Have set the resource group process_mode to ‘newest_first’, and the newer queued deployment jobs do indeed start before older queue deployment jobs, but the older deployment jobs are not cancelled as expected. I do have “Prevent outdated deployment jobs” checked, as well as “auto-cancel redundant pipelines”. The auto-cancel redundant pipelines does work, but prevent outdated deployment jobs does not.

This issue is trivially reproducible on gitlab.com, so I’ve created an issue for it: "Prevent outdated deployment jobs" does not cancel pending deployment jobs (#408981) · Issues · GitLab.org / GitLab · GitLab