Jump to: navigation, search

Difference between revisions of "ReviewChecklist"

(Common Review Checklist: updates for modernity)
(Common Review Checklist)
Line 19: Line 19:
# About Python 3 compatibility:
# About Python 3 compatibility:
## It is preferred for new code to use package six. When it is possible we should be use `six.text_type` or `six.text_binary` to cast or test value for unicode or str.
## It is preferred for new code to use package six. When it is possible we should be use `six.text_type` or `six.text_binary` to cast or test value for unicode or str.
# The code should comply with the community [[LoggingStandards]].
= Oslo Syncing Checklist =
= Oslo Syncing Checklist =

Revision as of 18:42, 19 June 2014

This page includes a list of things that reviewers should keep in mind when reviewing patches to OpenStack projects. There are some items that are common across all projects and others that are specific to a project.

Common Review Checklist

  1. The code should comply with everything in that project's `HACKING.rst` file, if it has one. If the project reuses nova's hacking guideines, then it may have a "hacking" section in its `tox.ini` file in which case much of this is already checked automatically for you by the continuous integration system.
  2. The code should be 'pythonic' and look like the code around it, to make the code more uniform and easier to read.
  3. Commit Message and Change break-up:
    1. Follow the advice of GitCommitMessages.
    2. Use the "DocImpact" tag on changes that affect documentation.
    3. Use the "SecurityImpact" tag on changes that should get the attention of the OpenStack Security Group (OSSG) for additional review.
    4. Use the "UpgradeImpact" tag on changes which require configuration changes to be mentioned in the release notes.
    5. If the patch fixes a bug, it should reference a bug report.
    6. If the patch implements a feature, it should reference a blueprint. The blueprint should be approved before the patch is merged.
  4. Test Case implementation (Mock vs. Mox):
    1. New test cases should be implemented using Mock. It is part of the Python standard library in Python 3 and as such is the preferred method for OpenStack.
    2. Exceptions can be made for tests added where Mox was already in use, or any other situation where using Mock would cause excessive difficulty for some reason.
    3. There is no need to convert existing Mox test cases to Mock, but if you are changing a Mox test case anyway, please consider converting it to Mock at the same time.
  5. About Python 3 compatibility:
    1. It is preferred for new code to use package six. When it is possible we should be use `six.text_type` or `six.text_binary` to cast or test value for unicode or str.
  6. The code should comply with the community LoggingStandards.

Oslo Syncing Checklist

  1. When syncing from oslo:
    1. Ensure the proposed change has actually merged in oslo.
    2. It should provide some benefit, don't sync just to sync. Maybe it fixes a bug, or provides new functionality to be used. If providing new functionality it should have a dependent patch lined up to use that functionality.
    3. The commit message should list which oslo changes are being synced in.

Nova Review Checklist

  1. For REST API changes:
    1. The change should conform to APIChangeGuidelines
      1. Note that we can currently still make incompatible changes to the V3 API
    2. Produce a full API design in a blueprint in advance
    3. Follow the Nova API Style Guide
    4. Ensure there are new API samples produced using realistic data (they are used for documentation)
      1. If an API sample test template changes, ensure the doc samples are also updated.
      2. V2 api samples are added to nova/tests/integrated/test_api_samples.py
      3. V3 api samples are added to an extension specific file in nova/tests/integrated/v3
    5. If a bug fix is applied to the V2 or V3 API, check to see if it is appropriate to apply it to the V3 or V2 API as well
    6. New API methods should have an associated policy check for access control
      1. Check an entry has been added to nova/etc/nova/policy.json
    7. V3 API specific checks
      1. Confirm the extension has been at least added to nova.api.v3_extensions in setup.cfg
      2. A discoverable policy must be added for each extension or it won't be visible by default in the /v3/extensions listing. eg
        1. "compute_extension:v3:os-access-ips:discoverable": "",
  2. When changing an RPC interface
    1. Make sure the version numbers are updated appropriately and that backwards compatibility is maintained. More info here.
    2. If an existing method is being updated, make sure support for sending the old version of the method is still supported. Search for existing uses of "can_send_version()" for examples.
  3. When changing rootwrap filters
    1. Add Thierry Carrez to the review
    2. FIXME: add specific review checklist
  4. Criteria for new compute drivers
    1. Should support everything in the core OpenStack compute API
    2. Should have public CI doing functional testing (http://lists.openstack.org/pipermail/openstack-dev/2013-July/011280.html)
  5. Global code cleanup which should be a hacking rule
    1. For every patch that is going through the entire source tree to change something, which should be that way for all time, a hacking rule should be added within the same patch to make sure it doesn't come back. This can be done by adding a nova-specific rule to nova/hacking/checks.py, but if it should be a standard rule across all projects it should go into the openstack-dev/hacking project where it can be released in a library and each individual project can consume it.
  6. When to approve
    1. Every patch needs two +2s before being approved.
    2. Its ok to hold off on an approval until a subject matter expert reviews it, such as for neutron, xen, or glance related changes.
    3. If a patch has already been approved but requires a trivial rebase to merge, you do not have to wait for a second +2, since the patch has already had two +2s.

Notes for Non-Core Developers

  • When you are reviewing, you may notice a review that has several +1's from other reviewers, passes the functional tests, etc. but the code still has not been merged. As only core developers can approve code for merging, you can help things along by getting a core developer's attention (preferably in IRC) and letting them know there is a review with lots of positive reviews and needs final approval.