--- title: "ADR 0094: Follow-ups are planned last and are not resolved, triggered or tested at event time" --- * Status: accepted * Code: [`pkg/pipelineascode/match.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/match.go), [`pkg/pipelineascode/pipelineascode.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/pipelineascode.go) * See: [ADR 0058]({{< relref "0058-followup-dependency-graph.md" >}}), [ADR 0079]({{< relref "0079-follow-up-cel-evaluation.md" >}}), [ADR 0080]({{< relref "0080-retest-skips-successful-templates.md" >}}) ## Context A follow-up is created by the watcher once its dependencies are done (ADR 0058, ADR 0079), so what happens at event time must not depend on it being startable. ## Decision * With `EnableFollowUpRuns`, the raw templates are checked by `validateFollowUpTemplates` before matching. The watcher resolves a follow-up again when the webhook payload no longer exists, so payload-only template variables are rejected at event time instead of being left unreplaced. * `allDefinitions` is captured before remote task resolution narrows the list, and the follow-up graph is validated over all of them. * Matched follow-ups are skipped by `resolve.Resolve` and appended afterwards, so a remote task referenced only by a follow-up cannot fail the event of its dependencies. * An incoming webhook or `/test` aimed at a definition with dependencies is rejected, since it only runs after its dependencies of the same event. A broken `on-pipelinerun` annotation counts as a follow-up (`//nolint:nilerr` returns no error). * For an incoming webhook the follow-up definitions are kept next to the target so planning can keep those depending on it. * `planFollowUps` runs last: `/retest` removes already-succeeded templates from both the matched and unmatched lists, and a follow-up waiting on one must not look like it has a missing dependency. * `Run` stamps `groupID` on every run and the follow-ups on the dependency runs before creation, and `templatedEvent` keeps the event as templated for the watcher. ## Consequences * A broken follow-up annotation is silently dropped for incoming webhooks, with only an event message.