Child pipeline does not run for web or scheduled pipelines

Summary

When using the parent/child pipeline, the child pipeline does not get run via the web or scheduled trigger.

Steps to reproduce

  1. Create the parent gitlab-ci.yml file
    parent:
      trigger:
        include: child/.gitlab-ci.yml
        strategy: depend
      rules:
        - if: '$CI_PIPELINE_SOURCE == "web"'
        - if: '$CI_PIPELINE_SOURCE == "schedule"'
  2. Create the child gitlab-ci.yml file
    variables:
      CHILD_PATH: child
    
    before_script:
      - cd $CHILD_PATH
    
    build:
      image: node:12
      only:
        refs:
          - web
      stage: build
      script:
        - touch done.txt
  3. Run the pipeline via Run Pipeline web interface

Example Project

https://gitlab.com/primoz.hadalin/gitlab-parent-child-pipeline-fail

Without the "only" part in the child yml file

only:
  refs:
    - web

the pipeline runs successfully (see pipeline #256290683)

But with the "only" rule the pipeline doesn't start (see pipeline #256293033) due to "No stages / jobs for this pipeline" error.

What is the current bug behavior?

The child pipeline is not run.

What is the expected correct behavior?

The child pipeline should run.

Edited by Primož Hadalin