|
| 1 | +# Contribution Guidelines |
| 2 | + |
| 3 | +We gladly accept outside contributions. We use our |
| 4 | +[Github issue tracker](https://github.com/python-zk/kazoo/issues) |
| 5 | +for both discussions and talking about new features or bugs. You can |
| 6 | +also fork the project and sent us a pull request. If you have a more |
| 7 | +general topic to discuss, the |
| 8 | +[[email protected]](https://zookeeper.apache.org/lists.html) |
| 9 | +mailing list is a good place to do so. You can sometimes find us on |
| 10 | +IRC in the |
| 11 | +[#zookeeper channel on freenode](https://zookeeper.apache.org/irc.html). |
| 12 | + |
| 13 | +[See the README](/README.rst) for contact information. |
| 14 | + |
| 15 | +## Development |
| 16 | + |
| 17 | +If you want to work on the code and sent us a |
| 18 | +[pull request](https://help.github.com/articles/using-pull-requests), |
| 19 | +first fork the repository on github to your own account. Then clone |
| 20 | +your new repository and run the build scripts: |
| 21 | + |
| 22 | +``` |
| 23 | + git clone [email protected]:<username>/kazoo.git |
| 24 | + cd kazoo |
| 25 | + make |
| 26 | +``` |
| 27 | + |
| 28 | +You need to have some supported version of Python installed and have |
| 29 | +it available as `python` in your shell. To run Zookeeper you also |
| 30 | +need a Java runtime (JRE or JDK) version 6 or 7. To run tests, you |
| 31 | +need to have the tox, Python testing tool, to be installed in your shell. |
| 32 | + |
| 33 | +You can run all the tests by calling: |
| 34 | + |
| 35 | +``` |
| 36 | + make test |
| 37 | +``` |
| 38 | + |
| 39 | +Or to run individual tests: |
| 40 | + |
| 41 | +``` |
| 42 | + export ZOOKEEPER_PATH=/<path to current folder>/bin/zookeeper/ |
| 43 | + bin/nosetests -s -d kazoo.tests.test_client:TestClient.test_create |
| 44 | +``` |
| 45 | + |
| 46 | +The nose test runner allows you to filter by test module, class or |
| 47 | +individual test method. |
| 48 | + |
| 49 | +If you made changes to the documentation, you can build it locally: |
| 50 | + |
| 51 | +``` |
| 52 | + make html |
| 53 | +``` |
| 54 | + |
| 55 | +And then open `./docs/_build/html/index.html` in a web browser to |
| 56 | +verify the correct rendering. |
| 57 | + |
| 58 | + |
| 59 | +## Bug Reports |
| 60 | + |
| 61 | +You can file issues here on GitHub. Please try to include as much information as |
| 62 | +you can and under what conditions you saw the issue. |
| 63 | + |
| 64 | +## Adding Recipes |
| 65 | + |
| 66 | +New recipes are welcome, however they should include the status/maintainer |
| 67 | +RST information so its clear who is maintaining the recipe. This does mean |
| 68 | +that if you submit a recipe for inclusion with Kazoo, you should be ready |
| 69 | +to support/maintain it, and address bugs that may be found. |
| 70 | + |
| 71 | +Ideally a recipe should have at least two maintainers. |
| 72 | + |
| 73 | +## Sending Pull Requests |
| 74 | + |
| 75 | +Patches should be submitted as pull requests (PR). |
| 76 | + |
| 77 | +Before submitting a PR: |
| 78 | +- Your code must run and pass all the automated tests before you submit your PR |
| 79 | + for review. "Work in progress" pull requests are allowed to be submitted, but |
| 80 | + should be clearly labeled as such and should not be merged until all tests |
| 81 | + pass and the code has been reviewed. |
| 82 | +- Your patch should include new tests that cover your changes. It is your and |
| 83 | + your reviewer's responsibility to ensure your patch includes adequate tests. |
| 84 | + |
| 85 | +When submitting a PR: |
| 86 | +- You agree to license your code under the project's open source license |
| 87 | + ([APL 2.0](/LICENSE)). |
| 88 | +- Base your branch off the current `master`. |
| 89 | +- Add both your code and new tests if relevant. |
| 90 | +- Sign your git commit. |
| 91 | +- Run the test suite to make sure your code passes linting and tests. |
| 92 | +- Ensure your changes do not reduce code coverage of the test suite. |
| 93 | +- Please do not include merge commits in pull requests; include only commits |
| 94 | + with the new relevant code. |
| 95 | + |
| 96 | + |
| 97 | +## Code Review |
| 98 | + |
| 99 | +This project is production Mozilla code and subject to our [engineering practices and quality standards](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Committing_Rules_and_Responsibilities). Every patch must be peer reviewed. |
| 100 | + |
| 101 | +## Git Commit Guidelines |
| 102 | + |
| 103 | +We loosely follow the [Angular commit guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#type) |
| 104 | +of `<type>(scope): <subject>` where `type` must be one of: |
| 105 | + |
| 106 | +* **feat**: A new feature |
| 107 | +* **fix**: A bug fix |
| 108 | +* **docs**: Documentation only changes |
| 109 | +* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing |
| 110 | + semi-colons, etc) |
| 111 | +* **refactor**: A code change that neither fixes a bug or adds a feature |
| 112 | +* **perf**: A code change that improves performance |
| 113 | +* **test**: Adding missing tests |
| 114 | +* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation |
| 115 | + generation |
| 116 | + |
| 117 | +Scope may be left off if none of these components are applicable: |
| 118 | + |
| 119 | +* **core**: Core client/connection handling |
| 120 | +* **recipe**: Changes/Fixes/Additions to recipes |
| 121 | + |
| 122 | +### Subject |
| 123 | + |
| 124 | +The subject contains succinct description of the change: |
| 125 | + |
| 126 | +* use the imperative, present tense: "change" not "changed" nor "changes" |
| 127 | +* don't capitalize first letter |
| 128 | +* no dot (.) at the end |
| 129 | + |
| 130 | +### Body |
| 131 | + |
| 132 | +In order to maintain a reference to the context of the commit, add |
| 133 | +`closes #<issue_number>` if it closes a related issue or `issue #<issue_number>` |
| 134 | +if it's a partial fix. |
| 135 | + |
| 136 | +You can also write a detailed description of the commit: Just as in the |
| 137 | +**subject**, use the imperative, present tense: "change" not "changed" nor |
| 138 | +"changes" It should include the motivation for the change and contrast this with |
| 139 | +previous behavior. |
| 140 | + |
| 141 | +### Footer |
| 142 | + |
| 143 | +The footer should contain any information about **Breaking Changes** and is also |
| 144 | +the place to reference GitHub issues that this commit **Closes**. |
| 145 | + |
| 146 | +### Example |
| 147 | + |
| 148 | +A properly formatted commit message should look like: |
| 149 | + |
| 150 | +``` |
| 151 | +feat(core): add tasty cookies to the client handler |
| 152 | +
|
| 153 | +Properly formatted commit messages provide understandable history and |
| 154 | +documentation. This patch will provide a delicious cookie when all tests have |
| 155 | +passed and the commit message is properly formatted. |
| 156 | +
|
| 157 | +BREAKING CHANGE: This patch requires developer to lower expectations about |
| 158 | + what "delicious" and "cookie" may mean. Some sadness may result. |
| 159 | +
|
| 160 | +Closes #3.14, #9.75 |
| 161 | +``` |
| 162 | + |
| 163 | +# Legal |
| 164 | + |
| 165 | +Currently we don't have any legal contributor agreement, so code |
| 166 | +ownership stays with the original authors. |
0 commit comments