--- title: "ADR 0098: Follow-up definitions are re-resolved at creation, not stored" --- * Status: accepted * Code: [`pkg/pipelineascode/followup_resolve.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/followup_resolve.go), [`pkg/pipelineascode/followups.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/pipelineascode/followups.go) ## Context The stored follow-up carries its name, dependencies, state and a captured copy of the event, not the PipelineRun itself. The watcher still has to produce a runnable PipelineRun when the dependencies are done. ## Decision * `ResolveFollowUpDefinition` fetches the `.tekton` directory at the event's pinned revision and repeats the event-time steps: template variables with the captured custom param filters, metadata resolution, remote tasks, and the git auth secret (`withGitAuthSecret`). * The definition is not stored, so annotation size limits do not apply to it. Repository content is pinned by the revision; remote tasks are fetched as they are at creation time. * With remote tasks enabled only the named definition is resolved, so a broken unrelated definition cannot fail it. The event side does the opposite for follow-ups: they are not resolved at event time, so a remote task only a follow-up references cannot fail its dependencies. * A definition absent from the fetched directory returns `ErrFollowUpDefinitionNotFound`, documented as permanent: the entry is skipped, not requeued. * `captureFollowUpEvent` records which custom param filters matched, never the values; if evaluating them fails, it records none. ## Consequences * A remote task that changed between the event and the creation changes the created run. * Each creation costs a fetch of the `.tekton` directory and a template pass. * The code gives provenance drift and a removal after the event as the causes of a missing definition; it does not show how often either happens.