git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #19135 from ericsagnes/manual/reviewing-refactor

nixos-manual: reviewing chapter cleanup

commit7c2077306e23b239746975c25bcad4ceb3f787d2 authorJoachim F <joachifm@users.noreply.github.com> dateSat 1 Oct 2016, 18:10 (10 years ago) parent206851bcaef192
1 file changed+168−67
nixos/doc/manual/development/reviewing-contributions.xml+168−67
nixos/doc/manual/development/reviewing-contributions.xml+168−67
@@ -6,73 +6,125 @@
66
77<title>Reviewing contributions</title>
88
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>
10−
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>
12−
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>
14−
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>
16−
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>
18−
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>
9+<warning>
10+ <para>The following section is a draft and reviewing policy is still being
11+ discussed.</para>
12+</warning>
13+
14+<para>The nixpkgs projects receives a fairly high number of contributions via
15+ GitHub pull-requests. Reviewing and approving these is an important task and a
16+ way to contribute to the project.</para>
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.
29+ Controversial changes can lead to controversial opinions, but it is important
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
33+ feedback to pull-requests or any comments. The thumb-down reaction should be
34+ used with care and if possible accompanied with some explanations so the
35+ submitter has directions to improve his contribution.</para>
36+
37+<para>Pull-requests reviews should include a list of what has been reviewed in a
38+ comment, so other reviewers and mergers can know the state of the
39+ review.</para>
40+
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>
2044
2145<section><title>Package updates</title>
2246
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>
24−<para>It can happen that non trivial updates include patches or more complex changes.</para>
47+<para>A package update is the most trivial and common type of pull-request.
48+ These pull-requests mainly consist in updating the version part of the package
49+ name and the source hash.</para>
50+<para>It can happen that non trivial updates include patches or more complex
51+ changes.</para>
2552
2653<para>Reviewing process:</para>
2754
2855<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>
3058 <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>
3261 </itemizedlist>
3362 </listitem>
34− <listitem><para>Ensure that the package versioning is fitting the guidelines.</para></listitem>
35− <listitem><para>Ensure that the commit text is fitting the guidelines.</para></listitem>
63+ <listitem><para>Ensure that the package versioning is fitting the
64+ guidelines.</para></listitem>
65+ <listitem><para>Ensure that the commit text is fitting the
66+ guidelines.</para></listitem>
3667 <listitem><para>Ensure that the package maintainers are notified.</para>
3768 <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>
3972 </itemizedlist>
4073 </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>
4276 <itemizedlist>
43− <listitem><para>License can change with version updates, so it should be 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>
77+ <listitem><para>License can change with version updates, so it should be
78+ checked to be fitting upstream license.</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>
4582 </itemizedlist>
4683 </listitem>
4784 <listitem><para>Ensure that the code contains no typos.</para></listitem>
4885 <listitem><para>Building the package locally.</para>
4986 <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>
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.
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
91+ nixpkgs-unstable for easier review by running the following commands
92+ from a nixpkgs clone.
5293<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' />
5496$ git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
5597$ 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' />
57100</screen>
58101 <calloutlist>
59102 <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>
61105 </callout>
62106 <callout arearefs='reviewing-rebase-2'>
63107 <para>Fetching the nixos-unstable branch.</para>
64108 </callout>
65109 <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>
67114 </callout>
68115 <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>
70118 </callout>
71119 </calloutlist>
72120 </para>
73121 </listitem>
74122 <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>
76128<screen>
77129$ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
78130</screen>
@@ -101,30 +153,43 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
101153
102154<section><title>New packages</title>
103155
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>
105158
106159<para>Reviewing process:</para>
107160
108161<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>
110164 <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>
112167 </itemizedlist>
113168 </listitem>
114− <listitem><para>Ensure that the package versioning is fitting the guidelines.</para></listitem>
115− <listitem><para>Ensure that the commit name is fitting the guidelines.</para></listitem>
116− <listitem><para>Ensure that the meta field contains correct information.</para>
169+ <listitem><para>Ensure that the package versioning is fitting the
170+ guidelines.</para></listitem>
171+ <listitem><para>Ensure that the commit name is fitting the
172+ guidelines.</para></listitem>
173+ <listitem><para>Ensure that the meta field contains correct
174+ information.</para>
117175 <itemizedlist>
118− <listitem><para>License must be checked to be fitting upstream license.</para></listitem>
119− <listitem><para>Platforms should be set or the package will not get binary substitutes.</para></listitem>
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>
176+ <listitem><para>License must be checked to be fitting upstream
177+ license.</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
181+ submitter or a community member that accepts to take maintainership of
182+ the package.</para></listitem>
121183 </itemizedlist>
122184 </listitem>
123185 <listitem><para>Ensure that the code contains no typos.</para></listitem>
124186 <listitem><para>Ensure the package source.</para>
125187 <itemizedlist>
126− <listitem><para>Mirrors urls should be used when 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>
188+ <listitem><para>Mirrors urls should be used when
189+ available.</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>
128193 </itemizedlist>
129194 </listitem>
130195 <listitem><para>Building the package locally.</para></listitem>
@@ -158,36 +223,50 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
158223
159224<section><title>Module updates</title>
160225
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>
162228
163229<para>Reviewing process</para>
164230
165231<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>
167234 <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>
169237 </itemizedlist>
170238 </listitem>
171239 <listitem><para>Ensure that the module maintainers are notified.</para>
172240 <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>
174244 </itemizedlist>
175245 </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>
177248 <listitem><para>Ensure that the introduced options are correct.</para>
178249 <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>
180− <listitem><para>Description, default and example should be provided.</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>
253+ <listitem><para>Description, default and example should be
254+ provided.</para></listitem>
181255 </itemizedlist>
182256 </listitem>
183257 <listitem><para>Ensure that option changes are backward compatible.</para>
184258 <itemizedlist>
185− <listitem><para><literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.</para></listitem>
259+ <listitem><para><literal>mkRenamedOptionModule</literal> and
260+ <literal>mkAliasOptionModule</literal> functions provide way to make
261+ option changes backward compatible.</para></listitem>
186262 </itemizedlist>
187263 </listitem>
188− <listitem><para>Ensure that removed options are declared with <literal>mkRemovedOptionModule</literal></para></listitem>
189− <listitem><para>Ensure that changes that are not backward compatible are mentioned in release notes.</para></listitem>
190− <listitem><para>Ensure that documentations affected by the change is updated.</para></listitem>
264+ <listitem><para>Ensure that removed options are declared with
265+ <literal>mkRemovedOptionModule</literal></para></listitem>
266+ <listitem><para>Ensure that changes that are not backward compatible are
267+ mentioned in release notes.</para></listitem>
268+ <listitem><para>Ensure that documentations affected by the change is
269+ updated.</para></listitem>
191270</itemizedlist>
192271
193272<example><title>Sample template for a module update review</title>
@@ -215,27 +294,38 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
215294<para>New modules submissions introduce a new module to NixOS.</para>
216295
217296<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>
219299 <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>
221302 </itemizedlist>
222303 </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>
224306 <listitem><para>Ensure that the introduced options are correct.</para>
225307 <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>
227− <listitem><para>Description, default and example should be provided.</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>
311+ <listitem><para>Description, default and example should be
312+ provided.</para></listitem>
228313 </itemizedlist>
229314 </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>
231317 <itemizedlist>
232− <listitem><para>Maintainers should be declared in <literal>meta.maintainers</literal>.</para></listitem>
233− <listitem><para>Module documentation should be declared with <literal>meta.doc</literal>.</para></listitem>
318+ <listitem><para>Maintainers should be declared in
319+ <literal>meta.maintainers</literal>.</para></listitem>
320+ <listitem><para>Module documentation should be declared with
321+ <literal>meta.doc</literal>.</para></listitem>
234322 </itemizedlist>
235323 </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>
237326 <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>
239329 </itemizedlist>
240330 </listitem>
241331</itemizedlist>
@@ -265,16 +355,23 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
265355
266356<para>Other type of submissions requires different reviewing steps.</para>
267357
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.
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>
358+<para>If you consider having enough knowledge and experience in a topic and
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
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>
270365
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>
272368
273369</section>
274370
275371<section><title>Merging pull-requests</title>
276372
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>
373+<para>It is possible for community members that have enough knowledge and
374+ experience on a special topic to contribute by merging pull requests.</para>
278375
279376<para>TODO: add the procedure to request merging rights.</para>
280377
@@ -283,10 +380,14 @@ The following paragraph about how to deal with unactive contributors is just a
283380proposition and should be modified to what the community agrees to be the right
284381policy.
285382
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>
287385-->
288386
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>
290391
291392</section>
292393</chapter>