You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
4.4 KiB

  1. # Contributing
  2. Thank you for considering making contributions to Tendermint and related repositories! Start by taking a look at the [coding repo](https://github.com/tendermint/coding) for overall information on repository workflow and standards.
  3. Please follow standard github best practices: fork the repo, branch from the tip of develop, make some commits, and submit a pull request to develop. See the [open issues](https://github.com/tendermint/tendermint/issues) for things we need help with!
  4. Please make sure to use `gofmt` before every commit - the easiest way to do this is have your editor run it for you upon saving a file.
  5. ## Forking
  6. Please note that Go requires code to live under absolute paths, which complicates forking.
  7. While my fork lives at `https://github.com/ebuchman/tendermint`,
  8. the code should never exist at `$GOPATH/src/github.com/ebuchman/tendermint`.
  9. Instead, we use `git remote` to add the fork as a new remote for the original repo,
  10. `$GOPATH/src/github.com/tendermint/tendermint `, and do all the work there.
  11. For instance, to create a fork and work on a branch of it, I would:
  12. * Create the fork on github, using the fork button.
  13. * Go to the original repo checked out locally (ie. `$GOPATH/src/github.com/tendermint/tendermint`)
  14. * `git remote rename origin upstream`
  15. * `git remote add origin git@github.com:ebuchman/basecoin.git`
  16. Now `origin` refers to my fork and `upstream` refers to the tendermint version.
  17. So I can `git push -u origin master` to update my fork, and make pull requests to tendermint from there.
  18. Of course, replace `ebuchman` with your git handle.
  19. To pull in updates from the origin repo, run
  20. * `git fetch upstream`
  21. * `git rebase upstream/master` (or whatever branch you want)
  22. Please don't make Pull Requests to `master`.
  23. ## Dependencies
  24. We use [glide](https://github.com/masterminds/glide) to manage dependencies.
  25. That said, the master branch of every Tendermint repository should just build with `go get`, which means they should be kept up-to-date with their dependencies so we can get away with telling people they can just `go get` our software.
  26. Since some dependencies are not under our control, a third party may break our build, in which case we can fall back on `glide install`. Even for dependencies under our control, glide helps us keeps multiple repos in sync as they evolve. Anything with an executable, such as apps, tools, and the core, should use glide.
  27. Run `bash scripts/glide/status.sh` to get a list of vendored dependencies that may not be up-to-date.
  28. ## Vagrant
  29. If you are a [Vagrant](https://www.vagrantup.com/) user, all you have to do to get started hacking Tendermint is:
  30. ```
  31. vagrant up
  32. vagrant ssh
  33. cd ~/go/src/github.com/tendermint/tendermint
  34. make test
  35. ```
  36. ## Testing
  37. All repos should be hooked up to circle.
  38. If they have `.go` files in the root directory, they will be automatically tested by circle using `go test -v -race ./...`. If not, they will need a `circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and includes its continuous integration status using a badge in the `README.md`.
  39. ## Branching Model and Release
  40. User-facing repos should adhere to the branching model: http://nvie.com/posts/a-successful-git-branching-model/.
  41. That is, these repos should be well versioned, and any merge to master requires a version bump and tagged release.
  42. Libraries need not follow the model strictly, but would be wise to,
  43. especially `go-p2p` and `go-rpc`, as their versions are referenced in tendermint core.
  44. ### Development Procedure:
  45. - the latest state of development is on `develop`
  46. - `develop` must never fail `make test`
  47. - no --force onto `develop` (except when reverting a broken commit, which should seldom happen)
  48. - create a development branch either on github.com/tendermint/tendermint, or your fork (using `git add origin`)
  49. - before submitting a pull request, begin `git rebase` on top of `develop`
  50. ### Pull Merge Procedure:
  51. - ensure pull branch is rebased on develop
  52. - run `make test` to ensure that all tests pass
  53. - merge pull request
  54. - the `unstable` branch may be used to aggregate pull merges before testing once
  55. - push master may request that pull requests be rebased on top of `unstable`
  56. ### Release Procedure:
  57. - start on `develop`
  58. - run integration tests (see `test_integrations` in Makefile)
  59. - prepare changelog/release issue
  60. - bump versions
  61. - push to release-vX.X.X to run the extended integration tests on the CI
  62. - merge to master
  63. - merge master back to develop