@@ -0,0 +1,257 @@
1+<chapter xmlns="http://docbook.org/ns/docbook"
2+ xmlns:xlink="http://www.w3.org/1999/xlink"
3+ xmlns:xi="http://www.w3.org/2001/XInclude"
5+ xml:id="sec-reviewing-contributions">
7+<title>Reviewing contributions</title>
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>
11+<para>The high activity of nixpkgs change make any pull request that is open for long enough subject to conflicts that will require extra 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 most recently and the least recently updated pull-requests.</para>
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>
15+<para>Github provides emoji, they are a simple and quick way to provide feedback to pull-requests or any comments. The thumb-down emoji should be used with care and if possible accompanied with some explanations so the submitter has directions to improve his contribution.</para>
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>
19+<para>All the review template samples that are provided in this section are generic, and should be adapted by the reviewer to fit the pull-request content by adding or removing review points.</para>
21+<section><title>Package updates</title>
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>
26+<para>Reviewing process:</para>
29+ <listitem><para>Add labels to the pull-request.</para>
31+ <listitem><para><literal>8.has: package (update)</literal> and any topic label that fit the updated package.</para></listitem>
34+ <listitem><para>Checking that the package versioning is fitting the guidelines.</para></listitem>
35+ <listitem><para>Checking that the commit text is fitting the guidelines.</para></listitem>
36+ <listitem><para>Checking that the package maintainers are notified.</para>
38+ <listitem><para>mention-bot usually notify github users based on the submitted changes, but it can happen that it miss some of the package maintainers.</para></listitem>
41+ <listitem><para>Checking that the code contains no typos.</para></listitem>
42+ <listitem><para>Building the package locally.</para>
44+ <listitem><para>Pull-requests are often targetted 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>
45+ <para>It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review.</para>
47+TODO: add commands for a local rebase and build
52+ <listitem><para>Running every binary.</para></listitem>
53+ <listitem><para>Checking that the packages using the updated package are building fine.</para>
60+<example><title>Sample template for a package update review</title>
64+- [ ] package name fits guidelines
65+- [ ] package version fits guidelines
66+- [ ] package build on ARCHITECTURE
67+- [ ] executables tested on ARCHITECTURE
68+- [ ] all depending packages build
70+##### Possible improvements
77+<section><title>New packages</title>
79+<para>New packages are a common type of pull-requests. These pull requests consists in adding a new nix-expression for a package.</para>
81+<para>Reviewing process:</para>
84+ <listitem><para>Add labels to the pull-request.</para>
86+ <listitem><para><literal>8.has: package (new)</literal> and any topic label that fit the new package.</para></listitem>
89+ <listitem><para>Checking that the package versioning is fitting the guidelines.</para></listitem>
90+ <listitem><para>Checking that the commit name is fitting the guidelines.</para></listitem>
91+ <listitem><para>Checking that the meta field contains correct information.</para>
93+ <listitem><para>License must be checked to be fitting upstream license.</para></listitem>
94+ <listitem><para>Platforms should be set or the package will not get binary substitutes.</para></listitem>
95+ <listitem><para>If there is no maintainer, propose the submitter to become the maintainer.</para></listitem>
98+ <listitem><para>Checking that the code contains no typos.</para></listitem>
99+ <listitem><para>Checking the package source.</para>
101+ <listitem><para>Mirrors urls should be used when available.</para></listitem>
102+ <listitem><para>The most appropriate function should be used (e.g. packages from github should use <literal>fetchFromGithub</literal>).</para></listitem>
105+ <listitem><para>Building the package locally.</para></listitem>
106+ <listitem><para>Running every binary.</para></listitem>
109+<example><title>Sample template for a new package review</title>
111+##### Reviewed points
113+- [ ] package path fits guidelines
114+- [ ] package name fits guidelines
115+- [ ] package version fits guidelines
116+- [ ] package build on ARCHITECTURE
117+- [ ] executables tested on ARCHITECTURE
118+- [ ] `meta.description` is set and fits guidelines
119+- [ ] `meta.license` fits upstream license
120+- [ ] `meta.platforms` is set
121+- [ ] `meta.maintainers` is set
122+- [ ] build time only dependencies are declared in `nativeBuildInputs`
123+- [ ] source is fetched using the appropriate function
124+- [ ] phases are respected
125+- [ ] patches that are remotely available are fetched with `fetchPatch`
127+##### Possible improvements
134+<section><title>Module updates</title>
136+<para>Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options.</para>
138+<para>Reviewing process</para>
141+ <listitem><para>Add labels to the pull-request.</para>
143+ <listitem><para><literal>8.has: module (update)</literal> and any topic label that fit the module.</para></listitem>
146+ <listitem><para>Checking that the module maintainers are notified.</para>
148+ <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>
151+ <listitem><para>Checking that the module tests, if any, are succeeding.</para></listitem>
152+ <listitem><para>Checking that the introduced options are correct.</para>
154+ <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>
155+ <listitem><para>Description, default and example should be provided.</para></listitem>
158+ <listitem><para>Checking that option changes are backward compatible.</para>
160+ <listitem><para><literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.</para></listitem>
163+ <listitem><para>Checking that removed options are declared with <literal>mkRemovedOptionModule</literal></para></listitem>
164+ <listitem><para>Checking that changes that are not backward compatible are mentioned in release notes.</para></listitem>
165+ <listitem><para>Checking that documentations affected by the change is updated.</para></listitem>
168+<example><title>Sample template for a module update review</title>
170+##### Reviewed points
172+- [ ] changes are backward compatible
173+- [ ] removed options are declared with `mkRemovedOptionModule`
174+- [ ] changes that are not backward compatible are documented in release notes
175+- [ ] module tests succeed on ARCHITECTURE
176+- [ ] options types are appropriate
177+- [ ] options description is set
178+- [ ] options example is provided
179+- [ ] documentation affected by the changes is updated
181+##### Possible improvements
188+<section><title>New modules</title>
190+<para>New modules submissions introduce a new module to NixOS.</para>
193+ <listitem><para>Add labels to the pull-request.</para>
195+ <listitem><para><literal>8.has: module (new)</literal> and any topic label that fit the module.</para></listitem>
198+ <listitem><para>Checking that the module tests, if any, are succeeding.</para></listitem>
199+ <listitem><para>Checking that the introduced options are correct.</para>
201+ <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>
202+ <listitem><para>Description, default and example should be provided.</para></listitem>
205+ <listitem><para>Checking that module <literal>meta</literal> field is present</para>
207+ <listitem><para>Maintainers should be declared in <literal>meta.maintainers</literal>.</para></listitem>
208+ <listitem><para>Module documentation should be declared with <literal>meta.doc</literal>.</para></listitem>
211+ <listitem><para>Checking that the module respect other modules functionality.</para>
213+ <listitem><para>For example, enabling a module should not open firewall ports by default.</para></listitem>
218+<example><title>Sample template for a new module review</title>
220+##### Reviewed points
222+- [ ] module path fits the guidelines
223+- [ ] module tests succeed on ARCHITECTURE
224+- [ ] options have appropriate types
225+- [ ] options have default
226+- [ ] options have example
227+- [ ] options have descriptions
228+- [ ] No unneeded package is added to system.environmentPackages
229+- [ ] meta.maintainers is set
230+- [ ] module documentation is declared in meta.doc
232+##### Possible improvements
239+<section><title>Other submissions</title>
241+<para>Other type of submissions requires different reviewing steps.</para>
243+<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.
244+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>
246+<para>Container system, boot system and library changes are some examples of the pull requests fitting this category.</para>
250+<section><title>Merging pull-requests</title>
252+<para>It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.</para>
254+<para>TODO: add the procedure to request merging rights.</para>