Wednesday 21 March 2012

New Gerrit and Jenkins styles are live

After a bit of tweaking and improvements following feedback from various people the new changes to Jenkins and Gerrit are now live. The changes will also be rolled out onto Stackforge in the next 24 hours.

I've had a lot of great feedback in the few hours the changes have been live, many love it and some have suggestions for improvements. This is great, we know the look could use a bit of refining here and there. What makes this truly awesome is that the styles are kept in an OpenStack project with which anyone can file bugs or send patches up to Gerrit.

To modify the styles simply grab the openstack-ci-puppet repo and look in the Gerrit and Jenkins modules for the files. If you wish to file a bug, please do so in the OpenStack CI bugs page.

Thanks again for the great feedback so far. Hopefully this has made the lives of many of you that little bit easier (or at least stop your eyes bleeding).

Thursday 15 March 2012

The real way to start hacking on OpenStack

I've seen recent attempts at blog posts to show how to get started at hacking on an OpenStack project.  Unfortunately they seem to have over-complicated the issue for new users.  As part of the Core Infrastructure team it is my job to make submitting, reviewing and merging code easier for developers.  This includes documenting that process, so here goes :)

  1. You need a Launchpad account and need to be joined to the Openstack team.  You can also join the team of one of the many subprojects if you want to.  Make sure Launchpad has your SSH key, Gerrit (the code review system) uses this.
  2. Sign the CLA as outlined in section 3 of the How To Contribute wiki page
  3. Tell git your details:
    git config --global user.name "Firstname Lastname"
    git config --global user.email "your_email@youremail.com" 
  4. Install git-review. This tool takes a lot of the pain out of remembering commands to push code up to Gerrit for review and to pull it back down to edit it. It is installed using:
    pip install git-review
    Several Linux distributions (notably Fedora 16 and Ubuntu 12.04) are also starting to include git-review in their repositories so it can also be installed using the standard package manager.
  5. Grab a tree to hack on, for example for Nova you would do:
    git clone git://github.com/openstack/nova.git
  6. Checkout a new branch to hack on:
    git checkout -b TOPIC-BRANCH
  7. Start hacking
  8. Run the test suite locally to make sure nothing broke
  9. Commit your work using:
    git commit -a
    or you can use the following to edit a previous commit:
    git commit -a --amend
  10. Push the commit up for code review using:
    git review
    That is the awesome tool we installed earlier that does a lot of hard work for you
  11. Watch your email or review site, it will automatically send your code for a battery of tests on our Jenkins setup and the core team for the project will review your code. If there is any changes that should be made they will let you know.
  12. When all is good the review site will automatically merge your code
Obviously nearly half of that list are tasks you will only need to perform once. So as you can see it is pretty darn simple to get started. If anyone gets stuck they are welcome to shout out in the #openstack-dev IRC channel or the OpenStack mailing list. For more information on developer work flow please see the Gerrit Workflow page, I'm not ashamed to say I still have it as a pinned tab :)

Tuesday 13 March 2012

Changes coming to Gerrit's style

Gerrit is a fantastic tool for performing code reviews and automating many of the tasks which can become quite complex. Unfortunately its default style is not the most attractive thing to look at all day. Yesterday I was tasked with skinning Gerrit to make it more in-line with Openstack. This was not as easy a task as I first anticipated, mostly down to not having the ability to edit the HTML layout very much without editing Gerrit's source.

The result isn't perfect but hopefully a notable improvement which will be coming to an Openstack review site near you soon.  Here is the before and after shots: