1
1
Review Policy
2
2
=============
3
3
4
+ This document describes our review policy for contributions to the Rust
5
+ compiler. Its intended audience are contributors and reviewers as well.
6
+
7
+ The purpose of this policy is to help contributors shape pull requests that
8
+ are easier to review - by clarifying the Rust project expectations - and for
9
+ reviewers as well - by having a handy list of common things to check. The
10
+ project will benefit if both parties have clear how to work together.
11
+
4
12
It is the purpose of code reviews to:
5
13
6
14
- ** Reduce** the risk of introducing ** bugs** and usability and performance
@@ -43,9 +51,10 @@ be effective:
43
51
for answering this question.
44
52
- Procedure wise, the reviewer also needs to decide:
45
53
- Can the reviewer make the decision alone?
46
- - Does the PR needs to go through the [ Major Change Process] [ mcp ] , or does
47
- it need a T-compiler [ Final Comment Period] [ fcp ] sign-off, or does it need
48
- a full [ Request For Comments (RFC)] [ rfc ] ?
54
+ - Does the PR needs to go through the [ Major Change Process] [ MCP ] , or does
55
+ it need a T-compiler Final Comment Period sign-off (a buffer of time to
56
+ allow last comments or concerns before an official approval), or does it
57
+ need a full [ Request For Comments (RFC)] [ rfc ] ?
49
58
- Does the PR need reviews and/or sign-off from other teams, particularly
50
59
T-lang?
51
60
- Can the changes break stable code or begin accepting new code that we do
@@ -78,7 +87,7 @@ bring PRs into good shape and meet the above criteria:
78
87
> * ** Links to relevant issues** , RFCs, MCPs, etc?
79
88
> * Does the PR need a ** regression test** ? Does the PR have ** sufficient test
80
89
> coverage** ?
81
- > * Does the change need to be covered by a ** [ major change proposal] [ mcp ] ** ? Is
90
+ > * Does the change need to be covered by a ** major change proposal ( [ MCP ] ) ** ? Is
82
91
> it already covered? If there is already a MCP open, was it already accepted,
83
92
> or is the PR blocked on that?
84
93
> * Does the PR need a ** perf run** ?
@@ -146,7 +155,7 @@ depending on the concrete case:
146
155
able to review it, or even if the team is comfortable with accepting the
147
156
change at all.
148
157
- If the change is intended for another team, roll a reviewer from the relevant
149
- team.
158
+ team (example ` r? compiler ` )
150
159
151
160
You can also always ask for help on the ` #t-compiler ` Zulip stream for finding a
152
161
reviewer. That being said, you are always welcome to do an initial review (to
@@ -157,7 +166,7 @@ understanding of diverse areas in the compiler.
157
166
158
167
### It is unclear if something constitutes a major change
159
168
160
- Deciding if something is a "major change" requiring an [ MCP] [ mcp ] is not always
169
+ Deciding if something is a "major change" requiring an [ MCP] is not always
161
170
straightforward. The official guidelines are [ here] [ whats-a-major-change ] . When
162
171
in doubt, err on side of treating something as a major change. You can also
163
172
nominate the PR for discussion in the compiler team's triage meeting by tagging
@@ -216,7 +225,7 @@ discussed and cleared up? Then you are in the clear.
216
225
If you are in doubt if something is contentious, give a heads up to
217
226
`@rust-lang/compiler` and ask for another opinion. If the proposed change is
218
227
large and/or potentially has a big impact, you can discuss in a `#t-compiler`
219
- zulip topic, and/or create a [Major Change Proposal][mcp ].
228
+ zulip topic, and/or create a [Major Change Proposal][MCP ].
220
229
221
230
### Reviewing and Mentoring
222
231
@@ -246,7 +255,7 @@ and blindspots a mentor might have.
246
255
Sometimes there is a bug in some code that nobody understands anymore. The
247
256
original authors are unavailable and it is hard to gauge the implications of a
248
257
proposed fix. In such a case it is a good idea for reviewers to
249
- `I-compiler-nominate ` the PR (if they intend to stay the main reviewer) or
258
+ `I-compiler-nominated ` the PR (if they intend to stay the main reviewer) or
250
259
assign a compiler team lead to the issue and add the `S-waiting-on-team` label.
251
260
252
261
In both cases, the PR will be brought in the weekly triage meeting. It is also
@@ -280,7 +289,7 @@ get pinged on changes to these parts).
280
289
Require a doc comment on such APIs identifying which external consumers the API
281
290
concerns, and for what kinds of purpose.
282
291
283
- If this is possibly contentious, ask for an [mcp ].
292
+ If this is possibly contentious, ask for an [MCP ].
284
293
285
294
Note that this can non-obviously bound supposedly-internal compiler APIs to
286
295
external consumers. Convey to the external consumers (that are not `rust-lang/`
@@ -291,7 +300,14 @@ refactorings, and no hard stability guarantees are promised.
291
300
### The PR is very large and complicated
292
301
293
302
Reviewers are **not** expected to stomach PRs that are very large and
294
- complicated. Bring the PR to the attention of the team (through zulip threads
303
+ complicated. It is expected from contributors to split their work to make a
304
+ review feasable, for example a series of more digestible PRs which are
305
+ individually more logically self-contained. In general, before submitting large
306
+ impact changes, it is expected the contributor to have discussed the design
307
+ previously with the relevant team(s) so it is contributor's duty to reference
308
+ such discussions.
309
+
310
+ When in doubt, bring the PR to the attention of the team (through zulip threads
295
311
and/or nominate for compiler triage meeting), and the team can decide if:
296
312
297
313
- The team can find suitable reviewers who can aid the PR author to break up the
@@ -304,7 +320,7 @@ and/or nominate for compiler triage meeting), and the team can decide if:
304
320
a PR stalls for many months only for it to be rejected anyway.
305
321
306
322
307
- [mcp ]: https://forge.rust-lang.org/compiler/mcp.html
323
+ [MCP ]: https://forge.rust-lang.org/compiler/mcp.html
308
324
[whats-a-major-change]:
309
325
https://forge.rust-lang.org/compiler/mcp.html#what-constitutes-a-major-change
310
326
0 commit comments