Job can be run before previous job has finished

Summary

Jobs later in pipeline can be run before earlier job completes if you cancel the job and then retry it.

Steps to reproduce

  1. Create a repository with a multi-stage CI pipeline and a long runnning stage near the start of the pipeline
  2. Cause the CI pipeline to run
  3. Cancel one of the later jobs in the pipeline
  4. Retry the cancelled job

Example Project

https://gitlab.com/bytesnz/ci-bug/pipelines

What is the current bug behavior?

Retried job runs and can complete before the pipeline completes up to it

What is the expected correct behavior?

When you cancel the job, it should show an option to requeue it in the pipeline (instead of retry), so that it runs in the correct order

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com

(opensource projects - GitLab Enterprise Edition 11.6.0-ee)

Assignee Loading
Time tracking Loading