VTK/Commit Guidelines

From KitwarePublic
Jump to navigationJump to search
  • Do not commit 3rd party code that is compiled and linked in by default unless it conforms to VTK's BSD-style license. For example GPL and LGPL do not conform to a BSD license.
  • Build into a fresh empty binary directory after making your last code change
  • Run ctest in your binary directory and make sure all the VTK tests pass before committing your code
  • After pushing your changes to Gerrit for review, check the CDash@Home submissions linked to from the topic
    • These should be clean, apart from any altered baseline images
  • Your code must build and test cleanly on these platforms to pass all the nightly dashboards
  • For large commit (eg. update of tiff library, addition of a brand new library, refactoring of numerous classes in VTK), it is a good idea to send an email to the vtk-developers mailing list.
  • Try to make a logical topic, where each change is functional, use 'git commit --amend and/or interactive rebase to clean up a topic before pushing it
  • Push your changes to Gerrit for review, following the instructions here
    • Upload new baseline images (as required) to Midas. The baseline images need not be stored in any particular directory (Midas allows searching by md5 checksums), but must be publicly accessible -- otherwise the CDash machines will not be able to download them.
    • For any changed baseline images, update the md5 file in the source code. For example, if the TestScalarBarCombinatorics.png baseline (created by vtkRenderingMatplotlibCxxTests) changes, then Rendering/Matplotlib/Testing/Data/Baseline/TestScalarBarCombinatorics.png.md5 should be changed to match the md5 sum of the image you upload to Midas. This commit should be pushed to Gerrit along with the changes that alter the baseline.
    • Don't rush committing your code, select reviewers and respond to their feedback.
    • Check the CDash@Home submissions linked to from the topic.
  • Observe the continuous dashboards for the remainder of the day after your commit
  • Observe the nightly dashboards the day following your commit
  • Fix any warnings, errors or test failures related to your commit as soon as possible after becoming aware of them. If they are too difficult to fix quickly or you don't have time to restore the dashboards to green, then back out your changes until you do have time. If you don't, somebody else will do it for you... :-)

More tips to avoid failures

  • Make sure you run all the tests before you commit (at a command prompt in your build directory, type 'ctest', assuming that the cmake and ctest executable directories are in your path).
  • Turn Python wrapping on. About half of the tests in VTK are in Python
  • It might also help to build with MPI
  • Compile code with VTK_EXTRA_COMPILER_WARNINGS enabled so spot new compiler warnings
  • If you add something to VTK, add a test for it as well
  • It is also good to test vtkIdType as both 32 bit and 64 bits (toggled with the VTK_USE_64BIT_IDS CMake option
  • Make sure the Python wrappers work for your code (in both VTK)
  • Mixing floats and doubles in computation is bad
  • Your classes need to have a "PrintSelf()" method that prints out your variables (check if they're NULL first), or else you will get test failures
  • You are not allowed to define copy constructors/operators - instead create a "Copy()" method or something similar
    • You should always declare the "default" copy constructors and operators as private and never implement them
  • Prefix commit messages with the following when committing code to VTK or ParaView:
ENH: Feature Implementation
BUG: Bug fix
STYLE: Coding style change (indenting, braces, non-bug or feature change)
CMP: Fixed compiler error or warning
DOC: Changed a comment



VTK: [Welcome | Site Map]