--- title: "ADR 0079: Follow-up PipelineRuns match on dependencies and a restricted CEL" --- * Status: accepted * Code: [`pkg/matcher/annotation_matcher.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/matcher/annotation_matcher.go), [`pkg/matcher/cel.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/matcher/cel.go) ## Context A PipelineRun definition carrying the `on-pipelinerun` annotation is a follow-up: it is planned at event time but its run is created later by the watcher, once its dependencies are done. Its `on-cel-expression` therefore cannot be evaluated by the matcher with the webhook payload. The comments in `celEnv` state that the changed files cannot be read reliably at that point, because some providers take them from the payload and others from the live pull request diff. ## Decision * `MatchPipelinerunByAnnotation` sets `Match.Config[ConfigFollowUp] = "true"` and matches the definition without evaluating any other annotation. * `celEnv` with `followUp` true declares `runs` and omits `headers`, `body`, `files` and the `pathChanged` library. `runs` is also reserved against custom parameters (`followUpParams`). * `EvaluateFollowUp` evaluates the expression later with the same variables, `refs/heads/` handling and custom parameters as the matcher, on a copy of the event. * `ValidateFollowUp` compiles the expression at event time. When compilation fails and the expression calls `pathChanged`, the error tells the user to put the path condition on the dependencies. * A follow-up is only kept when at least one plain definition matched; otherwise all matches move to the unmatched map. * In `filterSuccessfulTemplates` follow-ups are never filtered, even if their own previous run succeeded, so they are re-planned whenever the dependencies re-run. The code does not show where the follow-up planning decides their fate. ## Consequences * A follow-up cannot filter on payload content or changed files; only event variables, custom parameters and `runs`. * A push or comment that matches nothing but follow-ups matches nothing at all. * The reliability concern about changed files is the stated reason in the original comment; it is not enforced by anything other than the missing variables.