--- title: "ADR 0024: Gitea commit status mapping and retry" --- * Status: accepted * Code: [`pkg/provider/gitea/gitea.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/provider/gitea/gitea.go) (`CreateStatus`, `createStatusCommit`) ## Context PAC conclusions (success, failure, pending, neutral, skipped, cancelled, completed) are written as Forgejo/Gitea commit statuses. The commit status API only has success, failure, error, warning and pending. Under concurrent load the server can reject `CreateStatus` with a "user does not exist" error that goes away on a later attempt. ## Decision `createStatusCommit` maps conclusions to states: * neutral and skipped become `StatusSuccess`: neutral has no pending-like equivalent, and skipped is neither pending nor failure. * cancelled becomes `StatusWarning`, because the API has no cancelled state. * The state starts as the conclusion itself (`forgejo.StatusState(status.Conclusion)`), so `pending` becomes `StatusPending` with or without a title. Only `neutral` and `skipped` are overridden, to `StatusSuccess`, and `Status == "in_progress"` forces `StatusPending`. * every other conclusion keeps its own name as the state. `CreateStatus` is attempted up to three times. Only errors containing `user does not exist` are retried, with a sleep of `(attempt) * 500ms` taken from the provider clock so tests can drive it; any other error returns immediately. ## Consequences * A skipped or neutral run shows green on the commit; the title and description are what tell it apart. * Retrying matches on the error text, so a change in server wording silently disables the retry. * This application-level retry is separate from the HTTP retry transport enabled by `EnableAPIRetry`.