Skip to content

Parent pipeline stuck forever if child pipeline (strategy: depend) fails

This refers to "GitLab Enterprise Edition 12.10.8-ee".

If a parent pipeline includes a child pipeline with strategy: depend and any jobs fail in the child pipeline the parent pipeline is forever stuck in limbo even if the child pipeline jobs pass on retry. Below is a demo, the child pipeline jobs are simple bash scripts that exit either 0 or 1 randomly. The child pipeline fails and if you replay those jobs they eventually pass but the parent pipeline never sees the child pipeline pass and is stuck in limbo forever. We faced this exact same situation when we tried moving our functional tests to a child pipeline, if they failed the merge request was stuck forever. Here's the yml:

.gitlab-ci.yml:

stages:
  - setup
  - child
  - after_child

Setup:
  stage: setup
  script: echo "This would normally by yarn install, etc"

Child Pipeline:
  stage: child
  trigger:
    include:
      - local: child.yml
    strategy: depend

After Child Pipeline:
  stage: after_child
  script: echo "We will never get here because of child pipeline failures"

child.yml:

.child:
  stage: test
  script: exit $((RANDOM % 2))

child1:
  extends: .child

child2:
  extends: .child

child3:
  extends: .child

child4:
  extends: .child
Edited by Bruce Hubbard