Submitting your contribution

 

  1. All contributors need to sign the Contributor License Agreement.

  2. (Re-)Familiarize yourself with What is a Good CockroachDB PR.

  3. Create a local feature branch to do work on, ideally on one thing at a time. If you are working on your own fork, see this tip on forking in Go, which ensures that Go import paths will be correct.

    git checkout -b update-readme
  4. Hack away and commit your changes locally using git add and git commit.
    Remember to write tests! The following are helpful for running specific subsets of tests:

    # using bazel (see ./dev test -h) # Run all tests ./dev test # Run all tests in ./pkg/storage ./dev test ./pkg/storage # Run all kv tests matching '^TestFoo' with a timeout of 10s ./dev test ./pkg/kv --filter='^TestFoo' --timeout=10s # Run the sql logic tests (see ./dev testlogic -h) ./dev testlogic # Run a specific sql logic subtest ./dev testlogic --subtests='select$$' # Logs are disabled during tests by default. To enable them, include --show-logs as an argument the test command: ./dev test --show-logs # using make # Run all tests make test # Run all tests in ./pkg/storage make test PKG=./pkg/storage # Run all kv tests matching '^TestFoo' with a timeout of 10s make test PKG=./pkg/kv TESTS='^TestFoo' TESTTIMEOUT=10s # Run the sql logic tests make test PKG=./pkg/sql TESTS='TestLogic$$' # or, using a shortcut, make testlogic # Run a specific sql logic subtest make test PKG=./pkg/sql TESTS='TestLogic$$/select$$' # or, using a shortcut, make testlogic FILES=select # Logs are disabled during tests by default. To enable them, include TESTFLAGS="-v -show-logs" as an argument the test command:
    make test ... TESTFLAGS="-v -show-logs"
  5. Run the linters, code generators, and unit test suites locally:
    make pre-push

    or

    this will take several minutes.

  6. When you’re ready for review, groom your work:

    • each commit should pass tests and contain a substantial (but not overwhelming) unit of work.

    • review our commit message guidelines and amend your commit message(s) as necessary.

  7. Next, push to your fork:

  8. Then create a pull request using GitHub’s UI. If you know of another GitHub user particularly suited to reviewing your pull request, be sure to mention them in the pull request body. If you possess the necessary GitHub privileges, please also assign them to the pull request using GitHub's UI. This will help focus and expedite the code review process.

  9. Address test failures and feedback by amending your commits. If your change contains multiple commits, address each piece of feedback by amending that commit to which the particular feedback is aimed. Wait (or ask) for new feedback on those commits if they are not straightforward. An LGTM ("looks good to me") by someone qualified is usually posted when you're free to go ahead and merge. Most new contributors aren't allowed to merge themselves; in that case, we'll do it for you.

  10. Direct merges using GitHub's "big green button" are avoided. Instead, we use bors-ng to manage our merges to prevent "merge skew". When you're ready to merge, add a comment to your PR like this:
        bors r+
    Craig (our Bors bot) will run CI on your changes, and if it passes, merge them. 

Copyright (C) Cockroach Labs.
Attention: This documentation is provided on an "as is" basis, without warranties or conditions of any kind, either express or implied, including, without limitation, any warranties or conditions of title, non-infringement, merchantability, or fitness for a particular purpose.