--- title: "ADR 0025: Gitea comment updates only touch PAC-owned comments" --- * Status: accepted * Code: [`pkg/provider/gitea/gitea.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/provider/gitea/gitea.go) (`CreateComment`) ## Context `CreateComment` with an update marker looks for an existing pull request comment containing the marker and edits it instead of posting a new one. The marker is matched on comment body only, so a comment written by another user or bot could match. ## Decision On a body match, the poster ID is compared with the ID of the user behind PAC's credentials (`GetMyUserInfo`, fetched lazily and cached in `pacUserID`). Matching comments by other posters are logged at debug level and skipped; the first matching comment owned by PAC is edited. If none qualifies, a new comment is created. ## Consequences * PAC never edits a foreign comment that happens to contain the marker. * Changing the token to a different Gitea user means older PAC comments are no longer updated; new ones are created. * The first update on a provider instance costs one extra API call.