contribute.dox 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. /**
  15. @page contributorGuide BIND10 Contributor's Guide
  16. So you found a bug in BIND10 or plan to develop an extension and want to
  17. send a patch? Great! This page will explain how to contribute your
  18. changes smoothly.
  19. @section contributorGuideWritePatch Writing a patch
  20. Before you start working on a patch or a new feature, it is a good idea
  21. to discuss it first with BIND10 developers. You can post your questions
  22. to the \c bind10-dev mailing list
  23. (https://lists.isc.org/mailman/listinfo/bind10-dev) for general BIND10
  24. stuff, or to the \c bind10-dhcp mailing list
  25. (https://lists.isc.org/mailman/listinfo/bind10-dhcp) for DHCP specific
  26. topics. If you prefer to get faster feedback, most BIND10 developers
  27. hang out in the \c bind10 jabber room
  28. (xmpp:bind10@conference.jabber.isc.org). Those involved in DHCP also use
  29. the \c dhcp chatroom (xmpp:dhcp@conference.jabber.isc.org). Feel free to
  30. join these rooms and talk to us. It is possible that someone else is
  31. working on your specific issue or perhaps the solution you plan to
  32. implement is not the best one. Often having a 10 minute talk could save
  33. many hours of engineering work.
  34. First step would be to get the source code from our Git repository. The
  35. procedure is very easy and is explained here:
  36. http://bind10.isc.org/wiki/GitGuidelines. While it is possible to
  37. provide a patch against the latest stable release, it makes the review
  38. process much easier if it is for latest code from the Git \c master
  39. branch.
  40. Ok, so you have written a patch? Great! Before you submit it, make sure
  41. that your code compiles. This may seem obvious, but there's more to
  42. it. You have surely checked that it compiles on your system, but BIND10
  43. is portable software. Besides Linux, it is compiled and used on
  44. relatively uncommon systems like OpenBSD and Solaris 11. Will your code
  45. compile and work there? What about endianess? It is likely that you used
  46. a regular x86 architecture machine to write your patch, but the software
  47. is expected to run on many other architectures. You may take a look at
  48. system specific build notes (http://bind10.isc.org/wiki/SystemSpecificNotes).
  49. For a complete list of systems we build on, you may take a look at the
  50. following build farm report: http://git.bind10.isc.org/~tester/builder/builder-new.html .
  51. Does your patch conform to BIND10 coding guidelines
  52. (http://bind10.isc.org/wiki/CodingGuidelines)? You still can submit a
  53. patch that does not adhere to it, but that will decrease its chances of
  54. being accepted. If the deviations are minor, the BIND10 engineer who
  55. does the review will likely fix the issues. However, if there are lots
  56. of issues, the reviewer may simply reject the patch and ask you to fix
  57. it before re-submitting.
  58. @section contributorGuideUnittests Running unit-tests
  59. One of the ground rules in BIND10 development is that every piece of
  60. code has to be tested. We now have an extensive set of unit-tests for
  61. almost every line of code. Even if you are fixing something small,
  62. like a single line fix, it is encouraged to write unit-tests for that
  63. change. That is even more true for new code. If you write a new
  64. function, method or a class, you definitely should write unit-tests
  65. for it.
  66. BIND10 uses the Google C++ Testing Framework (also called googletest or
  67. gtest) as a base for our C++ unit-tests. See
  68. http://code.google.com/p/googletest/ for details. For Python unit-tests,
  69. we use the its \c unittest library which is included in Python. You must
  70. have \c gtest installed or at least extracted in a directory before
  71. compiling BIND10 unit-tests. To enable unit-tests in BIND10, use:
  72. @code
  73. ./configure --with-gtest=/path/to/your/gtest/dir
  74. @endcode
  75. or
  76. @code
  77. ./configure --with-gtest-source=/path/to/your/gtest/dir
  78. @endcode
  79. Depending on how you compiled or installed \c gtest (e.g. from sources
  80. or using some package management system) one of those two switches will
  81. find \c gtest. After that you make run unit-tests:
  82. @code
  83. make check
  84. @endcode
  85. If you happen to add new files or have modified any \c Makefile.am
  86. files, it is also a good idea to check if you haven't broken the
  87. distribution process:
  88. @code
  89. make distcheck
  90. @endcode
  91. There are other useful switches which can be passed to configure. It is
  92. always a good idea to use \c --enable-logger-checks, which does sanity
  93. checks on logger parameters. If you happen to modify anything in the
  94. documentation, use \c --enable-generate-docs. If you are modifying DHCP
  95. code, you are likely to be interested in enabling the MySQL backend for
  96. DHCP. Note that if the backend is not enabled, MySQL specific unit-tests
  97. are skipped. From that perspective, it is useful to use
  98. \c --with-dhcp-mysql. For a complete list of all switches, use:
  99. @code
  100. ./configure --help
  101. @endcode
  102. @section contributorGuideReview Going through a review
  103. Once all those are checked and working, feel free to create a ticket for
  104. your patch at http://bind10.isc.org/ or attach your patch to an existing
  105. ticket if you have fixed it. It would be nice if you also join the
  106. \c bind10 or \c dhcp chatroom saying that you have submitted a
  107. patch. Alternatively, you may send a note to the \c bind10-dev or
  108. \c bind10-dhcp mailing lists.
  109. Here's the tricky part. One of BIND10 developers will review your patch,
  110. but it may not happen immediately. Unfortunately, developers are usually
  111. working under a tight schedule, so any extra unplanned review work may
  112. take a while sometimes. Having said that, we value external
  113. contributions very much and will do whatever we can to review patches in
  114. a timely manner. Don't get discouraged if your patch is not accepted
  115. after first review. To keep the code quality high, we use the same
  116. review processes for internal code and for external patches. It may take
  117. some cycles of review/updated patch submissions before the code is
  118. finally accepted.
  119. Once the process is almost complete, the developer will likely ask you
  120. how you would like to be credited. The typical answers are by first and
  121. last name, by nickname, by company name or anonymously. Typically we
  122. will add a note to the \c ChangeLog and also set you as the author of
  123. the commit applying the patch. If the contributted feature is big or
  124. critical for whatever reason, it may also be mentioned in release notes.
  125. @section contributorGuideExtra Extra steps
  126. If you are interested in knowing the results of more in-depth testing,
  127. you are welcome to visit the BIND10 build farm:
  128. http://git.bind10.isc.org/~tester/builder/builder-new.html. This is a
  129. live result page with all tests being run on various systems. Besides
  130. basic unit-tests, we also have reports from Valgrind (memory debugger),
  131. cppcheck and clang-analyzer (static code analyzers), Lettuce system
  132. tests and more. Although it is not possible for non ISC employees to run
  133. tests on that farm, it is possible that your contributed patch will end
  134. up there sooner or later.
  135. */