|
| 1 | +# Contribution |
| 2 | +Any kind of contribution is encouraged, e.g., bug report, question answer, and submit pull-request. |
| 3 | + |
| 4 | +Before taking actions, we highly recommend reading the [docs](../README.md). |
| 5 | + |
| 6 | + |
| 7 | +## Bug and Questions |
| 8 | + |
| 9 | +We now have two channels for bug and questions: |
| 10 | + |
| 11 | +* [Jira](https://jira.hyperledger.org/projects/CE/issues): report bug issues, create to-do tasks. |
| 12 | +* [Slack](https://hyperledgerproject.slack.com/archives/cello): technical discussions and questions. |
| 13 | + |
| 14 | +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. |
| 15 | + |
| 16 | +## Code Commit |
| 17 | + |
| 18 | +*Before committing code, please go to [Jira](https://jira.hyperledger.org/secure/RapidBoard.jspa?rapidView=85) to check existing tasks.* |
| 19 | + |
| 20 | +The project employs [Gerrit](https://gerrit.hyperledger.org) as the code commit/review system. |
| 21 | + |
| 22 | +* 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. |
| 23 | + |
| 24 | +```sh |
| 25 | +$ git clone ssh://LFID@gerrit.hyperledger.org:29418/cello && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg cello/.git/hooks/ |
| 26 | +``` |
| 27 | + |
| 28 | +(Optionally) Config your git name and email if not setup previously. |
| 29 | + |
| 30 | +```sh |
| 31 | +$ git config user.name "your name" |
| 32 | +$ git config user.email "your email" |
| 33 | +``` |
| 34 | + |
| 35 | +(Optionally) Setup git-review by inputting your LFID. Notice this is only necessary once. |
| 36 | +```sh |
| 37 | +$ git review -s |
| 38 | +``` |
| 39 | + |
| 40 | +* Create a descriptively-named branch off of your cloned repository |
| 41 | + |
| 42 | +```sh |
| 43 | +$ cd cello |
| 44 | +$ git checkout -b issue-NNNN |
| 45 | +``` |
| 46 | + |
| 47 | +* 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. |
| 48 | + |
| 49 | +```sh |
| 50 | +$ make check |
| 51 | + ... |
| 52 | + py27: commands succeeded |
| 53 | + py30: commands succeeded |
| 54 | + py35: commands succeeded |
| 55 | + flake8: commands succeeded |
| 56 | + congratulations :) |
| 57 | + |
| 58 | +$ git commit -s -a |
| 59 | +``` |
| 60 | + |
| 61 | +Example commit msg may look like: |
| 62 | + |
| 63 | +```sh |
| 64 | +A short description of your change with no period at the end |
| 65 | + |
| 66 | +You can add more details here in several paragraphs, but please keep each line |
| 67 | +width less than 80 characters. A bug fix should include the issue number. |
| 68 | + |
| 69 | +Fix Issue #7050. |
| 70 | + |
| 71 | +Change-Id: IF7b6ac513b2eca5f2bab9728ebd8b7e504d3cebe1 |
| 72 | +Signed-off-by: Your Name <committer@email.address> |
| 73 | +``` |
| 74 | + |
| 75 | +* Submit your commit using `git review`. |
| 76 | + |
| 77 | +```sh |
| 78 | +$ git review |
| 79 | +``` |
| 80 | + |
| 81 | +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. |
| 82 | + |
| 83 | +* 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 commit comments