Skip to content

Commit 6c2e73b

Browse files
committed
DOC: Clarify merge policy
1 parent 67aee6c commit 6c2e73b

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

doc/devel/pr_guide.rst

+20-12
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,24 @@ a corresponding branch.
176176

177177
Merging
178178
-------
179+
As a guiding principle, we require two `approvals`_ from core developers (those
180+
with commit rights) before merging a pull request. This two-pairs-of-eyes
181+
strategy shall ensure a consistent project direction and prevent accidental
182+
mistakes. It is permissible to merge with one approval if the change is not
183+
fundamental and can easily be reverted at any time in the future.
179184

180-
* Documentation and examples may be merged by the first reviewer. Use
185+
.. _approvals: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests
186+
187+
Some explicit rules following from this:
188+
189+
* *Documentation and examples* may be merged with a single approval. Use
181190
the threshold "is this better than it was?" as the review criteria.
182191

183-
* For code changes (anything in ``src`` or ``lib``) at least two
184-
core developers (those with commit rights) should review all pull
185-
requests. If you are the first to review a PR and approve of the
186-
changes use the GitHub `'approve review'
187-
<https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests>`__
188-
tool to mark it as such. If you are a subsequent reviewer please
189-
approve the review and if you think no more review is needed, merge
190-
the PR.
192+
* Minor *infrastructure updates*, e.g. temporary pinning of broken dependencies
193+
or small changes to the CI configuration, may be merged with a single
194+
approval.
195+
196+
* *Code changes* (anything in ``src`` or ``lib``) must have two approvals.
191197

192198
Ensure that all API changes are documented in a file in one of the
193199
subdirectories of :file:`doc/api/next_api_changes`, and significant new
@@ -205,9 +211,11 @@ Merging
205211
A core dev should only champion one PR at a time and we should try to keep
206212
the flow of championed PRs reasonable.
207213

208-
* Do not self merge, except for 'small' patches to un-break the CI or
209-
when another reviewer explicitly allows it (ex, "Approve modulo CI
210-
passing, may self merge when green").
214+
After giving the last required approval, the author of the approval should
215+
merge the PR. PR authors must not self-merge, except for when another reviewer
216+
explicitly allows it (e.g., "Approve modulo CI passing, may self merge when
217+
green", or "Take or leave the comments. You may self merge".).
218+
Core developers may also self-merge in exceptional emergency situations.
211219

212220
.. _pr-automated-tests:
213221

0 commit comments

Comments
 (0)