--- title: "ADR 0097: Follow-up skip, consume and cancel semantics" --- * Status: accepted * Code: [`pkg/pipelineascode/followups.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/followups.go) ## Context A waiting follow-up has no run and so no check on the commit. Its fate has to be recorded on the carrying run, and a cancel must not leave it to be created later. ## Decision * `reportFollowUps` runs after creation. A follow-up whose dependencies all ran waits silently. If some did not, it first looks up the deterministic run name: found means the watcher created it and it is marked created; not found means a skipped check and the skipped state. A lookup error leaves it pending, and the code says a reconcile of a done group member resolves it. * Follow-ups share one annotation on the carrying run, so `consumeFollowUpOnRun` re-reads the run and patches with its `resourceVersion` inside `RetryOnConflict`, so a concurrent consume conflicts instead of overwriting. * `cancelFollowUps` consumes pending follow-ups as cancelled, posts a cancelled check (the only trace of a follow-up that waited), then looks up the run by name and cancels it if not finished, since the watcher may have been creating it meanwhile. * The check goes on the commit of the run's own event (`eventForRun`), not of the event doing the cancelling. * Runs carrying the current event's group ID are skipped: their follow-ups belong to the event doing the cancelling and keep waiting. ## Consequences * A failed consume is only logged as an event; the follow-up may then be evaluated again. * The group guard only matters for cancel-in-progress; cancel comments and closed pull requests run before a group exists.