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.

129 lines
5.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  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 (i.e. `$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 [dep](https://github.com/golang/dep) to manage dependencies.
  25. That said, the master branch of every Tendermint repository should just build
  26. with `go get`, which means they should be kept up-to-date with their
  27. dependencies so we can get away with telling people they can just `go get` our
  28. software.
  29. Since some dependencies are not under our control, a third party may break our
  30. build, in which case we can fall back on `dep ensure` (or `make
  31. get_vendor_deps`). Even for dependencies under our control, dep helps us to
  32. keep multiple repos in sync as they evolve. Anything with an executable, such
  33. as apps, tools, and the core, should use dep.
  34. Run `dep status` to get a list of vendor dependencies that may not be
  35. up-to-date.
  36. When updating dependencies, please only update the particular dependencies you
  37. need. Instead of running `dep ensure -update`, which will update anything,
  38. specify exactly the dependency you want to update, eg.
  39. `dep ensure -update github.com/tendermint/go-amino`.
  40. ## Vagrant
  41. If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started
  42. hacking Tendermint with the commands below.
  43. NOTE: In case you installed Vagrant in 2017, you might need to run
  44. `vagrant box update` to upgrade to the latest `ubuntu/xenial64`.
  45. ```
  46. vagrant up
  47. vagrant ssh
  48. make test
  49. ```
  50. ## Testing
  51. All repos should be hooked up to [CircleCI](https://circleci.com/).
  52. If they have `.go` files in the root directory, they will be automatically
  53. tested by circle using `go test -v -race ./...`. If not, they will need a
  54. `circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and
  55. includes its continuous integration status using a badge in the `README.md`.
  56. ## Changelog
  57. ## Branching Model and Release
  58. All repos should adhere to the branching model: http://nvie.com/posts/a-successful-git-branching-model/.
  59. This means that all pull-requests should be made against develop. Any merge to
  60. master constitutes a tagged release.
  61. ### Development Procedure:
  62. - the latest state of development is on `develop`
  63. - `develop` must never fail `make test`
  64. - never --force onto `develop` (except when reverting a broken commit, which should seldom happen)
  65. - create a development branch either on github.com/tendermint/tendermint, or your fork (using `git remote add origin`)
  66. - make changes and update the `CHANGELOG_PENDING.md` to record your change
  67. - before submitting a pull request, run `git rebase` on top of the latest `develop`
  68. ### Pull Merge Procedure:
  69. - ensure pull branch is based on a recent develop
  70. - run `make test` to ensure that all tests pass
  71. - merge pull request
  72. - the `unstable` branch may be used to aggregate pull merges before fixing tests
  73. ### Release Procedure:
  74. - start on `develop`
  75. - run integration tests (see `test_integrations` in Makefile)
  76. - prepare changelog:
  77. - copy `CHANGELOG_PENDING.md` to `CHANGELOG.md`
  78. - run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
  79. all issues
  80. - run `bash ./scripts/authors.sh` to get a list of authors since the latest
  81. release, and add the github aliases of external contributors to the top of
  82. the changelog. To lookup an alias from an email, try `bash
  83. ./scripts/authors.sh <email>`
  84. - bump versions
  85. - push to release/vX.X.X to run the extended integration tests on the CI
  86. - merge to master
  87. - merge master back to develop
  88. ### Hotfix Procedure:
  89. - start on `master`
  90. - checkout a new branch named hotfix-vX.X.X
  91. - make the required changes
  92. - these changes should be small and an absolute necessity
  93. - add a note to CHANGELOG.md
  94. - bump versions
  95. - push to hotfix-vX.X.X to run the extended integration tests on the CI
  96. - merge hotfix-vX.X.X to master
  97. - merge hotfix-vX.X.X to develop
  98. - delete the hotfix-vX.X.X branch