Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

Latest commit

 

History

History
139 lines (101 loc) · 4.68 KB

CONTRIBUTING.md

File metadata and controls

139 lines (101 loc) · 4.68 KB

Contributing

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.

Cloning the Repository

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/

Creating a Code Change and Committing It

After changing to the fabric-sdk-rest directory, switch to the dev branch and issue a git pull:

git checkout dev
git pull

This 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-docs

Make 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-docs

Your 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.

Pushing Commits

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/dev

or 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.com

If this has worked, you'll see a message from Gerrit like

remote: New Changes:
remote:   https://gerrit.hyperledger.org/r/12345 improve-contributor-docs

You'll be notified by email (to the email address on the commit) once a code review has occurred.

Legal Stuff

Note: All contributions to this project must follow the Hyperledger Fabric legal requirements

More Information

For more general information, including what makes a good change request, see the Hyperledger Fabric contributors guide.


Creative
Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.