Development

From wiki.openchemistry.org
Revision as of 21:56, 31 December 2011 by Marcus.hanwell (talk | contribs) (Initial version of the open chemistry development instructions page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The Open Chemistry projects use git for version control, and Gerrit for code review. The source code is mirrored on our infrastructure, Github and Gitorious. These are read only mirrors, only the Gerrit hosted copy of the repository can be edited. Once topic braches are merged in using the Gerrit interface they are automatically replicated to these three locations.

Getting Started

First you should go to http://review.source.kitware.com/ and log in using a valid OpenID.

  • Go to Settings and configure your username (under profile)
  • Upload your public SSH key (under SSH public keys)
  • Ensure your name and email address are correct (under contact information)

These details will be used later.

Cloning Repositories

You should clone the repositories from our source code hosting infrastructure, or the Github/Gitorious mirror. You should also track changes from here as the cloning/update process will be faster, and is always in sync with Gerrit. To clone OpenQube for example,

 git clone git://source.openchemistry.org/openqube.git

Setting up for Development

Now you have successfully cloned the source code there is a little set up required. We have prepared a shell script which takes care of most of these details for you, which can be run interactively (or inspected and copy/pasted as required). In order to set up your new clone, change in to the directory and run the set up script.

 ./scripts/setup-for-development.sh

You will be prompted for details as required, defaults are shown in brackets. Pay close attention to the Gerrit username and authentication test if online (to verify SSH authentication works as expected). This will set up a gerrit remote, local git hooks (including one to automatically generate Change-Id lines) and ensure your name/email address is correct. It will also add a new git alias to push changes to Gerrit for review.

Uploading Proposed Changes

You should develop all code on topic branches, branched from master.

 git checkout -b topic-name

Once you are ready to commit, use the commit command as normal. When you would like to have your proposed changes reviewed use the git alias to push the changes.

 git gerrit-push

The changes will appear on Gerrit, appropriate reviewers should be added. Once the topic is ready it will be merged using Gerrit, and replicated automatically.