diff options
| author | jvoisin | 2018-02-21 12:17:14 +0100 |
|---|---|---|
| committer | jvoisin | 2018-02-21 12:17:14 +0100 |
| commit | f7e6683be7b84042513294b2f15e238f81a0b875 (patch) | |
| tree | 9388cec3e45218729d68f524859046392e4e1b5e | |
| parent | 419065b85aa877df67ee9e3e2db3b3fd9727cb90 (diff) | |
Add a CONTRIBUTING.md
| -rw-r--r-- | CONTRIBUTING.md | 96 | ||||
| -rw-r--r-- | RELEASE.md | 46 |
2 files changed, 96 insertions, 46 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dc6eb57 --- /dev/null +++ b/CONTRIBUTING.md | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | ## Contributing | ||
| 2 | |||
| 3 | First off, thank you for considering contributing to php-malware-finder. | ||
| 4 | |||
| 5 | ### 1. Where do I go from here? | ||
| 6 | |||
| 7 | If you've noticed a bug, an undetected sample or have a question, | ||
| 8 | [search the issue tracker](https://github.com/nbs-system/php-malware-finder/issues) | ||
| 9 | to see if someone else has already created a ticket. If not, go ahead and | ||
| 10 | [make one](https://github.com/nbs-system/php-malware-finder/issues/new)! | ||
| 11 | |||
| 12 | ### 2. Fork & create a branch | ||
| 13 | |||
| 14 | If this is something you think you can fix, | ||
| 15 | then [fork php-malware-finder](https://help.github.com/articles/fork-a-repo) and | ||
| 16 | create a branch with a descriptive name. | ||
| 17 | |||
| 18 | A good branch name would be (where issue #325 is the ticket you're working on): | ||
| 19 | |||
| 20 | ```sh | ||
| 21 | git checkout -b add_new_sample_wp_bruteforcer | ||
| 22 | ``` | ||
| 23 | |||
| 24 | ### 3. Get the test suite running | ||
| 25 | |||
| 26 | Just type `make tests`, the testsuite will be run automatically. | ||
| 27 | |||
| 28 | ### 6. Make a Pull Request | ||
| 29 | |||
| 30 | At this point, you should switch back to your master branch and make sure it's | ||
| 31 | up to date with our upstream master branch: | ||
| 32 | |||
| 33 | ```sh | ||
| 34 | git remote add upstream git@github.com:nbs-system/php-malware-finder.git | ||
| 35 | git checkout master | ||
| 36 | git pull upstream master | ||
| 37 | ``` | ||
| 38 | |||
| 39 | Then update your feature branch from your local copy of master, and push it! | ||
| 40 | |||
| 41 | ```sh | ||
| 42 | git checkout add_new_sample_wp_bruteforcer | ||
| 43 | git rebase master | ||
| 44 | git push --set-upstream origin add_new_sample_wp_bruteforcer | ||
| 45 | ``` | ||
| 46 | |||
| 47 | Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D | ||
| 48 | |||
| 49 | Travis CI will [run our test suite](https://travis-ci.org/nbs-system/php-malware-finder). | ||
| 50 | We care about quality, so your PR won't be merged until all tests are passing. | ||
| 51 | |||
| 52 | ### 7. Keeping your Pull Request updated | ||
| 53 | |||
| 54 | If a maintainer asks you to "rebase" your PR, they're saying that a lot of code | ||
| 55 | has changed, and that you need to update your branch so it's easier to merge. | ||
| 56 | |||
| 57 | To learn more about rebasing in Git, there are a lot of [good](http://git-scm.com/book/en/Git-Branching-Rebasing) | ||
| 58 | [resources](https://help.github.com/articles/interactive-rebase) but here's the suggested workflow: | ||
| 59 | |||
| 60 | ```sh | ||
| 61 | git checkout add_new_sample_wp_bruteforcer | ||
| 62 | git pull --rebase upstream master | ||
| 63 | git push --force-with-lease add_new_sample_wp_bruteforcer | ||
| 64 | ``` | ||
| 65 | |||
| 66 | ### 8. Merging a PR (maintainers only) | ||
| 67 | |||
| 68 | A PR can only be merged into master by a maintainer if: | ||
| 69 | |||
| 70 | 1. It is passing CI. | ||
| 71 | 2. It has no requested changes. | ||
| 72 | 3. It is up to date with current master. | ||
| 73 | |||
| 74 | Any maintainer is allowed to merge a PR if all of these conditions are met. | ||
| 75 | |||
| 76 | ### 9. Shipping a release (maintainers only) | ||
| 77 | |||
| 78 | 1. Make sure that all pending and mergeable pull requests are in | ||
| 79 | 2. Make sure that the all the tests are passing, with `make tests` | ||
| 80 | 3. Update the Debian changelog in `./debian/changelog` with `dch -i` | ||
| 81 | 4. Commit the result | ||
| 82 | 5. Create a tag for the release: | ||
| 83 | |||
| 84 | ```sh | ||
| 85 | git checkout master | ||
| 86 | git pull origin master | ||
| 87 | make tests | ||
| 88 | git config user.signingkey 498C46FF087EDC36E7EAF9D445414A82A9B22D78 | ||
| 89 | git config user.email security@nbs-system.com | ||
| 90 | git tag -s v$MAJOR.$MINOR.$PATCH -m "v$MAJOR.$MINOR.$PATCH" | ||
| 91 | git push --tags | ||
| 92 | ``` | ||
| 93 | |||
| 94 | 6. Build the debian package with `make deb` | ||
| 95 | 7. Create the [release on github](https://github.com/nbs-system/php-malware-finder/releases) | ||
| 96 | 8. Do the *secret release dance* | ||
diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 1c09c06..0000000 --- a/RELEASE.md +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | # PHP Malware Finder release documentation | ||
| 2 | |||
| 3 | ## What should I do before releasing? | ||
| 4 | |||
| 5 | Thou shalt test your modifications. If everything goes fine, you should see this | ||
| 6 | message: | ||
| 7 | |||
| 8 | ``` | ||
| 9 | $ make tests | ||
| 10 | [+] Congratz, the XX tests succeeded! | ||
| 11 | ``` | ||
| 12 | |||
| 13 | Otherwise, your modifications introduced a regression, fix them, | ||
| 14 | then **test again** until all tests are passing. | ||
| 15 | |||
| 16 | ## OK, it's done, how do I release my new PMF version now? | ||
| 17 | |||
| 18 | First, make sure enough modifications have been made to warrant a new release. | ||
| 19 | Since PMF provides its own debian package files, you may build a package, | ||
| 20 | hence the need to modify the changelog file to add an entry in the | ||
| 21 | `debian/changelog` file: | ||
| 22 | |||
| 23 | You should use the `dch -i` command instead of editing the changelog by hand, | ||
| 24 | but if you don't have it installed, you can add something like this: | ||
| 25 | |||
| 26 | ``` | ||
| 27 | nbs-phpmalwarefinder (X.Y.Z-T~deb##version+nbsYYYMMDD) distrib; urgency=XXX | ||
| 28 | |||
| 29 | * new feature | ||
| 30 | * bug fix | ||
| 31 | * moar documentation | ||
| 32 | |||
| 33 | -- yournick <your@email.com> `date -R` | ||
| 34 | ``` | ||
| 35 | |||
| 36 | Then you can commit on our git repository: | ||
| 37 | |||
| 38 | ``` | ||
| 39 | $ git commit -am "X.Y.Z" | ||
| 40 | $ git tag X.Y.Z | ||
| 41 | $ git push --tags | ||
| 42 | ``` | ||
| 43 | |||
| 44 | Do not forget to update the [milestones on github]( | ||
| 45 | https://github.com/nbs-system/php-malware-finder/milestones ). | ||
| 46 | |||
