nixos-doc: add reviewing-contributions

This commit is contained in:
Eric Sagnes 2016-09-26 15:36:03 +09:00
parent cdec20ac58
commit 8d656d2ca0
4 changed files with 265 additions and 0 deletions

View file

@ -30,3 +30,6 @@ under the terms of [COPYING](../COPYING), which is an MIT-like license.
See the nixpkgs manual for more details on how to [Submit changes to nixpkgs](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#chap-submitting-changes). See the nixpkgs manual for more details on how to [Submit changes to nixpkgs](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#chap-submitting-changes).
## Reviewing contributions
See the nixpkgs manual for more details on how to [Review contributions](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#chap-reviewing-contributions).

View file

@ -15,5 +15,9 @@
- [ ] Tested execution of all binary files (usually in `./result/bin/`) - [ ] Tested execution of all binary files (usually in `./result/bin/`)
- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md). - [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).
###### Reviewing this pull-request
See the nixpkgs manual for more details on how to [Review contributions](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#chap-reviewing-contributions).
--- ---

View file

@ -17,5 +17,6 @@ NixOS.</para>
<xi:include href="building-nixos.xml" /> <xi:include href="building-nixos.xml" />
<xi:include href="nixos-tests.xml" /> <xi:include href="nixos-tests.xml" />
<xi:include href="testing-installer.xml" /> <xi:include href="testing-installer.xml" />
<xi:include href="reviewing-contributions.xml" />
</part> </part>

View file

@ -0,0 +1,257 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-reviewing-contributions">
<title>Reviewing contributions</title>
<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>
<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>
<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>
<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>
<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>
<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>
<section><title>Package updates</title>
<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>
<para>It can happen that non trivial updates include patches or more complex changes.</para>
<para>Reviewing process:</para>
<itemizedlist>
<listitem><para>Add labels to the pull-request.</para>
<itemizedlist>
<listitem><para><literal>8.has: package (update)</literal> and any topic label that fit the updated package.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the package versioning is fitting the guidelines.</para></listitem>
<listitem><para>Checking that the commit text is fitting the guidelines.</para></listitem>
<listitem><para>Checking that the package maintainers are notified.</para>
<itemizedlist>
<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>
</itemizedlist>
</listitem>
<listitem><para>Checking that the code contains no typos.</para></listitem>
<listitem><para>Building the package locally.</para>
<itemizedlist>
<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>
<para>It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review.</para>
<screen>
TODO: add commands for a local rebase and build
</screen>
</listitem>
</itemizedlist>
</listitem>
<listitem><para>Running every binary.</para></listitem>
<listitem><para>Checking that the packages using the updated package are building fine.</para>
<screen>
TODO: add commands
</screen>
</listitem>
</itemizedlist>
<example><title>Sample template for a package update review</title>
<screen>
##### Reviewed points
- [ ] package name fits guidelines
- [ ] package version fits guidelines
- [ ] package build on ARCHITECTURE
- [ ] executables tested on ARCHITECTURE
- [ ] all depending packages build
##### Possible improvements
##### Comments
</screen></example>
</section>
<section><title>New packages</title>
<para>New packages are a common type of pull-requests. These pull requests consists in adding a new nix-expression for a package.</para>
<para>Reviewing process:</para>
<itemizedlist>
<listitem><para>Add labels to the pull-request.</para>
<itemizedlist>
<listitem><para><literal>8.has: package (new)</literal> and any topic label that fit the new package.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the package versioning is fitting the guidelines.</para></listitem>
<listitem><para>Checking that the commit name is fitting the guidelines.</para></listitem>
<listitem><para>Checking that the meta field contains correct information.</para>
<itemizedlist>
<listitem><para>License must be checked to be fitting upstream license.</para></listitem>
<listitem><para>Platforms should be set or the package will not get binary substitutes.</para></listitem>
<listitem><para>If there is no maintainer, propose the submitter to become the maintainer.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the code contains no typos.</para></listitem>
<listitem><para>Checking the package source.</para>
<itemizedlist>
<listitem><para>Mirrors urls should be used when available.</para></listitem>
<listitem><para>The most appropriate function should be used (e.g. packages from github should use <literal>fetchFromGithub</literal>).</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Building the package locally.</para></listitem>
<listitem><para>Running every binary.</para></listitem>
</itemizedlist>
<example><title>Sample template for a new package review</title>
<screen>
##### Reviewed points
- [ ] package path fits guidelines
- [ ] package name fits guidelines
- [ ] package version fits guidelines
- [ ] package build on ARCHITECTURE
- [ ] executables tested on ARCHITECTURE
- [ ] `meta.description` is set and fits guidelines
- [ ] `meta.license` fits upstream license
- [ ] `meta.platforms` is set
- [ ] `meta.maintainers` is set
- [ ] build time only dependencies are declared in `nativeBuildInputs`
- [ ] source is fetched using the appropriate function
- [ ] phases are respected
- [ ] patches that are remotely available are fetched with `fetchPatch`
##### Possible improvements
##### Comments
</screen></example>
</section>
<section><title>Module updates</title>
<para>Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options.</para>
<para>Reviewing process</para>
<itemizedlist>
<listitem><para>Add labels to the pull-request.</para>
<itemizedlist>
<listitem><para><literal>8.has: module (update)</literal> and any topic label that fit the module.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the module maintainers are notified.</para>
<itemizedlist>
<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>
</itemizedlist>
</listitem>
<listitem><para>Checking that the module tests, if any, are succeeding.</para></listitem>
<listitem><para>Checking that the introduced options are correct.</para>
<itemizedlist>
<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>
<listitem><para>Description, default and example should be provided.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that option changes are backward compatible.</para>
<itemizedlist>
<listitem><para><literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that removed options are declared with <literal>mkRemovedOptionModule</literal></para></listitem>
<listitem><para>Checking that changes that are not backward compatible are mentioned in release notes.</para></listitem>
<listitem><para>Checking that documentations affected by the change is updated.</para></listitem>
</itemizedlist>
<example><title>Sample template for a module update review</title>
<screen>
##### Reviewed points
- [ ] changes are backward compatible
- [ ] removed options are declared with `mkRemovedOptionModule`
- [ ] changes that are not backward compatible are documented in release notes
- [ ] module tests succeed on ARCHITECTURE
- [ ] options types are appropriate
- [ ] options description is set
- [ ] options example is provided
- [ ] documentation affected by the changes is updated
##### Possible improvements
##### Comments
</screen></example>
</section>
<section><title>New modules</title>
<para>New modules submissions introduce a new module to NixOS.</para>
<itemizedlist>
<listitem><para>Add labels to the pull-request.</para>
<itemizedlist>
<listitem><para><literal>8.has: module (new)</literal> and any topic label that fit the module.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the module tests, if any, are succeeding.</para></listitem>
<listitem><para>Checking that the introduced options are correct.</para>
<itemizedlist>
<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>
<listitem><para>Description, default and example should be provided.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that module <literal>meta</literal> field is present</para>
<itemizedlist>
<listitem><para>Maintainers should be declared in <literal>meta.maintainers</literal>.</para></listitem>
<listitem><para>Module documentation should be declared with <literal>meta.doc</literal>.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Checking that the module respect other modules functionality.</para>
<itemizedlist>
<listitem><para>For example, enabling a module should not open firewall ports by default.</para></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<example><title>Sample template for a new module review</title>
<screen>
##### Reviewed points
- [ ] module path fits the guidelines
- [ ] module tests succeed on ARCHITECTURE
- [ ] options have appropriate types
- [ ] options have default
- [ ] options have example
- [ ] options have descriptions
- [ ] No unneeded package is added to system.environmentPackages
- [ ] meta.maintainers is set
- [ ] module documentation is declared in meta.doc
##### Possible improvements
##### Comments
</screen></example>
</section>
<section><title>Other submissions</title>
<para>Other type of submissions requires different reviewing steps.</para>
<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.
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>
<para>Container system, boot system and library changes are some examples of the pull requests fitting this category.</para>
</section>
<section><title>Merging pull-requests</title>
<para>It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.</para>
<para>TODO: add the procedure to request merging rights.</para>
</section>
</chapter>