Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
  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:

    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

    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.

    You may also want to git fetch origin and run git rebase -i --exec "make lint test" origin/master to make sure you're submitting your changes on top of the newest version of our code
  7. Next, push to your fork:

    git push -u <yourfork> update-readme
    Review our commit message guidelines and amend your commit message(s) as necessary.
  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.