You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
489 lines
16 KiB
489 lines
16 KiB
8 years ago
|
<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"
|
||
5 years ago
|
xml:id="chap-reviewing-contributions">
|
||
6 years ago
|
<title>Reviewing contributions</title>
|
||
|
<warning>
|
||
|
<para>
|
||
5 years ago
|
The following section is a draft, and the policy for reviewing is still being discussed in issues such as <link
|
||
4 years ago
|
xlink:href="https://github.com/NixOS/nixpkgs/issues/11166">#11166 </link> and <link
|
||
|
xlink:href="https://github.com/NixOS/nixpkgs/issues/20836">#20836 </link>.
|
||
6 years ago
|
</para>
|
||
|
</warning>
|
||
|
<para>
|
||
5 years ago
|
The Nixpkgs project 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.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
The high change rate of Nixpkgs makes any pull request that remains open for too long 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 this issue. 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. We highly encourage looking at <link xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+review%3Anone+status%3Asuccess+-label%3A%222.status%3A+work-in-progress%22+no%3Aproject+no%3Aassignee+no%3Amilestone"> this list of ready to merge, unreviewed pull requests</link>.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
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 member and their work.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
GitHub provides reactions as 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 explanation so the submitter has directions to improve their contribution.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
pull request 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.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
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 their liking.
|
||
6 years ago
|
</para>
|
||
6 years ago
|
<section xml:id="reviewing-contributions-package-updates">
|
||
6 years ago
|
<title>Package updates</title>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
A package update is the most trivial and common type of pull request. These pull requests mainly consist of updating the version part of the package name and the source hash.
|
||
6 years ago
|
</para>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
It can happen that non-trivial updates include patches or more complex changes.
|
||
6 years ago
|
</para>
|
||
|
|
||
|
<para>
|
||
|
Reviewing process:
|
||
|
</para>
|
||
|
|
||
|
<itemizedlist>
|
||
|
<listitem>
|
||
|
<para>
|
||
6 years ago
|
Ensure that the package versioning fits the guidelines.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
6 years ago
|
Ensure that the commit text fits the guidelines.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the package maintainers are notified.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
<link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link> will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
6 years ago
|
Ensure that the meta field information is correct.
|
||
6 years ago
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
License can change with version updates, so it should be checked to match the upstream license.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
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.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the code contains no typos.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Building the package locally.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
pull requests are often targeted to the master or staging branch, and building the pull request locally when it is submitted can trigger many source builds.
|
||
6 years ago
|
</para>
|
||
|
<para>
|
||
5 years ago
|
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.
|
||
8 years ago
|
<screen>
|
||
5 years ago
|
<prompt>$ </prompt>git fetch origin nixos-unstable <co xml:id='reviewing-rebase-2' />
|
||
5 years ago
|
<prompt>$ </prompt>git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
|
||
|
<prompt>$ </prompt>git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
|
||
8 years ago
|
xml:id='reviewing-rebase-4' />
|
||
8 years ago
|
</screen>
|
||
6 years ago
|
<calloutlist>
|
||
|
<callout arearefs='reviewing-rebase-2'>
|
||
|
<para>
|
||
|
Fetching the nixos-unstable branch.
|
||
|
</para>
|
||
|
</callout>
|
||
|
<callout arearefs='reviewing-rebase-3'>
|
||
|
<para>
|
||
5 years ago
|
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.
|
||
6 years ago
|
</para>
|
||
|
</callout>
|
||
|
<callout arearefs='reviewing-rebase-4'>
|
||
|
<para>
|
||
6 years ago
|
Rebasing the pull request changes to the nixos-unstable branch.
|
||
6 years ago
|
</para>
|
||
|
</callout>
|
||
|
</calloutlist>
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
The <link xlink:href="https://github.com/Mic92/nixpkgs-review">nixpkgs-review</link> tool can be used to review a pull request content in a single command. <varname>PRNUMBER</varname> should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url.
|
||
6 years ago
|
</para>
|
||
8 years ago
|
<screen>
|
||
5 years ago
|
<prompt>$ </prompt>nix-shell -p nixpkgs-review --run "nixpkgs-review pr PRNUMBER"
|
||
8 years ago
|
</screen>
|
||
6 years ago
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Running every binary.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
</itemizedlist>
|
||
|
|
||
6 years ago
|
<example xml:id="reviewing-contributions-sample-package-update">
|
||
6 years ago
|
<title>Sample template for a package update review</title>
|
||
8 years ago
|
<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
|
||
|
|
||
6 years ago
|
</screen>
|
||
|
</example>
|
||
|
</section>
|
||
6 years ago
|
<section xml:id="reviewing-contributions-new-packages">
|
||
6 years ago
|
<title>New packages</title>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
New packages are a common type of pull requests. These pull requests consists in adding a new nix-expression for a package.
|
||
6 years ago
|
</para>
|
||
|
|
||
|
<para>
|
||
|
Reviewing process:
|
||
|
</para>
|
||
|
|
||
|
<itemizedlist>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the package versioning is fitting the guidelines.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the commit name is fitting the guidelines.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the meta field contains correct information.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<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>
|
||
5 years ago
|
A maintainer must be set. This can be the package submitter or a community member that accepts to take maintainership of the package.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the code contains no typos.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure the package source.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
|
Mirrors urls should be used when available.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
The most appropriate function should be used (e.g. packages from GitHub should use <literal>fetchFromGitHub</literal>).
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Building the package locally.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Running every binary.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
</itemizedlist>
|
||
|
|
||
6 years ago
|
<example xml:id="reviewing-contributions-sample-new-package">
|
||
6 years ago
|
<title>Sample template for a new package review</title>
|
||
8 years ago
|
<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
|
||
8 years ago
|
- [ ] patches that are remotely available are fetched with `fetchpatch`
|
||
8 years ago
|
|
||
|
##### Possible improvements
|
||
|
|
||
|
##### Comments
|
||
|
|
||
6 years ago
|
</screen>
|
||
|
</example>
|
||
|
</section>
|
||
6 years ago
|
<section xml:id="reviewing-contributions-module-updates">
|
||
6 years ago
|
<title>Module updates</title>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options.
|
||
6 years ago
|
</para>
|
||
|
|
||
|
<para>
|
||
|
Reviewing process
|
||
|
</para>
|
||
|
|
||
|
<itemizedlist>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the module maintainers are notified.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
<link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link> will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the module tests, if any, are succeeding.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the introduced options are correct.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Description, default and example should be provided.
|
||
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that option changes are backward compatible.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
<literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
Ensure that removed options are declared with <literal>mkRemovedOptionModule</literal>
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
Ensure that changes that are not backward compatible are mentioned in release notes.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that documentations affected by the change is updated.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
</itemizedlist>
|
||
|
|
||
6 years ago
|
<example xml:id="reviewing-contributions-sample-module-update">
|
||
6 years ago
|
<title>Sample template for a module update review</title>
|
||
8 years ago
|
<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
|
||
|
|
||
6 years ago
|
</screen>
|
||
|
</example>
|
||
|
</section>
|
||
6 years ago
|
<section xml:id="reviewing-contributions-new-modules">
|
||
6 years ago
|
<title>New modules</title>
|
||
|
|
||
|
<para>
|
||
|
New modules submissions introduce a new module to NixOS.
|
||
|
</para>
|
||
|
|
||
|
<itemizedlist>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the module tests, if any, are succeeding.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the introduced options are correct.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Description, default and example should be provided.
|
||
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that module <literal>meta</literal> field is present
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
|
Maintainers should be declared in <literal>meta.maintainers</literal>.
|
||
|
</para>
|
||
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
Module documentation should be declared with <literal>meta.doc</literal>.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
<listitem>
|
||
|
<para>
|
||
|
Ensure that the module respect other modules functionality.
|
||
|
</para>
|
||
8 years ago
|
<itemizedlist>
|
||
6 years ago
|
<listitem>
|
||
|
<para>
|
||
5 years ago
|
For example, enabling a module should not open firewall ports by default.
|
||
6 years ago
|
</para>
|
||
|
</listitem>
|
||
8 years ago
|
</itemizedlist>
|
||
6 years ago
|
</listitem>
|
||
|
</itemizedlist>
|
||
8 years ago
|
|
||
6 years ago
|
<example xml:id="reviewing-contributions-sample-new-module">
|
||
6 years ago
|
<title>Sample template for a new module review</title>
|
||
8 years ago
|
<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
|
||
7 years ago
|
- [ ] No unneeded package is added to environment.systemPackages
|
||
8 years ago
|
- [ ] meta.maintainers is set
|
||
|
- [ ] module documentation is declared in meta.doc
|
||
|
|
||
|
##### Possible improvements
|
||
|
|
||
|
##### Comments
|
||
|
|
||
6 years ago
|
</screen>
|
||
|
</example>
|
||
|
</section>
|
||
6 years ago
|
<section xml:id="reviewing-contributions-other-submissions">
|
||
6 years ago
|
<title>Other submissions</title>
|
||
|
|
||
|
<para>
|
||
|
Other type of submissions requires different reviewing steps.
|
||
|
</para>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
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.
|
||
6 years ago
|
</para>
|
||
|
|
||
|
<para>
|
||
5 years ago
|
Container system, boot system and library changes are some examples of the pull requests fitting this category.
|
||
6 years ago
|
</para>
|
||
|
</section>
|
||
6 years ago
|
<section xml:id="reviewing-contributions--merging-pull-requests">
|
||
6 years ago
|
<title>Merging pull requests</title>
|
||
6 years ago
|
|
||
|
<para>
|
||
5 years ago
|
It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.
|
||
6 years ago
|
</para>
|
||
|
|
||
8 years ago
|
<!--
|
||
4 years ago
|
The following paragraphs about how to deal with unactive contributors is just a
|
||
8 years ago
|
proposition and should be modified to what the community agrees to be the right
|
||
|
policy.
|
||
|
|
||
7 years ago
|
<para>Please note that contributors with commit rights unactive for more than
|
||
8 years ago
|
three months will have their commit rights revoked.</para>
|
||
8 years ago
|
-->
|
||
8 years ago
|
|
||
4 years ago
|
<para>
|
||
|
Please see the discussion in <link xlink:href="https://github.com/NixOS/nixpkgs/issues/50105">GitHub nixpkgs issue #50105</link> for information on how to proceed to be granted this level of access.
|
||
|
</para>
|
||
|
|
||
6 years ago
|
<para>
|
||
5 years ago
|
In a case a contributor definitively leaves the Nix community, they should create an issue or post on <link
|
||
|
xlink:href="https://discourse.nixos.org">Discourse</link> with references of packages and modules they maintain so the maintainership can be taken over by other contributors.
|
||
6 years ago
|
</para>
|
||
|
</section>
|
||
8 years ago
|
</chapter>
|