Code owner approval
Code owner approval blocks a merge until an owner of the changed files approves. How the rule works, and how it sits next to the approval in AI CodeOps.
Code owner approval is a branch protection setting that stops a pull request from merging until an owner of the files it changes has approved it. Owners come from the repository's CODEOWNERS file.
What it is
On GitHub, the setting is Require review from Code Owners, under the pull request review options of a branch protection rule or a ruleset. With it on, any pull request that touches owned code must be approved by one of that code's owners before it can merge (About code owners).
Two details matter:
- Approval from any one listed owner satisfies the rule.
- The CODEOWNERS file can itself be changed in a pull request, so give the file, or the
.github/folder, an owner too.
Why it matters
A required review from "anyone" can come from someone who doesn't know the code. Code owner approval sends risky changes to the people who know that part of the system.
In AI CodeOps
AI CodeOps has its own approval, earlier in the flow: a session's change opens as a pull request only after a workspace member with the approval:decide permission approves it. Built-in Developers can run sessions but can't approve them. Code owner review then happens on the pull request, on your provider, and the provider enforces it when you merge from the console.
Frequently asked questions
Does every code owner have to approve?
No. On GitHub, approval from any one of the owners listed for the changed files is enough.
Does the AI CodeOps approval replace code owner review?
No. They happen at different points. The AI CodeOps approval comes before the pull request opens; code owner review happens on the pull request.