Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,763
    • Issues 44,763
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,328
    • Merge requests 1,328
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #29651
Closed
Open
Issue created Jun 21, 2019 by Jason Yavorska@jyavorskaContributor

Allow child pipelines to trigger their own child pipelines

Problem to solve

With https://gitlab.com/gitlab-org/gitlab-ce/issues/22972 we introduce the new idea of child/parent pipelines. For the MVC, however, we limit the relationship only to parent->child, and disallow parent->child->child->(...). One level of relationship is good for many use cases, but in a more complex workflow you have pipeline branches creating one or maybe two pipeline branches of their own.

Intended users

Software Developers

Further details

  • See https://gitlab.com/gitlab-org/gitlab-ce/issues/22972 for details on parent/child implementation.

Proposal

Remove the limitation for child pipelines, and set a maximum depth for relationships. A decent starter value could be 5, but even 2 is better (that at least unlocks an alternative to #229134 (closed)). If the max depth is reached, the pipeline should fail to start and return a failure status attribution, and there should be a clear message what happened.

We could implement this using Gitlab::ObjectHierarchy utility which is already used today for groups/sub-groups. This would allow us to find out all descendants or all ancestors as well as calculating the max_descendants_dept which should be used to enforce the limit.

  • change Ci::Pipeline#same_family_pipeline_ids to take in consideration a wider hierarchy
  • change Ci::CreateCrossProjectPipelineService#ensure_preconditions! to account for a wider hierarchy
  • ensure pipeline processing works as expected with status attribution

Permissions and Security

A maximum depth is important to prevent recursive/runaway pipelines causing a denial of service.

Documentation

Testing

What does success look like, and how can we measure that?

Links / references

Edited Aug 11, 2020 by Fabio Pitino
Assignee
Assign to
Time tracking