--- title: "ADR 0096: Follow-up planning rejects the whole event on any validation error" --- * Status: accepted * Code: [`pkg/pipelineascode/followups.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/followups.go) ## Context Follow-ups are resolved again by the watcher at creation, when the webhook payload is gone (see [ADR 0079]({{< relref "0079-follow-up-cel-evaluation.md" >}}) for the restricted CEL). A problem found only then would leave a half-started chain, so planning checks what it can at event time. ## Decision * When `EnableFollowUpRuns` is off, matches flagged as follow-ups are dropped, never run as plain runs, and a message tells the user to set `enable-follow-up-runs`. Running them would evaluate their CEL before their dependencies are done. * When no definition has dependencies, the follow-up flag is cleared and the matches run as plain runs; invalid annotations are reported instead if there are any. * The CEL of every follow-up is compiled at event time (`ValidateFollowUp`) with the Repository's custom param names. * Planning adds validation errors for graph problems, for a follow-up whose dependencies run with a different Repository (`crossRepositoryFollowUps`: the watcher creates it with the Repository of the carrying run), and for an incoming webhook that overrides params (their values are not stored). * `validateFollowUpTemplates` rejects template variables starting with `body`, `headers` or `files`, and CEL that references them, in follow-up documents, before the event-time templating runs. * Any validation error is reported and `planFollowUps` returns no runs at all: the code says some runs would otherwise leave chains half-started. * On a /retest or /ok-to-test, plain definitions missing from both match lists are taken as already succeeded; a follow-up depending on one is not re-created. ## Consequences * One invalid follow-up blocks every run of the event, including unrelated plain runs. * Incoming webhooks with param overrides cannot trigger follow-ups; params must be set in the Repository. * The retest handling infers success from absence, so it depends on the matcher dropping succeeded templates (see [ADR 0080]({{< relref "0080-retest-skips-successful-templates.md" >}})).