--- title: "ADR 0006: OWNERS parsing only trusts the catch-all filter" --- * Status: accepted * Code: [`pkg/acl/owners.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/acl/owners.go) ## Context `/ok-to-test` on a pull request is authorised against the repository's `OWNERS` file, parsed in the Kubernetes Prow format. Two dialects exist in the wild: * the simple config, a flat `approvers` / `reviewers` list * the filters config, a map from file glob to `approvers` / `reviewers`, so different directories have different owners PAC reads `OWNERS` once per event, in the provider-specific ACL check, and the answer it needs is a single yes/no for the sender. It has no concept of a user who owns one directory: `/ok-to-test` either grants the retest on the whole pull request or it does not. ## Decision * The simple config wins when present; filters are consulted only when it is absent, because the two are not meant to be combined. * When filters are used, only the `.*` entry is read. Per-glob entries are ignored, so a repository that lists owners only under `src/.*` grants nobody the right to retest the pull request. * Alias expansion (`OWNERS_ALIASES`) is a set operation over a `map[string]bool`, and the result order is deliberately unspecified. Tests compare membership, never sequence. ## Consequences * Filter-based `OWNERS` files that do not have a `.*` entry silently deny `/ok-to-test` to everyone. The alternative (unioning every glob) would let a directory owner approve changes anywhere in the repository. * Callers must not depend on the order of the owners slice, and any future code that reports owners back to the user needs to sort first. * Two people are deduplicated to one if they appear both directly and through an alias. That is the intent, and it is why the order cannot be preserved without a second pass.