Skip to content
randomskk edited this page Sep 12, 2010 · 2 revisions

So you're all ready to write some new code for habitat? Great!

First Steps

First, check the feature you want to write is a story on the tracker: http://www.pivotaltracker.com/projects/112268 (If you don't have member access to the tracker, just ask and an account can be set up).

If the feature isn't already a story, add a new one. Just press 'a' or click Add Story, give it a brief description, assign points (usually one or two depending on how awesome your feature is!) and then Start it.

Meanwhile, since we're following nvie's gitflow model (here), you now create a new branch from develop in your local git repository:

    $ git checkout develop
    $ git checkout -b my-new-feature
    Switched to a new branch 'my-new-feature'
    $ git status
    # On branch my-new-feature
    nothing to commit (working directory clean)

Code away!

Write your code! The model to follow here is:

1: Tests!

Writing tests first is a Good Thing. We're using nose for python and jasmine for javascript. You can check out existing code to get an idea, but essentially tests go in the tests/ subdirectory from wherever your code is, in files named test_whatever.py/js and contain functions like test_can_perform_magic().

2: Code!

Next, write code that makes the tests pass. Be sure to run the tests often with $ nosetests!

3: Commit!

This part's easy. $ git add files-that-changed.py; git commit -m "++magic".

Closing Up

So your new code is written, it passes your tests (of course), and it's ready to go?

  1. Close the story on Pivotal
  2. Open a pull request from me/my-new-feature to ukhas/develop
  3. Deliver the story on Pivotal
  4. Wait for someone to pull it into ukhas! Be prepared for discussion and updates on the pull request.