diff options
| author | jvoisin | 2017-09-25 11:04:23 +0200 |
|---|---|---|
| committer | jvoisin | 2017-09-25 11:04:23 +0200 |
| commit | 4a75a65b099d66bde536beca071d32502653a19f (patch) | |
| tree | 8cb1428a65ae4edea7be8acc2e6db13033103066 /CONTRIBUTING.md | |
| parent | 2bf5b8d082447979ed835fbf00a64ac1f01b2fe5 (diff) | |
Add some data about how to contribute
Diffstat (limited to 'CONTRIBUTING.md')
| -rw-r--r-- | CONTRIBUTING.md | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..acf7220 --- /dev/null +++ b/CONTRIBUTING.md | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | ## Contributing | ||
| 2 | |||
| 3 | First off, thank you for considering contributing to snuffleupagus. | ||
| 4 | |||
| 5 | ### 1. Where do I go from here? | ||
| 6 | |||
| 7 | If you've noticed a bug or have a question, | ||
| 8 | look at the [faq](https://snuffleupagus.readthedocs.io/faq.html) and | ||
| 9 | [search the issue tracker](https://github.com/nbs-system/snuffleupagus/issues) | ||
| 10 | to see if someone else has already created a ticket. If not, go ahead and | ||
| 11 | [make one](https://github.com/nbs-system/snuffleupagus/issues/new)! | ||
| 12 | |||
| 13 | ### 2. Fork & create a branch | ||
| 14 | |||
| 15 | If this is something you think you can fix, | ||
| 16 | then [fork snuffleupagus](https://help.github.com/articles/fork-a-repo) and | ||
| 17 | create a branch with a descriptive name. | ||
| 18 | |||
| 19 | A good branch name would be (where issue #325 is the ticket you're working on): | ||
| 20 | |||
| 21 | ```sh | ||
| 22 | git checkout -b 325-kill-sql-injections | ||
| 23 | ``` | ||
| 24 | |||
| 25 | ### 3. Get the test suite running | ||
| 26 | |||
| 27 | Just type `make coverage` or `make debug`, the testsuite should be run | ||
| 28 | automatically. | ||
| 29 | |||
| 30 | ### 4. Did you find a bug? | ||
| 31 | |||
| 32 | * **Ensure the bug was not already reported** by | ||
| 33 | [searching all issues](https://github.com/nbs-system/snuffleupagus/issues?q=). | ||
| 34 | * If you're unable to find an open issue addressing the problem, | ||
| 35 | [open a new one](https://github.com/nbs-system/snuffleupagus/issues/new). | ||
| 36 | Be sure to include a **title and clear description**, | ||
| 37 | as much relevant information as possible, and a **code sample** | ||
| 38 | or an **executable test case** demonstrating the expected behavior that is not | ||
| 39 | occurring. | ||
| 40 | |||
| 41 | |||
| 42 | ### 5. Get the style right | ||
| 43 | |||
| 44 | Your patch should follow the same conventions & pass the same code quality | ||
| 45 | checks as the rest of the project. We're using [clang-format](http://clang.llvm.org/docs/ClangFormat.html) to | ||
| 46 | ensure a consistent code-style. Please run it with `clang-format -style=google` | ||
| 47 | before committing, or even better, use a [pre-commit hook](https://github.com/andrewseidl/githook-clang-format). | ||
| 48 | |||
| 49 | ### 6. Make a Pull Request | ||
| 50 | |||
| 51 | At this point, you should switch back to your master branch and make sure it's | ||
| 52 | up to date with Active Admin's master branch: | ||
| 53 | |||
| 54 | ```sh | ||
| 55 | git remote add upstream git@github.com:nbs-system/snuffleupagus.git | ||
| 56 | git checkout master | ||
| 57 | git pull upstream master | ||
| 58 | ``` | ||
| 59 | |||
| 60 | Then update your feature branch from your local copy of master, and push it! | ||
| 61 | |||
| 62 | ```sh | ||
| 63 | git checkout 325-kill-sql-injections | ||
| 64 | git rebase master | ||
| 65 | git push --set-upstream origin 325-kill-sql-injections | ||
| 66 | ``` | ||
| 67 | |||
| 68 | Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D | ||
| 69 | |||
| 70 | Travis CI will run our test suite against all supported PHP versions. We care | ||
| 71 | about quality, so your PR won't be merged until all tests pass. It's unlikely, | ||
| 72 | but it's possible that your changes pass tests in one PHP version but fail in | ||
| 73 | another. In that case, you'll have to setup your development environment | ||
| 74 | to use the problematic PHP version, and investigate | ||
| 75 | what's going on! | ||
| 76 | |||
| 77 | ### 7. Keeping your Pull Request updated | ||
| 78 | |||
| 79 | If a maintainer asks you to "rebase" your PR, they're saying that a lot of code | ||
| 80 | has changed, and that you need to update your branch so it's easier to merge. | ||
| 81 | |||
| 82 | To learn more about rebasing in Git, there are a lot of [good](http://git-scm.com/book/en/Git-Branching-Rebasing) | ||
| 83 | [resources](https://help.github.com/articles/interactive-rebase) but here's the suggested workflow: | ||
| 84 | |||
| 85 | ```sh | ||
| 86 | git checkout 325-kill-sql-injections | ||
| 87 | git pull --rebase upstream master | ||
| 88 | git push --force-with-lease 325-kill-sql-injections | ||
| 89 | ``` | ||
| 90 | |||
| 91 | ### 8. Merging a PR (maintainers only) | ||
| 92 | |||
| 93 | A PR can only be merged into master by a maintainer if: | ||
| 94 | |||
| 95 | * It is passing CI. | ||
| 96 | * It has been approved by at least two maintainers. If it was a maintainer who | ||
| 97 | opened the PR, only one extra approval is needed. | ||
| 98 | * It has no requested changes. | ||
| 99 | * It is up to date with current master. | ||
| 100 | |||
| 101 | Any maintainer is allowed to merge a PR if all of these conditions are | ||
| 102 | met. | ||
| 103 | |||
| 104 | ### 9. Shipping a release (maintainers only) | ||
| 105 | |||
| 106 | Maintainers need to do the following to push out a release: | ||
| 107 | |||
| 108 | * Make sure all pull requests are in and that changelog is current | ||
| 109 | * Update `snuggleupagus.h` file and changelog with new version number | ||
| 110 | * Create a stable branch for that release: | ||
| 111 | |||
| 112 | ```sh | ||
| 113 | git pull master | ||
| 114 | make coverage | ||
| 115 | git tag -s $MAJOR.$MINOR.$PATCH | ||
| 116 | git push --tags | ||
| 117 | ``` | ||
| 118 | * Do the *secret release dance* \ No newline at end of file | ||
