Becoming a CKAN Developer

From CKAN

Jump to: navigation, search

All CKAN code is managed in Git repositories in the OKFN Github.

In order to contribute code changes to CKAN you need to understand how we structure our code, the policies and conventions we use when developing and the core git commands we use. These are all covered in here.

Contents

Check-In Policy

CKAN is open source and contributions are welcome. However, we have some guidelines for check-ins to ensure that all developers can work well together.

Check-ins

  1. Work on the right branch - see Commit Policy below.
  2. Write tests for all changes. Unit tests go into ckan/tests/{area}/ and functional tests go into ckan/tests/functional/ . Tests describe intent and stop the code regressing in the future.
  3. Run all the tests before you commit your code. It only takes 5 minutes!
 nosetests --ckan ckan/tests

Starting out

Workflow

Big or Medium changes:

Exceptions:

Don't break the build

Commit Policy

CKAN is stored in Github repos. This policy covers development and branching policy for these repos.

In general: One Branch per Feature and Defect

Not only is it good practice to separate different features in the repo, but we are very keen to not have half-completed big features in the master branch.

We will be following the process described in (1) but applied to Github. Key aspects:

  1. A (named) branch will be created for each feature or defect (bug), unless it is almost certain that the ticket only requires one changeset. Branch naming convention:
    • defect-{ticket-number}[-optional-name] e.g. defect-902-my-bad-bug
    • feature-{ticket-number}[-optional-name] e.g. feature-903-my-amazing-feature
  2. A (named) branch will be created for each release: release-v{release-number} e.g. release-v1.3

Workflow is described in the section above.

Merging Branches back in

Please use --no-ff (no fast forward), otherwise it may automatically collapse a branch if it can, and you lose the record of intention to do a feature separately to the master.

 git checkout master
 git pull
 git merge --no-ff {branch-name}
 git push

Further references

  1. http://nvie.com/posts/a-successful-git-branching-model/
  2. http://www.rabbitmq.com/mercurial.html#branchperbug
  3. http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
  4. Original thread http://lists.okfn.org/pipermail/ckan-dev/2010-November/000034.html
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox