--- title: "ADR 0058: Follow-up dependency graph is validated whole and resolved against plain definitions only" --- * Status: accepted * Code: [`pkg/pipelinerungroup/graph.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelinerungroup/graph.go), [`pkg/pipelinerungroup/resolver.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelinerungroup/resolver.go) ## Context A definition with an `on-pipelinerun` annotation waits on other definitions and is created only when they are done. The graph comes from the `.tekton` directory, and the dependencies actually run depend on what matched the event. ## Decision * `DefinitionsFromPRs` reports an `on-pipelinerun` annotation that parses but lists nothing as an error and leaves the definition out: it would wait on nothing and stay pending forever. * `ValidateGraph` allows a follow-up to wait only on plain definitions (`ProblemChainedDependency` otherwise), rejects self references, missing and duplicate definitions, a missing CEL expression, and uppercase follow-up names because the run name is lowercased and names differing by case would collide. * Every `Problem` is fatal: `PlanFollowUps` returns without planning anything when there is one. * When every dependency started, the follow-up goes into `Create`. When only some did, it goes into `Skip`. When none did, it is in neither: it does not match the event. * `ResolveFollowUp` waits while any dependency run is not done. A dependency absent from the group (pruned) becomes a state with status `Error` and reason `Missing`, and the follow-up's CEL expression decides what to do with it. * `StatusFromPR` follows the check shown on the provider: only the Cancelled reason is `Cancelled`; a timeout is `Failed`. ## Consequences * One bad definition stops the planning of all follow-ups of the event. * Chains of follow-ups are not supported. * A pruned dependency does not block the follow-up forever; whether that is acceptable is left to its CEL expression.