Permalink
cockroach/CONTRIBUTING.md
Newer
100644
78 lines (53 sloc)
4.1 KB
6
* A working C++ compiler (on mac os x something like `xcode-select
7
--install` will get you started). The compiler must support C++11
8
(GCC 4.9+ and clang 3.6+ are known to work).
9
* [Go environment](http://golang.org/doc/code.html). Currently a
10
64-bit version of go 1.5 is required.
11
* Git 1.8+ and Mercurial (for retrieving dependencies).
12
13
If you're on Mac OS X, [homebrew](http://brew.sh/) can be very helpful to fulfill these dependencies.
14
15
You can `go get -d github.com/cockroachdb/cockroach` or, alternatively,
18
mkdir -p $GOPATH/src/github.com/cockroachdb/
19
cd $GOPATH/src/github.com/cockroachdb/
20
git clone git@github.com:cockroachdb/cockroach.git
21
cd cockroach
24
Now you should be all set for `make build`, `make test` and everything else our Makefile has to
25
offer. Note that the first time you run `make` various dependent libraries and tools will be
26
downloaded and installed which can be somewhat time consuming. Be patient.
28
Note that if you edit a `.proto` or `.ts` file, you will need to manually regenerate the associated `.pb.{go,cc,h}` or `.js` files using `go generate ./...`.
29
`go generate` requires a collection of node modules which are installed via npm. If you don't have npm, it typically comes with node. To get it via homebrew:
31
If you're not using homebrew, make sure you install both [node.js](https://nodejs.org/) and [npm](https://www.npmjs.com/).
32
If you plan on working on the UI, check out [the ui readme](ui).
35
- `(cd $GOPATH/src && go get -u ./...)` to update the dependencies or `go get {package}` to add a dependency
36
- `glock save github.com/cockroachdb/cockroach` to update the GLOCKFILE
40
### Style guide
41
We're following the [Google Go Code Review](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) fairly closely. In particular, you want to watch out for proper punctuation and capitalization and make sure that your lines stay well below 80 characters.
42
46
[Contributor License Agreement](https://cla-assistant.io/cockroachdb/cockroach).
48
+ Create a local feature branch to do work on, ideally on one thing at a time.
50
[this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
51
on forking in Go, which ensures that Go import paths will be correct.
53
`git checkout -b $USER/update-readme`
55
+ Hack away and commit your changes locally using `git add` and `git commit`.
59
+ Run tests. It's usually enough to run `make test testrace`. You can also run `make acceptance` to have better test coverage. Running acceptance tests requires the Docker setup.
60
61
+ When you’re ready for review, create a remote branch from your local branch. You may want to `git fetch origin` and run `git rebase origin/master` on your local feature branch before.
63
`git push -u origin $USER/update-readme`
65
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request).
66
67
+ Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
68
69
+ Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
70
`git rebase -i HEAD~n`
71
72
and subsequently update your remote (you will have to force the push, `git push -f $USER mybranch`). The pull request will update.
73
74
+ If you do not have write access to the repository and your pull request requires a manual merge, you may be asked to rebase again,
75
`git fetch origin; git rebase -i origin/master` and update the PR again. Otherwise, you are free to merge your branch into origin/master directly or rebase first as you deem appropriate.
76
77
+ If you get a test failure in CircleCI, check the Test Failure tab to see why the test failed. When the failure is logged in `excerpt.txt`, you can find the file from the Artifacts tab and see log messages. (You need to sign in to see the Artifacts tab.)