VTK/Commit Guidelines: Difference between revisions
From KitwarePublic
< VTK
Jump to navigationJump to search
m (moved VTK cvs commit Guidelines to VTK/Commit Guidelines: We don't use CVS anymore - adapting to the new Git/Gerrit workflow) |
(Adapted the guidelines here for Git and Gerrit) |
||
Line 7: | Line 7: | ||
* Run ctest in your binary directory and make sure '''all''' the VTK tests pass before committing your code | * 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 | * 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 [[VTK/Git/Develop|Gerrit for review]], following the [[VTK/Git|instructions here]] | ||
** Don't rush committing your code, select reviewers and respond to their feedback | |||
* | ** Check the CDash@Home submissions linked to from the topic | ||
** '''Do not push new baseline images''' until the topic is merged | |||
** Baseline images should be pushed once a topic has been approved and is about to be merged | |||
*** This situation will improve in the future | |||
* Observe the continuous dashboards for the remainder of the day after your commit | * Observe the continuous dashboards for the remainder of the day after your commit | ||
Line 27: | Line 31: | ||
==More tips to avoid failures== | ==More tips to avoid failures== | ||
* Make sure you run all the tests before you commit ( | * 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 | * 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 | * Make sure the Python wrappers work for your code (in both VTK) | ||
* Mixing floats and doubles in computation is bad | * 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 | * 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: | * Prefix commit messages with the following when committing code to VTK or ParaView: |
Revision as of 15:10, 14 March 2013
- Follow the VTK Coding Standards when writing new code or modifying existing code
- 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
- Don't rush committing your code, select reviewers and respond to their feedback
- Check the CDash@Home submissions linked to from the topic
- Do not push new baseline images until the topic is merged
- Baseline images should be pushed once a topic has been approved and is about to be merged
- This situation will improve in the future
- 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