git.iko.soy/typeable/nixpkgs
on master help sign in
nixos-manual: reviewing chapter cleanup
caef192Eric Sagnes
nixos/doc/manual/development/reviewing-contributions.xml+168−67
@@ -6,73 +6,125 @@
6
6
7<title>Reviewing contributions</title>
7<title>Reviewing contributions</title>
8
8
9+<warning>
10+ <para>The following section is a draft and reviewing policy is still being
11+ discussed.</para>
12+</warning>
13+
9−<para>The nixpkgs projects receives a fairly high number of contributions via GitHub pull-requests. Reviewing and approving these is an important task and a way to contribute to the project.</para>
14+<para>The nixpkgs projects receives a fairly high number of contributions via
10−
15+ GitHub pull-requests. Reviewing and approving these is an important task and a
11−<para>The high change rate of nixpkgs make any pull request that is open for long enough subject to conflicts that will require extra work from the submitter or the merger. Reviewing pull requests in a timely manner and being responsive to the comments is the key to avoid these. Github provides sort filters that can be used to see the <link xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc">most recently</link> and the <link xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-asc">least recently</link> updated pull-requests.</para>
16+ way to contribute to the project.</para>
12−
17+
18+<para>The high change rate of nixpkgs make any pull request that is open for
19+ long enough subject to conflicts that will require extra work from the
20+ submitter or the merger. Reviewing pull requests in a timely manner and being
21+ responsive to the comments is the key to avoid these. Github provides sort
22+ filters that can be used to see the <link
23+ xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc">most
24+ recently</link> and the <link
25+ xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-asc">least
26+ recently</link> updated pull-requests.</para>
27+
28+<para>When reviewing a pull request, please always be nice and polite.
13−<para>When reviewing a pull request, please always be nice and polite. Controversial changes can lead to controversial opinions, but it is important to respect every community members and their work.</para>
29+ Controversial changes can lead to controversial opinions, but it is important
14−
30+ to respect every community members and their work.</para>
31+
32+<para>GitHub provides reactions, they are a simple and quick way to provide
15−<para>GitHub provides reactions, they are a simple and quick way to provide feedback to pull-requests or any comments. The thumb-down reaction should be used with care and if possible accompanied with some explanations so the submitter has directions to improve his contribution.</para>
33+ feedback to pull-requests or any comments. The thumb-down reaction should be
16−
34+ used with care and if possible accompanied with some explanations so the
35+ submitter has directions to improve his contribution.</para>
36+
17−<para>Pull-requests reviews should include a list of what has been reviewed in a comment, so other reviewers and mergers can know the state of the review.</para>
37+<para>Pull-requests reviews should include a list of what has been reviewed in a
18−
38+ comment, so other reviewers and mergers can know the state of the
39+ review.</para>
40+
19−<para>All the review template samples provided in this section are generic and meant as examples. Their usage is optional and the reviewer is free to adapt them to his liking.</para>
41+<para>All the review template samples provided in this section are generic and
42+ meant as examples. Their usage is optional and the reviewer is free to adapt
43+ them to his liking.</para>
20
44
21<section><title>Package updates</title>
45<section><title>Package updates</title>
22
46
47+<para>A package update is the most trivial and common type of pull-request.
23−<para>A package update is the most trivial and common type of pull-request. These pull-requests mainly consist in updating the version part of the package name and the source hash.</para>
48+ These pull-requests mainly consist in updating the version part of the package
49+ name and the source hash.</para>
24−<para>It can happen that non trivial updates include patches or more complex changes.</para>
50+<para>It can happen that non trivial updates include patches or more complex
51+ changes.</para>
25
52
26<para>Reviewing process:</para>
53<para>Reviewing process:</para>
27
54
28<itemizedlist>
55<itemizedlist>
29− <listitem><para>Add labels to the pull-request. (Requires commit rights)</para>
56+ <listitem><para>Add labels to the pull-request. (Requires commit
57+ rights)</para>
30 <itemizedlist>
58 <itemizedlist>
31− <listitem><para><literal>8.has: package (update)</literal> and any topic label that fit the updated package.</para></listitem>
59+ <listitem><para><literal>8.has: package (update)</literal> and any topic
60+ label that fit the updated package.</para></listitem>
32 </itemizedlist>
61 </itemizedlist>
33 </listitem>
62 </listitem>
34− <listitem><para>Ensure that the package versioning is fitting the guidelines.</para></listitem>
63+ <listitem><para>Ensure that the package versioning is fitting the
64+ guidelines.</para></listitem>
35− <listitem><para>Ensure that the commit text is fitting the guidelines.</para></listitem>
65+ <listitem><para>Ensure that the commit text is fitting the
66+ guidelines.</para></listitem>
36 <listitem><para>Ensure that the package maintainers are notified.</para>
67 <listitem><para>Ensure that the package maintainers are notified.</para>
37 <itemizedlist>
68 <itemizedlist>
38− <listitem><para>mention-bot usually notify GitHub users based on the submitted changes, but it can happen that it misses some of the package maintainers.</para></listitem>
69+ <listitem><para>mention-bot usually notify GitHub users based on the
70+ submitted changes, but it can happen that it misses some of the
71+ package maintainers.</para></listitem>
39 </itemizedlist>
72 </itemizedlist>
40 </listitem>
73 </listitem>
41− <listitem><para>Ensure that the meta field contains correct information.</para>
74+ <listitem><para>Ensure that the meta field contains correct
75+ information.</para>
42 <itemizedlist>
76 <itemizedlist>
43− <listitem><para>License can change with version updates, so it should be checked to be fitting upstream license.</para></listitem>
77+ <listitem><para>License can change with version updates, so it should be
78+ checked to be fitting upstream license.</para></listitem>
44− <listitem><para>If the package has no maintainer, a maintainer must be set. This can be the update submitter or a community member that accepts to take maintainership of the package.</para></listitem>
79+ <listitem><para>If the package has no maintainer, a maintainer must be
80+ set. This can be the update submitter or a community member that
81+ accepts to take maintainership of the package.</para></listitem>
45 </itemizedlist>
82 </itemizedlist>
46 </listitem>
83 </listitem>
47 <listitem><para>Ensure that the code contains no typos.</para></listitem>
84 <listitem><para>Ensure that the code contains no typos.</para></listitem>
48 <listitem><para>Building the package locally.</para>
85 <listitem><para>Building the package locally.</para>
49 <itemizedlist>
86 <itemizedlist>
50− <listitem><para>Pull-requests are often targeted to the master or staging branch so building the pull-request locally as it is submitted can trigger a large amount of source builds.</para>
87+ <listitem><para>Pull-requests are often targeted to the master or staging
88+ branch so building the pull-request locally as it is submitted can
89+ trigger a large amount of source builds.</para>
90+ <para>It is possible to rebase the changes on nixos-unstable or
51− <para>It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review by running the following commands from a nixpkgs clone.
91+ nixpkgs-unstable for easier review by running the following commands
92+ from a nixpkgs clone.
52<screen>
93<screen>
53−$ git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co xml:id='reviewing-rebase-1' />
94+$ git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
95+ xml:id='reviewing-rebase-1' />
54$ git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
96$ git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
55$ git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
97$ git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
56−$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co xml:id='reviewing-rebase-4' />
98+$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
99+ xml:id='reviewing-rebase-4' />
57</screen>
100</screen>
58 <calloutlist>
101 <calloutlist>
59 <callout arearefs='reviewing-rebase-1'>
102 <callout arearefs='reviewing-rebase-1'>
60− <para>This should be done only once to be able to fetch channel branches from the nixpkgs-channels repository.</para>
103+ <para>This should be done only once to be able to fetch channel
104+ branches from the nixpkgs-channels repository.</para>
61 </callout>
105 </callout>
62 <callout arearefs='reviewing-rebase-2'>
106 <callout arearefs='reviewing-rebase-2'>
63 <para>Fetching the nixos-unstable branch.</para>
107 <para>Fetching the nixos-unstable branch.</para>
64 </callout>
108 </callout>
65 <callout arearefs='reviewing-rebase-3'>
109 <callout arearefs='reviewing-rebase-3'>
66− <para>Fetching the pull-request changes, <varname>PRNUMBER</varname> is the number at the end of the pull-request title and <varname>BASEBRANCH</varname> the base branch of the pull-request.</para>
110+ <para>Fetching the pull-request changes, <varname>PRNUMBER</varname>
111+ is the number at the end of the pull-request title and
112+ <varname>BASEBRANCH</varname> the base branch of the
113+ pull-request.</para>
67 </callout>
114 </callout>
68 <callout arearefs='reviewing-rebase-3'>
115 <callout arearefs='reviewing-rebase-3'>
69− <para>Rebasing the pull-request changes to the nixos-unstable branch.</para>
116+ <para>Rebasing the pull-request changes to the nixos-unstable
117+ branch.</para>
70 </callout>
118 </callout>
71 </calloutlist>
119 </calloutlist>
72 </para>
120 </para>
73 </listitem>
121 </listitem>
74 <listitem>
122 <listitem>
75− <para>The <link xlink:href="https://github.com/madjar/nox">nox</link> tool can be used to review a pull-request content in a single command. It doesn't rebase on a channel branch so it might trigger multiple source builds. <varname>PRNUMBER</varname> should be replaced by the number at the end of the pull-request title.</para>
123+ <para>The <link xlink:href="https://github.com/madjar/nox">nox</link>
124+ tool can be used to review a pull-request content in a single command.
125+ It doesn't rebase on a channel branch so it might trigger multiple
126+ source builds. <varname>PRNUMBER</varname> should be replaced by the
127+ number at the end of the pull-request title.</para>
76<screen>
128<screen>
77$ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
129$ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
78</screen>
130</screen>
@@ -101,30 +153,43 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
101
153
102<section><title>New packages</title>
154<section><title>New packages</title>
103
155
104−<para>New packages are a common type of pull-requests. These pull requests consists in adding a new nix-expression for a package.</para>
156+<para>New packages are a common type of pull-requests. These pull requests
157+ consists in adding a new nix-expression for a package.</para>
105
158
106<para>Reviewing process:</para>
159<para>Reviewing process:</para>
107
160
108<itemizedlist>
161<itemizedlist>
109− <listitem><para>Add labels to the pull-request. (Requires commit rights)</para>
162+ <listitem><para>Add labels to the pull-request. (Requires commit
163+ rights)</para>
110 <itemizedlist>
164 <itemizedlist>
111− <listitem><para><literal>8.has: package (new)</literal> and any topic label that fit the new package.</para></listitem>
165+ <listitem><para><literal>8.has: package (new)</literal> and any topic
166+ label that fit the new package.</para></listitem>
112 </itemizedlist>
167 </itemizedlist>
113 </listitem>
168 </listitem>
114− <listitem><para>Ensure that the package versioning is fitting the guidelines.</para></listitem>
169+ <listitem><para>Ensure that the package versioning is fitting the
170+ guidelines.</para></listitem>
115− <listitem><para>Ensure that the commit name is fitting the guidelines.</para></listitem>
171+ <listitem><para>Ensure that the commit name is fitting the
172+ guidelines.</para></listitem>
116− <listitem><para>Ensure that the meta field contains correct information.</para>
173+ <listitem><para>Ensure that the meta field contains correct
174+ information.</para>
117 <itemizedlist>
175 <itemizedlist>
118− <listitem><para>License must be checked to be fitting upstream license.</para></listitem>
176+ <listitem><para>License must be checked to be fitting upstream
177+ license.</para></listitem>
119− <listitem><para>Platforms should be set or the package will not get binary substitutes.</para></listitem>
178+ <listitem><para>Platforms should be set or the package will not get binary
179+ substitutes.</para></listitem>
180+ <listitem><para>A maintainer must be set, this can be the package
120− <listitem><para>A maintainer must be set, this can be the package submitter or a community member that accepts to take maintainership of the package.</para></listitem>
181+ submitter or a community member that accepts to take maintainership of
182+ the package.</para></listitem>
121 </itemizedlist>
183 </itemizedlist>
122 </listitem>
184 </listitem>
123 <listitem><para>Ensure that the code contains no typos.</para></listitem>
185 <listitem><para>Ensure that the code contains no typos.</para></listitem>
124 <listitem><para>Ensure the package source.</para>
186 <listitem><para>Ensure the package source.</para>
125 <itemizedlist>
187 <itemizedlist>
126− <listitem><para>Mirrors urls should be used when available.</para></listitem>
188+ <listitem><para>Mirrors urls should be used when
189+ available.</para></listitem>
127− <listitem><para>The most appropriate function should be used (e.g. packages from GitHub should use <literal>fetchFromGitHub</literal>).</para></listitem>
190+ <listitem><para>The most appropriate function should be used (e.g.
191+ packages from GitHub should use
192+ <literal>fetchFromGitHub</literal>).</para></listitem>
128 </itemizedlist>
193 </itemizedlist>
129 </listitem>
194 </listitem>
130 <listitem><para>Building the package locally.</para></listitem>
195 <listitem><para>Building the package locally.</para></listitem>
@@ -158,36 +223,50 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
158
223
159<section><title>Module updates</title>
224<section><title>Module updates</title>
160
225
161−<para>Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options.</para>
226+<para>Module updates are submissions changing modules in some ways. These often
227+ contains changes to the options or introduce new options.</para>
162
228
163<para>Reviewing process</para>
229<para>Reviewing process</para>
164
230
165<itemizedlist>
231<itemizedlist>
166− <listitem><para>Add labels to the pull-request. (Requires commit rights)</para>
232+ <listitem><para>Add labels to the pull-request. (Requires commit
233+ rights)</para>
167 <itemizedlist>
234 <itemizedlist>
168− <listitem><para><literal>8.has: module (update)</literal> and any topic label that fit the module.</para></listitem>
235+ <listitem><para><literal>8.has: module (update)</literal> and any topic
236+ label that fit the module.</para></listitem>
169 </itemizedlist>
237 </itemizedlist>
170 </listitem>
238 </listitem>
171 <listitem><para>Ensure that the module maintainers are notified.</para>
239 <listitem><para>Ensure that the module maintainers are notified.</para>
172 <itemizedlist>
240 <itemizedlist>
173− <listitem><para>Mention-bot notify GitHub users based on the submitted changes, but it can happen that it miss some of the package maintainers.</para></listitem>
241+ <listitem><para>Mention-bot notify GitHub users based on the submitted
242+ changes, but it can happen that it miss some of the package
243+ maintainers.</para></listitem>
174 </itemizedlist>
244 </itemizedlist>
175 </listitem>
245 </listitem>
176− <listitem><para>Ensure that the module tests, if any, are succeeding.</para></listitem>
246+ <listitem><para>Ensure that the module tests, if any, are
247+ succeeding.</para></listitem>
177 <listitem><para>Ensure that the introduced options are correct.</para>
248 <listitem><para>Ensure that the introduced options are correct.</para>
178 <itemizedlist>
249 <itemizedlist>
179− <listitem><para>Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).</para></listitem>
250+ <listitem><para>Type should be appropriate (string related types differs
251+ in their merging capabilities, <literal>optionSet</literal> and
252+ <literal>string</literal> types are deprecated).</para></listitem>
180− <listitem><para>Description, default and example should be provided.</para></listitem>
253+ <listitem><para>Description, default and example should be
254+ provided.</para></listitem>
181 </itemizedlist>
255 </itemizedlist>
182 </listitem>
256 </listitem>
183 <listitem><para>Ensure that option changes are backward compatible.</para>
257 <listitem><para>Ensure that option changes are backward compatible.</para>
184 <itemizedlist>
258 <itemizedlist>
259+ <listitem><para><literal>mkRenamedOptionModule</literal> and
185− <listitem><para><literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.</para></listitem>
260+ <literal>mkAliasOptionModule</literal> functions provide way to make
261+ option changes backward compatible.</para></listitem>
186 </itemizedlist>
262 </itemizedlist>
187 </listitem>
263 </listitem>
188− <listitem><para>Ensure that removed options are declared with <literal>mkRemovedOptionModule</literal></para></listitem>
264+ <listitem><para>Ensure that removed options are declared with
265+ <literal>mkRemovedOptionModule</literal></para></listitem>
189− <listitem><para>Ensure that changes that are not backward compatible are mentioned in release notes.</para></listitem>
266+ <listitem><para>Ensure that changes that are not backward compatible are
267+ mentioned in release notes.</para></listitem>
190− <listitem><para>Ensure that documentations affected by the change is updated.</para></listitem>
268+ <listitem><para>Ensure that documentations affected by the change is
269+ updated.</para></listitem>
191</itemizedlist>
270</itemizedlist>
192
271
193<example><title>Sample template for a module update review</title>
272<example><title>Sample template for a module update review</title>
@@ -215,27 +294,38 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
215<para>New modules submissions introduce a new module to NixOS.</para>
294<para>New modules submissions introduce a new module to NixOS.</para>
216
295
217<itemizedlist>
296<itemizedlist>
218− <listitem><para>Add labels to the pull-request. (Requires commit rights)</para>
297+ <listitem><para>Add labels to the pull-request. (Requires commit
298+ rights)</para>
219 <itemizedlist>
299 <itemizedlist>
220− <listitem><para><literal>8.has: module (new)</literal> and any topic label that fit the module.</para></listitem>
300+ <listitem><para><literal>8.has: module (new)</literal> and any topic label
301+ that fit the module.</para></listitem>
221 </itemizedlist>
302 </itemizedlist>
222 </listitem>
303 </listitem>
223− <listitem><para>Ensure that the module tests, if any, are succeeding.</para></listitem>
304+ <listitem><para>Ensure that the module tests, if any, are
305+ succeeding.</para></listitem>
224 <listitem><para>Ensure that the introduced options are correct.</para>
306 <listitem><para>Ensure that the introduced options are correct.</para>
225 <itemizedlist>
307 <itemizedlist>
226− <listitem><para>Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).</para></listitem>
308+ <listitem><para>Type should be appropriate (string related types differs
309+ in their merging capabilities, <literal>optionSet</literal> and
310+ <literal>string</literal> types are deprecated).</para></listitem>
227− <listitem><para>Description, default and example should be provided.</para></listitem>
311+ <listitem><para>Description, default and example should be
312+ provided.</para></listitem>
228 </itemizedlist>
313 </itemizedlist>
229 </listitem>
314 </listitem>
230− <listitem><para>Ensure that module <literal>meta</literal> field is present</para>
315+ <listitem><para>Ensure that module <literal>meta</literal> field is
316+ present</para>
231 <itemizedlist>
317 <itemizedlist>
232− <listitem><para>Maintainers should be declared in <literal>meta.maintainers</literal>.</para></listitem>
318+ <listitem><para>Maintainers should be declared in
319+ <literal>meta.maintainers</literal>.</para></listitem>
233− <listitem><para>Module documentation should be declared with <literal>meta.doc</literal>.</para></listitem>
320+ <listitem><para>Module documentation should be declared with
321+ <literal>meta.doc</literal>.</para></listitem>
234 </itemizedlist>
322 </itemizedlist>
235 </listitem>
323 </listitem>
236− <listitem><para>Ensure that the module respect other modules functionality.</para>
324+ <listitem><para>Ensure that the module respect other modules
325+ functionality.</para>
237 <itemizedlist>
326 <itemizedlist>
238− <listitem><para>For example, enabling a module should not open firewall ports by default.</para></listitem>
327+ <listitem><para>For example, enabling a module should not open firewall
328+ ports by default.</para></listitem>
239 </itemizedlist>
329 </itemizedlist>
240 </listitem>
330 </listitem>
241</itemizedlist>
331</itemizedlist>
@@ -265,16 +355,23 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
265
355
266<para>Other type of submissions requires different reviewing steps.</para>
356<para>Other type of submissions requires different reviewing steps.</para>
267
357
358+<para>If you consider having enough knowledge and experience in a topic and
268−<para>If you consider having enough knowledge and experience in a topic and would like to be a long-term reviewer for related submissions, please contact the current reviewers for that topic. They will give you information about the reviewing process.
359+ would like to be a long-term reviewer for related submissions, please contact
360+ the current reviewers for that topic. They will give you information about the
361+ reviewing process.
362+The main reviewers for a topic can be hard to find as there is no list, but
269−The main reviewers for a topic can be hard to find as there is no list, but checking past pull-requests to see who reviewed or git-blaming the code to see who committed to that topic can give some hints.</para>
363+checking past pull-requests to see who reviewed or git-blaming the code to see
364+who committed to that topic can give some hints.</para>
270
365
271−<para>Container system, boot system and library changes are some examples of the pull requests fitting this category.</para>
366+<para>Container system, boot system and library changes are some examples of the
367+ pull requests fitting this category.</para>
272
368
273</section>
369</section>
274
370
275<section><title>Merging pull-requests</title>
371<section><title>Merging pull-requests</title>
276
372
373+<para>It is possible for community members that have enough knowledge and
277−<para>It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.</para>
374+ experience on a special topic to contribute by merging pull requests.</para>
278
375
279<para>TODO: add the procedure to request merging rights.</para>
376<para>TODO: add the procedure to request merging rights.</para>
280
377
@@ -283,10 +380,14 @@ The following paragraph about how to deal with unactive contributors is just a
283proposition and should be modified to what the community agrees to be the right
380proposition and should be modified to what the community agrees to be the right
284policy.
381policy.
285
382
286−<para>Please note that contributors with commit rights unactive for more than three months will have their commit rights revoked.</para>
383+<para>Please note that contributors with commit rights unactive for more than
384+ three months will have their commit rights revoked.</para>
287-->
385-->
288
386
289−<para>In a case a contributor leaves definitively the Nix community, he should create an issue or notify the mailing list with references of packages and modules he maintains so the maintainership can be taken over by other contributors.</para>
387+<para>In a case a contributor leaves definitively the Nix community, he should
388+ create an issue or notify the mailing list with references of packages and
389+ modules he maintains so the maintainership can be taken over by other
390+ contributors.</para>
290
391
291</section>
392</section>
292</chapter>
393</chapter>