We welcome contributions to the Hyperledger Fabric SDK Rest Project in many forms, and there's always plenty to do! This document describes the basic golden path to contributing to the project. We assume that you have a working knowledge of SSH keys, and general git workflows. If you need help, you can ask on RocketChat.
We use Gerrit for code review; this is mirrored to GitHub as a
read-only project. The project has two git branches: master,
and dev. Development work should be done against dev. Occasionally
master will merge the changes in dev, to keep it stable. A CI
server runs jobs to test the server against all dev branch commits.
You'll need a Linux Foundation ID (LFID) to contribute to the project.
Replace [LFID] with your own Linux Foundation ID, and run the
following commands to clone the repository and pull the git commit
message hook:
git clone ssh://[LFID]@gerrit.hyperledger.org:29418/fabric-sdk-rest && scp -p -P 29418 [LFID]@gerrit.hyperledger.org:hooks/commit-msg fabric-sdk-rest/.git/hooks/After changing to the fabric-sdk-rest directory, switch to the dev
branch and issue a git pull:
git checkout dev
git pullThis should have git track your local dev branch against
origin/dev on the (Gerrit) remote. While you can develop against
your local dev branch directly, we'd recommend that you create a
feature development branch from the latest dev commit, for the
feature or enhancement you're providing, with a useful (to you) name:
git checkout -b improve-contributor-docsMake your changes, and when you're ready, commit them. Note that you
need to sign off on your commits for this project, with the -s flag:
git commit -s -m 'Improved the wording of the documentation'If you run git log, you'll see that your last commit has Change-Id
and Signed-off-by fields, e.g.,
Change-Id: I8dd1bfdeafa57f1111ab481864bdc87939713ac8
Signed-off-by: Chris Poole <chrispoole@uk.ibm.com>After one or more commits, you can merge them (which should be a
simple fast-forward) with your local dev branch. For example:
git checkout dev
git merge improve-contributor-docsYour local dev branch now has your changes in them, and you can push
them to Gerrit for code review.
Before you do so though, please test your changes (as described in the readme document) to ensure that nothing has broken. If you've introduced changes not covered by an existing test, please also develop a new test, and commit that too.
Gerrit has a system where each git branch has a for branch
associated with it. You push commits to the for branch, which sends
them for code review. Once one or more project maintainers have agreed
to the code changes, a maintainer can submit the commits. This merges
them into the actual dev branch for anyone to pull. Occasionally,
a maintainer will merge master with dev to pull in the latest
development work, but all changes should be made against dev, and
pushed to for/dev.
To push your commits to Gerrit for review, issue:
git push origin HEAD:refs/for/devor to push the commits and automatically notify one or more of the project maintainers of the code review,
git push origin HEAD:refs/for/dev%r=chrispoole@uk.ibm.com,r=cocksmar@uk.ibm.comIf this has worked, you'll see a message from Gerrit like
remote: New Changes:
remote: https://gerrit.hyperledger.org/r/12345 improve-contributor-docsYou'll be notified by email (to the email address on the commit) once a code review has occurred.
For more general information, including what makes a good change request, see the Hyperledger Fabric contributors guide.
This work is licensed under a Creative Commons
Attribution 4.0 International License.
