--- title: "ADR 0088: Follow-ups are re-evaluated from the reconcile of any group member" --- * Status: accepted * Code: [`pkg/reconciler/followup.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/reconciler/followup.go) ## Context A follow-up is stored on a run of its group and waits on other definitions (see [ADR 0058]({{< relref "0058-followup-dependency-graph.md" >}})). Nothing in the code keeps a separate queue of them: the state lives on the PipelineRuns, and the controller can restart or miss an event between a dependency finishing and the follow-up being created. ## Decision * `evaluateFollowUpsOf` runs on the reconcile of a run that is already done and evaluates every pending follow-up of its group, so a restart or a missed event is recovered by the next reconcile. * A follow-up consumed outside the watcher (a `/cancel`, an event time skip) patches the run that stores it, which re-enqueues that run and so reaches its dependents the same way. * A follow-up still waiting returns before any API call; the definition is only re-resolved once every dependency is done. * `evaluateGroup` keeps going after a failing follow-up and returns the joined errors, so the siblings are evaluated and the run is requeued to retry the broken one. * When a follow-up ends skipped, failed or cancelled, `evaluateDependentsOf` re-evaluates the follow-ups waiting on its definition. * When `EnableFollowUpRuns` is off, nothing is created and whatever is stored on the runs is left untouched. * `finalizeFollowUps` handles a run being deleted: its own pending follow-ups are skipped when they depend on it and evaluated otherwise, and the ones on other runs waiting on its definition are re-evaluated with it excluded from the group, so they see it gone. ## Consequences * Evaluation is driven by reconciles, so a follow-up is only as prompt as the next reconcile of a group member. * One broken follow-up is retried on every requeue of the run until it reaches a terminal state. * Turning the feature off freezes pending follow-ups instead of cancelling them.