Contributor Process
EdgeX Foundry source code is hosted at the https://github.com/edgexfoundry organization. We will use the edgex-go repository as an example here.
Pull Requests should have an issue associated with them that describes the change. If an issue has not yet been created, go to https://github.com/edgexfoundry/edgex-go/issues/new to create one.
If you've not already made a personal fork, go to https://github.com/edgexfoundry/edgex-go and fork the repository to your personal GitHub account. Once the fork is complete, clone your fork of the project into your local workspace. Once you've created a fork of a repository, it can be reused for subsequent PRs.
You will need to set up remotes like so:
git remote add upstream git@github.com:edgexfoundry/edgex-go.git git remote -v origin git@github.com:JPWKU/edgex-go.git (fetch) origin git@github.com:JPWKU/edgex-go.git (push) upstream git@github.com:edgexfoundry/edgex-go.git (fetch) upstream git@github.com:edgexfoundry/edgex-go.git (push)
The `origin` remote points to the fork and the `upstream` remote points to edgexfoundry/edgex-go. By default, the origin remote is set to the fork when you clone.
You will also need to set your git user and git email:
git config user.name "YOUR NAME" git config user.email "YOUR@EMAIL.COM"
You are now ready to create a local feature/bug branch to work on; at this point you want to make sure of the branch you are on. If you wish to submit your PR to master you will need to create a feature branch from master.
git checkout master git checkout -b feature_branch
At this point you are on `feature_branch` and can work. It is desirable for you to PR this work as soon as possible, even before it is complete. This gives visibility to it in addition to running tests. Once you make some changes, simply commit those changes and push the branch up to your origin remote.
It is important to note here that all commits are required to have a DCO signoff to be accepted. Once you have set up the necessary keys for signoff, simply add the `–signoff` flag to your git commit. See https://developercertificate.org/ for the attestation you are making by singing off.
git add <changed files> git commit --signoff -m 'Commit Message' git push origin feature_branch
Rebase against upstream early and often!
Others will likely be contributing as well in the same area that you are. It will prevent many issues if you rebase early and often against the upstream target branch (master in this example) like so:
git fetch --all && git rebase upstream/master
Once you have pushed feature_branch up to the origin remote navigate to https://github.com/edgexfoundry/edgex-go and create a PR. You will need to select across forks; select your fork and feature_branch and create the PR. At this tiime a series of CI jobs will start in Jenkins:
All of these checks will need to pass before the PR can be merged. You can navigate to the specific Jenkins job by clicking on `Details` to the right. The verify jobs run unit test and do a code build, as well as build docs. There is also the aforementioned DCO check that is required.