Skip to content

Code ownership

Ownership is declared next to the code it governs. An OWNERS.toml in any directory requires review approval for changes beneath it.

[approvals]
owners = ["user:alice", "user:bob"]
min = 1

Full schema: OWNERS.toml, or garden docs owners.

A changed file is governed by the OWNERS.toml in its own directory and every one above it. A change to services/api/auth/token.go might need approval from the auth owners, the api owners, and a repository-wide owner — each scope evaluated independently.

To stop inheriting, sever the chain:

no_parent = true
[approvals]
owners = ["user:carol"]

A scope can require nothing:

no_parent = true
[approvals]
min = 0

With no_parent, this is the standard shape for generated code: no owner needed beneath it, and the repository-wide owners above aren’t dragged in either.

A positive min with no owners is rejected — it could never be satisfied.

Owners are kind:id. Only user:<id> is supported today; team:<id> is reserved.

min is the number of distinct, non-author approvals a scope needs, defaulting to 1. Authors never approve their own change, however many scopes they own.

At merge time, not push time. garden pr merge computes the changed-file set, loads every governing scope, and requires each to have at least min distinct non-author owners with an APPROVED review — one of the three merge gates.

garden pr view 42 shows which approvals are outstanding.