contribute.dox 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 and not get disappointed in the process.
  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 that
  41. 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
  43. BIND10 is portable software. Besides Linux, it is compiled and used on
  44. relatively uncommon systems like OpenBSD and Solaris 11. Will your
  45. code compile and work there? What about endianess? It is likely
  46. that you used a regular x86 architecture machine to write your patch, but the software is expected to run on many
  47. other architectures.
  48. Does your patch conforms to BIND10
  49. http://bind10.isc.org/wiki/CodingGuidelines? You still can submit
  50. a patch that does not adhere to it, but it will decrease your
  51. chances of being accepted. If the deviations are minor, ISC engineer
  52. that will do the review, will likely fix the issues. However,
  53. if there are lots of them, reviewer may simply reject the patch
  54. and ask you to fix it, before resubmitting.
  55. @section contributorGuideUnittests Running unit-tests
  56. One of the ground rules in BIND10 development is that every piece of
  57. code has to be tested. We now have an extensive set of unit-tests for
  58. almost every line of code. Even if you are fixing something small,
  59. like a single line fix, it is encouraged to write unit-test for that
  60. change. That is even more true for new code. If you write a new
  61. function, method or a class, you definitely should write unit-tests
  62. for it.
  63. BIND10 uses google test (gtest) framework as a base for our
  64. unit-tests. See http://code.google.com/p/googletest/ for details.
  65. You must have gtest installed or at least compiled before compiling
  66. BIND10 unit-tests. To enable unit-tests in BIND10
  67. @code
  68. ./configure --with-gtest=/path/to/your/gtest/dir
  69. @endcode
  70. or
  71. @code
  72. ./configure --with-gtest-source=/path/to/your/gtest/dir
  73. @endcode
  74. There are other useful switches passed to configure. It is always a good
  75. idea to use --enable-logger-checks, which does sanity checks on logger
  76. parameters. If you happen to modify anything in the documentation, use
  77. --enable-generate-docs. If you are modifying DHCP code, you are likely
  78. to be interested in MySQL backend for DHCP. Keep note that if the backend
  79. is not enabled, MySQL specific unit-tests are skipped, too. From that
  80. perspective, it is useful to use --with-dhcp-mysql parameter. For a
  81. complete list of all switches, use:
  82. @code
  83. ./configure --help
  84. @endcode
  85. Depending on how you compiled or installed (e.g. from sources or using
  86. some package management system) one of those two switches will find
  87. gtest. After that you make run unit-tests:
  88. @code
  89. make check
  90. @endcode
  91. If you happen to add new files or modified Makefiles, it is also a
  92. good idea to check if you haven't broken distribution process:
  93. @code
  94. make distcheck
  95. @endcode
  96. @section contributorGuideReview Going through a review
  97. Once all those are checked and working, feel free to create a ticket
  98. for your patch (http://bind10.isc.org) or attach your patch to the
  99. existing ticket if there is one. You may drop a note to bind10 or dhcp
  100. chatroom saying that you have submitted a patch. Alternatively, you
  101. may send a note to bind10-dev or bind10-dhcp lists.
  102. Here's the tricky part. One of BIND10 developers will review your
  103. patch, but it may not happen immediately. Unfortunately, developers
  104. are usually working under tight schedule, so any extra unplanned
  105. review work sometimes make take a while. Having said that, we value
  106. external contributions very much and will do whatever we can to
  107. review patches in a timely manner. Don't get discouraged if your
  108. patch is not accepted after first review. To keep the code quality
  109. high, we use the same review processes for internal code and for
  110. external patches. It may take several cycles of review/updated patch
  111. submissions before the code is finally accepted.
  112. Once the process is almost completed, the developer will likely ask
  113. you how you would like to be credited. The typical answers are by
  114. first,last name, by nickname, by company or anonymously. Typically we
  115. will add a note to ChangeLog. If the contributted feature is big or
  116. critical for whatever reason, it may be also mentioned in release
  117. notes.
  118. @section contributorGuideExtra Extra steps
  119. If you are interested in even more in-depth testing, you are welcome
  120. to visit BIND10 build farm: http://git.bind10.isc.org/~tester/builder/builder-new.html
  121. This is a life result page with all tests being run on various systems.
  122. Besides basic unit-tests, we also run them with valgrind (memory debugger),
  123. with cppcheck and scan-build (static code analyzers), Lettuce system tests
  124. and more. Although it is not possible for non ISC employees to run tests
  125. on that farm, it is possible that your contributed patch will end up there
  126. sooner or later.
  127. */