Skip to content

Commit

Permalink
Add contribution doc.
Browse files Browse the repository at this point in the history
Fix #CE-3.

Change-Id: I9cf8626fac196c6f21beba792bc441bb454d926a
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Jan 13, 2017
1 parent becd4ad commit 0cd481e
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ You can also find more [scenarios](docs/scenario.md).
* [Architecture Design](docs/arch.md)
* [Database Model](docs/db.md)
* [API](api/restserver_v2.md)
* [How to contribute](docs/CONTRIBUTING.md)

## TODO
* restserver: update api definitions yml files.
Expand Down
83 changes: 83 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contribution
Any kind of contribution is encouraged, e.g., bug report, question answer, and submit pull-request.

Before taking actions, we highly recommend reading the [docs](../README.md).


## Bug and Questions

We now have two channels for bug and questions:

* [Jira](https://jira.hyperledger.org/projects/CE/issues): report bug issues, create to-do tasks.
* [Slack](https://hyperledgerproject.slack.com/archives/cello): technical discussions and questions.

Jira tasks with `To Do` status are available for picking. If you want to handle one, assign it to yourself, and update the status to `In Progress`. Remember to mark it to `Done` when the patch is merged.

## Code Commit

*Before committing code, please go to [Jira](https://jira.hyperledger.org/secure/RapidBoard.jspa?rapidView=85) to check existing tasks.*

The project employs [Gerrit](https://gerrit.hyperledger.org) as the code commit/review system.

* Clone the project with your Linux Foundation ID (`LFID`), we suggest clone it into the `$GOPATH/src/github.com/hyperledger` directory so that it will build.

```sh
$ git clone ssh://LFID@gerrit.hyperledger.org:29418/cello && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg cello/.git/hooks/
```

(Optionally) Config your git name and email if not setup previously.

```sh
$ git config user.name "your name"
$ git config user.email "your email"
```

(Optionally) Setup git-review by inputting your LFID. Notice this is only necessary once.
```sh
$ git review -s
```

* Create a descriptively-named branch off of your cloned repository

```sh
$ cd cello
$ git checkout -b issue-NNNN
```

* After change, run `make check` to make sure the checking is passed. Then Commit your code with `-s` to sign-off, and `-a` to automatically add changes.

```sh
$ make check
...
py27: commands succeeded
py30: commands succeeded
py35: commands succeeded
flake8: commands succeeded
congratulations :)

$ git commit -s -a
```

Example commit msg may look like:

```sh
A short description of your change with no period at the end

You can add more details here in several paragraphs, but please keep each line
width less than 80 characters. A bug fix should include the issue number.

Fix Issue #7050.

Change-Id: IF7b6ac513b2eca5f2bab9728ebd8b7e504d3cebe1
Signed-off-by: Your Name <committer@email.address>
```

* Submit your commit using `git review`.

```sh
$ git review
```

After the review is uploaded successfully, you can open [Gerrit Dashboard](https://gerrit.hyperledger.org/r/#/dashboard/self) to invite reviewers for checking. The patch will be merged into the `master` branch if passing the reviewer checking.

* If you need to refine the patch further, you can commit the new code with `git commit -a --amend`, and then repeat the `git review` command.

0 comments on commit 0cd481e

Please sign in to comment.