CONTRIBUTORS 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ======================
  2. Guide for Contributors
  3. ======================
  4. Our preferred method for accepting contributions is via GitHub pull requests. We
  5. might in the future (when we are more expert on Git) be able to accept patch
  6. files via other means, but at present GitHub is all we are set up to deal with.
  7. Detailed instructions for setting up a GitHub account can be found at
  8. http://help.github.com/ . A quick summary is below:
  9. 1. If you don't already have one, create a GitHub account, then sign in
  10. 2. Fork the HPCC-Platform repository from https://github.com/hpcc-systems/HPCC-Platform
  11. 3. Clone the github repo to the machine you will be working on, using a command like
  12. git clone https://github.com/<your-github-name>/HPCC-Platform.git
  13. or
  14. git clone git@github.com/<your-github-name>/HPCC-Platform.git
  15. depending on whether you have set up a shared-key login to github or not.
  16. Issues
  17. ======
  18. Current open issues can be found at https://track.hpccsystems.com/secure/Dashboard.jspa.
  19. If you want to work on one that is currently unassigned, add a comment to the issue to
  20. indicate that you intend to do so (to help avoid duplicated effort). If the issue is
  21. already assigned but you think you could help, drop a note to the assignee.
  22. If you think you have found a new issue or have a suggestion for an enhancement, you can
  23. open a new issue on this page.
  24. Topic branches and pull requests
  25. ================================
  26. If you want to submit code for a fix or a new feature to the project, the changes should
  27. be pushed to a topic branch in your GitHub fork, so that a pull request referring to
  28. your changes can be generated. Accepting contributions via pull requests allows all
  29. contributions to the project to be properly recorded and credited.
  30. It is considered 'best practice' in git for each topic branch (and thus each pull request)
  31. to contain a single fix or new feature. This allows fixes and features to be merged to
  32. the appropriate version without having to cherry-pick which parts of a patch might be
  33. wanted where. You can have as many branches active as you like if you want to be working
  34. on multiple fixes. In general a topic branch should be addressing a single issue in the
  35. issue tracker.
  36. Because a pull-request refers to a branch of your fork repository, not a commit, it is
  37. best to avoid using the 'master' branch for development work, as it makes it very hard to
  38. keep to the 'one change per branch' rules. You can merge your topic branches to your own
  39. master branch if you want, though generally we recommend keeping the master branch in
  40. sync with the upstream master as you will want to use it as the base to checkout new
  41. topic branches from.
  42. To create a topic branch, use git checkout with the -b argument:
  43. git checkout -b fix-broken-thing master
  44. Switched to a new branch 'fix-broken-thing'
  45. Branch names should be kept reasonable short but long enough to describe what they are
  46. for. Some branch names are used for special purposes in the HPCC-Platform repository and
  47. you should avoid using them for topic branches - examples are 'master', 'candidate-*',
  48. 'release-*', and 'stable'. While it may be tempting to name your branch 'issueXXX' if it
  49. is intending to fix issue XXX, it's probably best not to as it makes it harder to keep
  50. mental track of which branch is which once you are dealing with multiple issues.
  51. Once the branch is created, you can code and test your changes, and commit them any time
  52. you get to a reasonable point to do so (or if you want to switch to working on a
  53. different branch). You can push changes to your github repository periodically in order
  54. to have a backup or if you want to discuss the work in progress with other developers.
  55. This can be done using git push:
  56. git push origin fix-broken-thing
  57. The branch will now show up on your GitHub page, and in the HPCC-Platform network graph.
  58. When you are ready to submit a pull request, switch to the branch in question (from the
  59. Switch Branches list on the source tab in GitHub) and click "Pull Request".
  60. You can add a comment about the pull request - there's no need to replicate the
  61. information that is in the commits concerning what was changed and why, but it's good to
  62. put a link to the issue you are fixing (if you put #175 in the comment then GitHub will
  63. automatically create a link to issue number 175). You can also use the @mention syntax
  64. to ensure that other contributors or maintainers that you think should see this request
  65. are notified.
  66. Note that additional changes can be made to the branch after you have generated a pull
  67. request - for example in order to address issues raised by a reviewer. There is no need
  68. to close a request and open a new one in such circumstances.
  69. If your topic branch is implementing a new feature, it should be based from the master
  70. branch on the upstream repository. If it is fixing a bug that cannot wait for the next
  71. feature release, it should be based from the merge-base of the master and current stable
  72. branches.
  73. Pull upstream changes into your fork regularly
  74. ==============================================
  75. If a new feature in a branch is in development for a while, you should regularly merge
  76. in the upstream master, rather than waiting until you are ready to issue the pull-request
  77. before discovering that other changes clash with yours, or render your change moot. If a
  78. branch has diverged too far from the master that it cannot be easily or safely merged, it
  79. is likely to be rejected by the maintainers.
  80. To pull in upstream changes:
  81. git remote add upstream https://github.com/hpcc-systems/HPCC-Platform.git
  82. git fetch upstream
  83. git merge upstream/master
  84. For more information, see http://help.github.com/fork-a-repo/
  85. Commit guidelines
  86. =================
  87. In order for your pull-request to be accepted into the upstream repository, it will need
  88. to fulfill the following requirements:
  89. 1. All commits must be signed. By signing the commits you are signaling that you have
  90. the appropriate rights to the change you are submitting, and the right to assign
  91. those rights to HPCC Systems® under the terms of the contributory agreement. We have
  92. to be strict about this requirement to keep the lawyers happy.
  93. 2. All new code in the commit should follow the coding standards used by our project,
  94. for layout conventions, variable naming conventions, programming paradigms etc.
  95. If you are using the eclipse IDE, the file misc/hpcc-eclipse-style.xml can be
  96. imported into the settings for the C++ code style formatter.
  97. 3. The code should fix a single issue. If you spot other issues in nearby code, you
  98. should create a separate branch and pull request to fix them (or create an issue and
  99. let someone else fix them).
  100. 4. The code should pass code review by one of the maintainers (or someone they nominate
  101. to review it for them).
  102. 5. The code should compile, without warnings, on all supported targets.
  103. 6. If appropriate, new tests must accompany new functionality.
  104. 7. The commit messages must conform to the commit message guidelines described below
  105. 8. The commits in the branch should progress logically and forwards. If you started
  106. coding something one way, then changed your mind and coded it a different way, use
  107. git rebase -i to squash commits together so that the reviewer doesn't have to
  108. waste time trying to understand the blind alleys
  109. 9. Don't mix code changes with reformatting. This is really a special case of point 3
  110. above but one that seems to cause particular problems. Correct formatting and
  111. whitespace issues on the code that you are submitting, but don't go fixing all the
  112. other formatting in a file just because you changed a line in it - doing so makes it
  113. harder to review your change or to follow the project history.
  114. 10. Submit whitespace/formatting cleanup changes in their own issues, and in small chunks
  115. (e.g. one file, or a few related files in one directory, at a time).
  116. 11. Don't half-fix an issue (unless it's a whitespace cleanup!).
  117. 12. Don't introduce new whitespace issues. You can set up your git to automatically check
  118. that there are no new leading tab or trailing whitespace issues in your commits.
  119. Don't worry if your pull-request is rejected at first - the reasons for the rejection
  120. should always have been explained by the maintainers and it should usually be possible
  121. to address them without starting from scratch. We are fairly strict about most of the
  122. above rules (and extremely strict about some of them) so it's not unusual for a new
  123. contributor to have a few pull-requests rejected the first time they are submitted.
  124. Commit messages
  125. ===============
  126. We follow the same guidelines that many other git projects have adopted for git comments.
  127. 1. The first line of the commit must start HPCC-NNN where NNN is the Jira issue that the
  128. commit is addressing. This should be followed by a space, then a short summary of the
  129. change (this will appear in the condensed form of the changelog generated from the
  130. git history). Start with a capital, do not end with a full stop.
  131. 2. The second line of the commit message should be blank
  132. 3. The remainder of the commit message should be wrapped at 80 chars, and should contain
  133. the following information (where appropriate):
  134. - what the behaviour was before this change.
  135. - what the behaviour is now.
  136. - what is the reason for the change.
  137. Additional information that will be helpful to the reviewer, or to anyone looking at
  138. the git history, should also be provided. However do NOT include in the comment
  139. information that is better provided by looking at the diff - any such information is
  140. at best redundant and at worst contradictory.
  141. Use an active voice, and describe the effect of applying the change. For example, you
  142. should say "Add O(n) travelling salesman support" rather than "Adds fast TSP", "Added
  143. code to make system faster", or "I changed line 32".
  144. 4. The commit message must be signed. Use commit -s to make this easier.
  145. If you copy the files from the githooks directory into .git/hooks, then git will automatically
  146. check (some of) these requirements whenevery you commit. This is strongly encouraged to
  147. ensure that we can accept commits promptly.