Skip to content

Commit bebbfa2

Browse files
ekalininIbrahim Jarif
authored andcommitted
Add a contribution guide (#1379)
Add contribution.md file with some details.
1 parent e9e8f23 commit bebbfa2

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Contribution Guide
2+
3+
* [Before you get started](#before-you-get-started)
4+
* [Code of Conduct](#code-of-conduct)
5+
* [Your First Contribution](#your-first-contribution)
6+
* [Find a good first topic](#find-a-good-first-topic)
7+
* [Setting up your development environment](#setting-up-your-development-environment)
8+
* [Fork the project](#fork-the-project)
9+
* [Clone the project](#clone-the-project)
10+
* [New branch for a new code](#new-branch-for-a-new-code)
11+
* [Test](#test)
12+
* [Commit and push](#commit-and-push)
13+
* [Create a Pull Request](#create-a-pull-request)
14+
* [Sign the CLA](#sign-the-cla)
15+
* [Get a code review](#get-a-code-review)
16+
17+
## Before you get started
18+
19+
### Code of Conduct
20+
21+
Please make sure to read and observe our [Code of Conduct](./CODE_OF_CONDUCT.md).
22+
23+
## Your First Contribution
24+
25+
### Find a good first topic
26+
27+
You can start by finding an existing issue with the
28+
[good first issue](https://github.com/dgraph-io/badger/labels/good%20first%20issue) or [help wanted](https://github.com/dgraph-io/badger/labels/help%20wanted) labels. These issues are well suited for new contributors.
29+
30+
31+
## Setting up your development environment
32+
33+
Badger uses [`Go Modules`](https://github.com/golang/go/wiki/Modules)
34+
to manage dependencies. The version of Go should be **1.12** or above.
35+
36+
### Fork the project
37+
38+
- Visit https://github.com/dgraph-io/badger
39+
- Click the `Fork` button (top right) to create a fork of the repository
40+
41+
### Clone the project
42+
43+
```sh
44+
$ git clone https://github.com/$GITHUB_USER/badger
45+
$ cd badger
46+
$ git remote add upstream git@github.com:dgraph-io/badger.git
47+
48+
# Never push to the upstream master
49+
git remote set-url --push upstream no_push
50+
```
51+
52+
### New branch for a new code
53+
54+
Get your local master up to date:
55+
56+
```sh
57+
$ git fetch upstream
58+
$ git checkout master
59+
$ git rebase upstream/master
60+
```
61+
62+
Create a new branch from the master:
63+
64+
```sh
65+
$ git checkout -b my_new_feature
66+
```
67+
68+
And now you can finally add your changes to project.
69+
70+
### Test
71+
72+
Build and run all tests:
73+
74+
```sh
75+
$ ./test.sh
76+
```
77+
78+
### Commit and push
79+
80+
Commit your changes:
81+
82+
```sh
83+
$ git commit
84+
```
85+
86+
When the changes are ready to review:
87+
88+
```sh
89+
$ git push origin my_new_feature
90+
```
91+
92+
### Create a Pull Request
93+
94+
Just open `https://github.com/$GITHUB_USER/badger/pull/new/my_new_feature` and
95+
fill the PR description.
96+
97+
### Sign the CLA
98+
99+
Click the **Sign in with Github to agree** button to sign the CLA. [An example](https://cla-assistant.io/dgraph-io/badger?pullRequest=1377).
100+
101+
### Get a code review
102+
103+
If your pull request (PR) is opened, it will be assigned to one or more
104+
reviewers. Those reviewers will do a code review.
105+
106+
To address review comments, you should commit the changes to the same branch of
107+
the PR on your fork.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ For more details on our version naming schema please read [Choosing a version](#
5959
+ [Comparisons](#comparisons)
6060
+ [Benchmarks](#benchmarks)
6161
* [Projects Using Badger](#projects-using-badger)
62+
* [Contributing](#contributing)
6263
* [Frequently Asked Questions](#frequently-asked-questions)
6364

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

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

791+
## Contributing
792+
793+
If you're interested in contributing to Badger see [CONTRIBUTING.md](./CONTRIBUTING.md).
794+
790795
## Frequently Asked Questions
791796
### My writes are getting stuck. Why?
792797

0 commit comments

Comments
 (0)