Development

OVX is developed as an open source project under the Apache 2 license. We make heavy use of the Git source version control system.

Once you have read this page have a look at our guidelines and checkout our tools.

1. Git – Preamble

The first step is to ensure your git configuration is complete.

git config --global user.name "firstname lastname"
git config --global user.email "email@domain.com"

This will help when submitting code to OVX with Gerrit.

2. Developing OpenVirteX

OVX follows a relatively simple developement process. Minor and Major revisions of OVX are kept in the following branches:

  • X.Y-MAINT – this is the current maintenance branch, i.e., bugs for this revision can be found here.
  • X.Y+1-DEV – this is the current development branch, i.e., the latest and greatest unstable code can be found here.

You have a couple of options when contributing to OVX.

2.1. Using Gerrit Code Review (Recommended)

Setting up Gerrit is a slightly more involved process but it will allow you to track comments and reviews on your code much more efficiently. If you have any questions, feel free to post on the mailing list.

  1. If you plan to submit code, please sign our contributor license.
  2. Head over to Gerrit.
  3. Sign on with your GitHub user and authorize the application.
  4. Click on the drop down by your user name and select “Settings”.
  5. Click on “Watched Projects” and click “Browse”.
  6. Filter and select “OpenVirteX”.
  7. Select the notifications you want to receive.
  8. Upload your SSH public key. Look here if you don’t know what this means.
  9. git clone ssh://<username>@review.gerrithub.io:29418/OPENNETWORKINGLAB/OpenVirteX
  10. Setup git-review following these steps.
  11. Submit your patch to the appropriate branch as explained above.

2.2. Using GitHub Pull Requests

This process is simpler but we will convert your pull request into a Gerrit review, so you will not be able to see the comments we make unless you join Gerrit.

  1. If you plan to submit code, please sign our contributor license.
  2. Fork our repository.
  3. Submit a pull request as is usually done in GitHub.

3. Gerrit

If you intend to do any serious development on OVX, you should use our Gerrit code review system. Here are the basic steps you should follow to submit code to OVX. Having said that you should really read the Gerrit documentation as well.

  1. Find an issue on JIRA, it will be labeled OVX-xxx
  2. Switch to the current DEV (new features) or MAINT (bugfix) branch: git checkout <branchname>
  3. Create branch: git checkout -b OVX-xxx
  4. Write some really cool code.
  5. Commit your changes and be sure to write a meaningful commit message: git commit -a
  6. Update the current developement branch you branched off (see below)
  7. Rebase your branch (see below)
  8. Submit your code: git review

Keeping your DEV/MAINT up to date:

git checkout <branchname>
git pull origin <branchname>

This should always result in a fast forward of your branch. If it did not and you have a merge conflict, it’s probably because you committed code to the DEV/MAINT branch directly which is not a good thing.

Keeping your development/feature branch up to date is done by using git rebase. In a nutshell,

git checkout OVX-xxx
git rebase -i <branchname>

This will probably result in one or more merge conflicts, unless you are working on a piece of the code no one has touched. Simply, resolve the conflicts and run git rebase --continue until there are no more conflicts to resolve.

4. Updating a Change

If the code review process suggests additional changes, make and amend the changes to the the existing commit. Leave the existing Change-Id: footer in the commit message as-is. Gerrit knows that this is an updated patch for an existing change:

git commit -a --amend
git review

5. Add dependency / Amending a change

When you want to start new work that is based on the commit under the review, you can add the commit as a dependency.

# Fetch change under review and check out branch based on that change
git review -d $PARENT_CHANGE_NUMBER
git checkout -b $DEV_TOPIC_BRANCH
# Edit files, add any new files to git
git commit -a
git review