Who can satisfy a required review#
GitHub's docs state the requirement in terms of permission: with required reviews, "collaborators can only push changes to a protected branch via a pull request that is approved by the required number of reviewers with write permissions." About protected branches In the role table for organization repositories, "Approve or request changes to a pull request with required reviews" is granted to Write, Maintain and Admin, and not to Read, Triage or Moderate. Repository roles for an organization
Anyone else can still review. "Anyone with read access can review and comment on proposed changes." Pull request reviews When a repository requires approving reviews from people with write or admin permissions, the reviewers sidebar keeps the two kinds apart: approvals that count sit in its top section, and "the collapsible section (if present) shows approvals from reviewers whose reviews do not affect whether the pull request can be merged." Approving a pull request with required reviews
The same limit applies to blocking. A changes-requested review holds the pull request only when it comes from "a collaborator with admin, owner, or write access to the repository." Approving a pull request with required reviews
Ownership rules repeat the condition. Code owners "must have write permissions for the repository," and a team that owns code "must be visible and it must have write permissions, even if all the individual members of the team already have write permissions directly." About code owners A team in a ruleset's Required reviewers list needs "write permissions (or higher) for the repository" for its members' approvals to count. Required reviewers
A fictional open-source review that did not count either way#
Suppose a fictional open-source project, acme-oss/tzparse, requires one approval on main. Two maintainers have write access. Vera, a long-time contributor with the Triage role, does most first-pass reviews.
A contributor opens a pull request that changes how the parser handles a time zone abbreviation shared by two regions. Vera requests changes: the new rule picks the wrong region for half the users who rely on it, and she links the upstream data. A maintainer, Walt, reads the code, sees green tests, and approves without opening Vera's review. The pull request merges. Vera's request never blocked it, because she does not have write access, and nothing in the merge box made Walt read it.
The same gap runs the other way. On another pull request, Vera approves and the author waits, assuming the review is done, while the merge box still asks for an approval nobody has been asked to give.
What the write-access rule does not catch#
Write access is a permission, not a measure of expertise. Any writer's approval satisfies the general count, including one from someone who has never read the code in question. In the example, the person who knew the domain was the one whose review the rule ignored.
It also does not stop people with write access from merging past a non-writer's objection. If a non-writer's concern should hold the merge, a writer has to turn it into a review that blocks.
The cost of each way to fix it#
Granting Write to trusted reviewers makes their reviews count, and it also lets them push to the repository and merge wherever branch rules allow. For many projects that is more trust than a reviewer needs. Keeping them on Triage costs maintainers a step: a maintainer must read the outside review and act on it.
Required reviewer teams and code owners narrow whose approval counts on sensitive paths, but both need write access on the team, so they do not help a reviewer who lacks it.
Decide#
- List whose judgment should be able to hold or release a merge on each important path. Those people need write access, through a team that has explicit write access if they own code.
- For everyone else, write the convention down: their reviews are advice, and a maintainer who approves must first read and answer any changes-requested review from someone without write access.
- When a maintainer agrees with an outside objection, the maintainer requests changes, so the hold becomes one the rule enforces.
- On paths where a specific team must approve, use code owners or a required reviewer team, and confirm the team's repository permission is Write or higher.
The guide to code owner enforcement covers making ownership required, and the guide to the approval count covers how many writers to require.