Skip to content

Development workflow

Traun Leyden edited this page Feb 13, 2016 · 4 revisions

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 and setup $GOPATH

  • Install Go
  • Set your $GOPATH environment to wherever you want, for example ~/Development/gocode

Get the code via go get

go get -u -t github.com/couchbase/sync_gateway/...

Now you have the code and all dependencies in your $GOPATH

Open the code in your editor

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..

Add/update code and run newly added unit tests

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.

Get the code via repo and modify $GOPATH

Create a new directory that is outside of your $GOPATH, for example ~/Development/sync_gateway

Follow these README instructions

Copy your changes from your default system $GOPATH

You will need to manually sync your changes from your default system $GOPATH to your $GOPATH under your ~/Development/sync_gateway

Update the manifest/default.xml (optional)

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

Run full unit test suite

$ cd $GOPATH/src/github.com/couchbase/sync_gateway
$ go test ./... 

There shouldn't be any test failures at this point

Issue a Pull Request

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.

Clone this wiki locally