-
Notifications
You must be signed in to change notification settings - Fork 138
Development workflow
This document is geared towards developers, and there is a bias towards an approach that plays as nicely as possible with editors, IDEs, and other tooling at the expense of a bit of extra effort to verify that builds are stable.
- Install Go
- Set your
$GOPATH
environment to wherever you want, for example~/Development/gocode
go get -u -t github.com/couchbase/sync_gateway/...
Now you have the code and all dependencies in your $GOPATH
Using your favorite editor, open the main.go
file in $GOPATH/src/github.com/couchbase/sync_gateway
and the code in the sub-packages in $GOPATH/src/github.com/couchbase/sync_gateway/base
, etc..
After you've changed the code, run your newly added unit tests:
$ cd $GOPATH/src/github.com/couchbase/sync_gateway
$ go test -v -run YourShinyNewUnitTest
As long as you are adding code and unit tests, repeat this step. Once you're ready to submit a PR, move on.
note: lazy developers can skip the rest of this document and submit a PR based on their changes so far, and depend on the CI system to catch any regressions they've introduced when it runs the full test suite
Create a new directory that is outside of your $GOPATH
, for example ~/Development/sync_gateway
Follow these README instructions
You will need to manually sync your changes from your default system $GOPATH
to your $GOPATH
under your ~/Development/sync_gateway
If you updated or added any dependencies, you'll need to:
- Add/update dependencies in your current
$GOPATH
- Update the
manifest/default.xml
file to reflect your changes
$ cd $GOPATH/src/github.com/couchbase/sync_gateway
$ go test ./...
There shouldn't be any test failures at this point
At this point, you can commit to the git repository under ~/Development/sync_gateway
and push to a branch or a personal fork and issue a PR against it.
Instructions for testing that this change didn't break anything by running with the manifest from this PR:
- Follow README instructions for doing a repo based build
pushd godeps/src/github.com/couchbase/sync_gateway/
git checkout -t remotes/couchbase/feature/YOUR_FEATURE_BRANCH
-
cp manifest/default.xml ~/Development/sync_gateway/.repo/manifest.xml
(may need to change path based on where you did repo init) git checkout master
popd
repo sync
-
GOPATH=
pwd/godeps go test github.com/couchbase/sync_gateway/...