Skip to content

Evaluate outdated jobs when deployment starts

What does this MR do and why?

We now evaluate whether or not to skip an outdated job when the job starts, in addition to after it's done as we did previously

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

.gitlab-ci.yml

image: alpine

build:
  stage: build
  script: 
    - echo "building..."

production:
  stage: deploy
  script: sleep 3600 && echo "deploying app..."
  environment:
    name: "production"
  1. Enable prevent_outdated_deployment_jobs feature flag
  2. Create a project with a long running deployment (i.e. sleep 3600)
  3. Run a deployment pipeline
  4. Run a second deployment pipeline with an older commit than the previous pipeline
  5. Note that it fails immediately before it is even ran with the error message The deployment job is older than the latest deployment, and therefore failed

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #363328 (closed)

Edited by Allen Cook

Merge request reports