--- title: "ADR 0015: GitHub check run and status reporting" --- * Status: accepted * Code: [`pkg/provider/github/status.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/provider/github/status.go) ## Context With an installation ID the provider reports through the Checks API; otherwise it uses the commit status API. Several GitHub behaviours shape the code. ## Decision * A check run is created fully formed (output annotations, and conclusion and completion time when already finished) and `getOrUpdateCheckRunStatus` returns right after creating it. A follow-up update on a run GitHub may not yet report as existing would race with its visibility. * When the check run id comes from the PipelineRun annotation, an update that gets HTTP 404 is retried with exponential backoff (`checkRunUpdateMaxRetries`, `checkRunUpdateInitialBackoff`), because another reconcile may have created the run milliseconds earlier. 404 is retried only for ids read from the annotation (`retryNotFound` is `found`); any other error, and a 404 on a run we just looked up, is returned as is. * When several PipelineRuns fail to start (`Title == "Failed"` and no PipelineRun name), the title is changed to `pipelinerun start failure` and only one check run is generated: callers with `InstanceCountForCheckRun >= 1` return without doing anything. * The PipelineRun is patched with the check run id and log URL only when it has a name or generate name and the report is not an unmatched report: on validation failure the PipelineRun struct is passed but is not a resource that exists in the cluster. * Failure annotations strip a leading `./` from the file name taken from the log line, because GitHub does not accept it as an annotation path. * The commit status API has no `neutral` or `skipped` state, so both are sent as `success`. ## Consequences * The retry window is fixed in constants; a slower GitHub visibility delay still fails the update. * The annotation path normalisation only strips a single leading `./`.