[go: up one dir, main page]

Auto-cancel pending pipelines

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

Summary

(Not able to prevent multiple pipelines to be executed in parallel)

Steps to reproduce

  1. Create new gitlab project
  2. Turned on “Auto-cancel redundant, pending pipelines” from the CICD pipeline setting for this project.
  3. Keep commit the changes or keep clicking on “Run Pipeline” button multiple times
  4. Make sure that you have multiple shared runners (I have 50 shared runners)

Example Project

stages:
  - build
  - test
  - stage
 
before_script:
    - env | sort
    - pwd
    - ls -la
   
build:
  stage: build
  image: "paciolanadmin/maven-jdk-alpine"
  script:
    - echo "Starting building...."
    - sleep 50
    - echo "Done"
   
test:
  stage: test
  image: "paciolanadmin/maven-jdk-alpine"
  script:
    - echo "Starting deploying to test..."
    - sleep 50
    - echo "Done"
   
stage:
  stage: stage
  image: "paciolanadmin/maven-jdk-alpine"
  script:
    - echo "Starting deploying to stage..."
    - sleep 50
    - echo "Done"
  when: manual

What is the current bug behavior?

None of the pipelines are canceled. All pipelines are executed

What is the expected correct behavior?

Only one pipeline to run at a time All redundant pipeline should be auto canceled and only the last pipeline will be in the queue

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited by 🤖 GitLab Bot 🤖