From caef192c81d2e068a3042d541d355b9596e97906 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Sun, 2 Oct 2016 00:50:16 +0900 Subject: [PATCH] nixos-manual: reviewing chapter cleanup --- .../development/reviewing-contributions.xml | 225 +++++++++++++----- 1 file changed, 163 insertions(+), 62 deletions(-) diff --git a/nixos/doc/manual/development/reviewing-contributions.xml b/nixos/doc/manual/development/reviewing-contributions.xml index 69dc9797cd9d..d13b40baeb60 100644 --- a/nixos/doc/manual/development/reviewing-contributions.xml +++ b/nixos/doc/manual/development/reviewing-contributions.xml @@ -6,73 +6,125 @@ Reviewing contributions -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. + + The following section is a draft and reviewing policy is still being + discussed. + -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 most recently and the least recently updated pull-requests. +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. -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. +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 most + recently and the least + recently updated pull-requests. -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. +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. -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. +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. -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. +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. + +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.
Package updates -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. -It can happen that non trivial updates include patches or more complex changes. +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. +It can happen that non trivial updates include patches or more complex + changes. Reviewing process: - Add labels to the pull-request. (Requires commit rights) + Add labels to the pull-request. (Requires commit + rights) - 8.has: package (update) and any topic label that fit the updated package. + 8.has: package (update) and any topic + label that fit the updated package. - Ensure that the package versioning is fitting the guidelines. - Ensure that the commit text is fitting the guidelines. + Ensure that the package versioning is fitting the + guidelines. + Ensure that the commit text is fitting the + guidelines. Ensure that the package maintainers are notified. - mention-bot usually notify GitHub users based on the submitted changes, but it can happen that it misses some of the package maintainers. + mention-bot usually notify GitHub users based on the + submitted changes, but it can happen that it misses some of the + package maintainers. - Ensure that the meta field contains correct information. + Ensure that the meta field contains correct + information. - License can change with version updates, so it should be checked to be fitting upstream license. - 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. + License can change with version updates, so it should be + checked to be fitting upstream license. + 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. Ensure that the code contains no typos. Building the package locally. - 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. - 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. + 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. + 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. -$ git remote add channels https://github.com/NixOS/nixpkgs-channels.git +$ git remote add channels https://github.com/NixOS/nixpkgs-channels.git $ git fetch channels nixos-unstable $ git fetch origin pull/PRNUMBER/head -$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD +$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD - This should be done only once to be able to fetch channel branches from the nixpkgs-channels repository. + This should be done only once to be able to fetch channel + branches from the nixpkgs-channels repository. Fetching the nixos-unstable branch. - Fetching the pull-request changes, PRNUMBER is the number at the end of the pull-request title and BASEBRANCH the base branch of the pull-request. + Fetching the pull-request changes, PRNUMBER + is the number at the end of the pull-request title and + BASEBRANCH the base branch of the + pull-request. - Rebasing the pull-request changes to the nixos-unstable branch. + Rebasing the pull-request changes to the nixos-unstable + branch. - The nox 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. PRNUMBER should be replaced by the number at the end of the pull-request title. + The nox + 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. PRNUMBER should be replaced by the + number at the end of the pull-request title. $ nix-shell -p nox --run "nox-review -k pr PRNUMBER" @@ -101,30 +153,43 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
New packages -New packages are a common type of pull-requests. These pull requests consists in adding a new nix-expression for a package. +New packages are a common type of pull-requests. These pull requests + consists in adding a new nix-expression for a package. Reviewing process: - Add labels to the pull-request. (Requires commit rights) + Add labels to the pull-request. (Requires commit + rights) - 8.has: package (new) and any topic label that fit the new package. + 8.has: package (new) and any topic + label that fit the new package. - Ensure that the package versioning is fitting the guidelines. - Ensure that the commit name is fitting the guidelines. - Ensure that the meta field contains correct information. + Ensure that the package versioning is fitting the + guidelines. + Ensure that the commit name is fitting the + guidelines. + Ensure that the meta field contains correct + information. - License must be checked to be fitting upstream license. - Platforms should be set or the package will not get binary substitutes. - A maintainer must be set, this can be the package submitter or a community member that accepts to take maintainership of the package. + License must be checked to be fitting upstream + license. + Platforms should be set or the package will not get binary + substitutes. + A maintainer must be set, this can be the package + submitter or a community member that accepts to take maintainership of + the package. Ensure that the code contains no typos. Ensure the package source. - Mirrors urls should be used when available. - The most appropriate function should be used (e.g. packages from GitHub should use fetchFromGitHub). + Mirrors urls should be used when + available. + The most appropriate function should be used (e.g. + packages from GitHub should use + fetchFromGitHub). Building the package locally. @@ -158,36 +223,50 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
Module updates -Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options. +Module updates are submissions changing modules in some ways. These often + contains changes to the options or introduce new options. Reviewing process - Add labels to the pull-request. (Requires commit rights) + Add labels to the pull-request. (Requires commit + rights) - 8.has: module (update) and any topic label that fit the module. + 8.has: module (update) and any topic + label that fit the module. Ensure that the module maintainers are notified. - Mention-bot notify GitHub users based on the submitted changes, but it can happen that it miss some of the package maintainers. + Mention-bot notify GitHub users based on the submitted + changes, but it can happen that it miss some of the package + maintainers. - Ensure that the module tests, if any, are succeeding. + Ensure that the module tests, if any, are + succeeding. Ensure that the introduced options are correct. - Type should be appropriate (string related types differs in their merging capabilities, optionSet and string types are deprecated). - Description, default and example should be provided. + Type should be appropriate (string related types differs + in their merging capabilities, optionSet and + string types are deprecated). + Description, default and example should be + provided. Ensure that option changes are backward compatible. - mkRenamedOptionModule and mkAliasOptionModule functions provide way to make option changes backward compatible. + mkRenamedOptionModule and + mkAliasOptionModule functions provide way to make + option changes backward compatible. - Ensure that removed options are declared with mkRemovedOptionModule - Ensure that changes that are not backward compatible are mentioned in release notes. - Ensure that documentations affected by the change is updated. + Ensure that removed options are declared with + mkRemovedOptionModule + Ensure that changes that are not backward compatible are + mentioned in release notes. + Ensure that documentations affected by the change is + updated. Sample template for a module update review @@ -215,27 +294,38 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER" New modules submissions introduce a new module to NixOS. - Add labels to the pull-request. (Requires commit rights) + Add labels to the pull-request. (Requires commit + rights) - 8.has: module (new) and any topic label that fit the module. + 8.has: module (new) and any topic label + that fit the module. - Ensure that the module tests, if any, are succeeding. + Ensure that the module tests, if any, are + succeeding. Ensure that the introduced options are correct. - Type should be appropriate (string related types differs in their merging capabilities, optionSet and string types are deprecated). - Description, default and example should be provided. + Type should be appropriate (string related types differs + in their merging capabilities, optionSet and + string types are deprecated). + Description, default and example should be + provided. - Ensure that module meta field is present + Ensure that module meta field is + present - Maintainers should be declared in meta.maintainers. - Module documentation should be declared with meta.doc. + Maintainers should be declared in + meta.maintainers. + Module documentation should be declared with + meta.doc. - Ensure that the module respect other modules functionality. + Ensure that the module respect other modules + functionality. - For example, enabling a module should not open firewall ports by default. + For example, enabling a module should not open firewall + ports by default. @@ -265,16 +355,23 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER" Other type of submissions requires different reviewing steps. -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. +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. -Container system, boot system and library changes are some examples of the pull requests fitting this category. +Container system, boot system and library changes are some examples of the + pull requests fitting this category.
Merging pull-requests -It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests. +It is possible for community members that have enough knowledge and + experience on a special topic to contribute by merging pull requests. TODO: add the procedure to request merging rights. @@ -283,10 +380,14 @@ The following paragraph about how to deal with unactive contributors is just a proposition and should be modified to what the community agrees to be the right policy. -Please note that contributors with commit rights unactive for more than three months will have their commit rights revoked. +Please note that contributors with commit rights unactive for more than + three months will have their commit rights revoked. --> -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. +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.