Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a contribution guide #1379

Merged
merged 4 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Contribution Guide

* [Before you get started](#before-you-get-started)
* [Sign the CLA](#sign-the-cla)
* [Code of Conduct](#code-of-conduct)
* [Your First Contribution](#your-first-contribution)
* [Find a good first topic](#find-a-good-first-topic)
* [Setting up your development environment](#setting-up-your-development-environment)
* [Fork the project](#fork-the-project)
* [Clone the project](#clone-the-project)
* [New branch for a new code](#new-branch-for-a-new-code)
* [Test](#test)
* [Commit and push](#commit-and-push)
* [Create a Pull Request](#create-a-pull-request)
* [Get a code review](#get-a-code-review)

## Before you get started

### Sign the CLA

Click the **Sign in with Github to agree** button to sign the CLA. [An example](https://cla-assistant.io/dgraph-io/badger?pullRequest=1377).

### Code of Conduct

Please make sure to read and observe our [Code of Conduct](./CODE_OF_CONDUCT.md).

## Your First Contribution

### Find a good first topic

You can start by finding an existing issue with the
[good first issue](https://github.com/dgraph-io/badger/labels/good%20first%20issue)
label. These issues are well suited for new contributors.


## Setting up your development environment

Badger uses [`Go Modules`](https://github.com/golang/go/wiki/Modules)
to manage dependencies. The version of Go should be **1.12** or above.

### Fork the project

- Visit https://github.com/dgraph-io/badger
- Click the `Fork` button (top right) to create a fork of the repository

### Clone the project

```sh
$ git clone https://github.com/$GITHUB_USER/badger
$ cd badger
$ git remote add upstream git@github.com:dgraph-io/badger.git

# Never push to the upstream master
git remote set-url --push upstream no_push
```

### New branch for a new code

Get your local master up to date:

```sh
$ git fetch upstream
$ git checkout master
$ git rebase upstream/master
```

Create a new branch from the master:

```sh
$ git checkout -b my_new_feature
```

And now you can finally add your changes to project.

### Test

Build and run all tests:

```sh
$ ./test.sh
```

### Commit and push

Commit your changes:

```sh
$ git commit
```

When the changes are ready to review:

```sh
$ git push master my_new_feature
```

### Create a Pull Request

Just open `https://github.com/$GITHUB_USER/badger/pull/new/my_new_feature` and
fill the form.

### Get a code review

If your pull request (PR) is opened, it will be assigned to one or more
reviewers. Those reviewers will do a code review.

To address review comments, you should commit the changes to the same branch of
the PR on your fork.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ For more details on our version naming schema please read [Choosing a version](#
+ [Comparisons](#comparisons)
+ [Benchmarks](#benchmarks)
* [Projects Using Badger](#projects-using-badger)
* [Contributing](#contributing)
* [Frequently Asked Questions](#frequently-asked-questions)

## Getting Started
Expand Down Expand Up @@ -787,6 +788,10 @@ Below is a list of known projects that use Badger:

If you are using Badger in a project please send a pull request to add it to the list.

## Contributing

If you're interested in contributing to Badger see [CONTRIBUTING.md](./CONTRIBUTING.md).

## Frequently Asked Questions
### My writes are getting stuck. Why?

Expand Down