Bridge job with needs remains skipped when retrying failed previous job

Summary

Bridge jobs remains skipped when previous job (from other stage) failed and then is retried. My configuration is using both stages and needs concepts (needs is used to order jobs within the stage).

On the contrary if there is no failed jobs everything is working correctly and all jobs, including bridge jobs, are run as expected.

Steps to reproduce

  1. Create the project with the flowing yaml configurations:
  • .gitlab-ci.yml
stages:          # List of stages for jobs, and their order of execution
  - build
  - dev
  - sit

build_job:      
  stage: build
  script:
    - echo "Compiling the code..."
    - sleep 2
    - echo "Compile complete."
    - exit $((RANDOM % 2))
 

release:       
  stage: build
  needs: 
    - build_job
  script:
    - echo "Release..." 
    - sleep 5

dev deploy:      
  stage: dev  
  script:
    - echo "Deploying application..."
    - echo "Application successfully deployed."

sit deploy:      
  stage: sit  
  script:
    - echo "Deploying application..."
    - echo "Application successfully deployed."


.child_template: &child_template
  trigger:
    include:
      - local: child.yml
    strategy: depend

dev system tests:
  <<: *child_template
  stage: dev
  needs:
    - dev deploy
  allow_failure: false

sit system tests:
  <<: *child_template
  stage: sit
  needs:
    - sit deploy
  allow_failure: false
  • child.yml
stages:          
  - build


build-job:       
  stage: build
  script:
    - echo "Compiling the code..."
    - sleep 5
    - echo "Compile complete."
  1. Run the pipeline. It fails randomly because of exit $((RANDOM % 2)). In case to reproduce it you need to have it failed in the first run
  2. Re-run failed job. If it pass you should see that at least of the bridge jobs remains skipped while all others jobs are run.

Example Project

  1. Link to the project: https://gitlab.com/javaspiver_reproducer/test
  2. Link to the pipeline showing the issue:
  • https://gitlab.com/javaspiver_reproducer/test/-/pipelines/419708285
  • https://gitlab.com/javaspiver_reproducer/test/-/pipelines/419708285/builds

What is the current bug behavior?

When I retry a job from previous stage, bridge job often (not always) remains skipped and it is not run. Still the pipeline is marked as passed with success.

What is the expected correct behavior?

I would expect all jobs, including bridge jobs, are run.

Relevant logs and/or screenshots

pipeline view

jobs view

Output of checks

This bug happens on GitLab.com

Edited Dec 03, 2021 by Brie Carranza
Assignee Loading
Time tracking Loading