Skip to content

Fix error when third level trigger pipeline

Furkan Ayhan requested to merge 29651-fix-triggered-pipelines-depth into master

What does this MR do?

When implementing child of child pipelines (!41102 (merged)), we added not only the parent-child pipelines but also "accidentally" the triggered pipelines, which have different projects, into the hierarchy tree.

That caused this error:

  • Project A has Pipeline 1
  • Pipeline 1 triggers Pipeline 2 of Project B
  • Pipeline 2 triggers Pipeline 3 of Project C
  • Pipeline 3 tries to create a child pipeline of Project C: Pipeline 4
  • Pipeline 4 should be created successfully, but it can not be because our newly introduced hierarchy tree assumes that this child has 3 level depth in the same family!.
gitlab-ci.yml for Project A
build:
    stage: build
    script: exit 0

trigger_next:
    stage: deploy
    trigger:
        project: project-b
gitlab-ci.yml for Project B
build:
    stage: build
    script: exit 0

trigger_next:
    stage: deploy
    trigger:
        project: project-c
gitlab-ci.yml for Project C
build:
    script: exit 0

deploy:
    trigger:
        include: child.yml

child.yml

build_child:
    script: exit 0

In this MR, we are starting to ignore other project pipelines.

Screenshots

Before the fix

Screen_Shot_2020-09-12_at_15.47.04

After the fix

Screen_Shot_2020-09-12_at_15.51.38

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Grzegorz Bizon

Merge request reports