Skip to content

Modware Loader Development

Siddhartha Basu edited this page Mar 7, 2014 · 13 revisions

Before you start

Please inform author about your intent of development. Either email directly or preferably use the github issue tracker. If its tied to any existing issue, please make sure to refer it.

Requirements

A working knowledge with the following softwares are vitally important.

  • git: A basic understanding of branch, merge, pull, push and remote are necessary.
  • Modern Perl based development: This refers to the principles and modules described in the modern perl book. Please try to understand the concept before proceeding any further.
  • Unit testing: Writing unit tests with perl module, particularly Test::More. This is a simple tutorial to get started.
  • Interacting with SQL database from Perl: Knowledge of perl DBI module. Read the 18 part DBI article here.

Development model

Modware-Loader development uses git for source code management. It roughly follows this git branching model. Even for core developers and maintainers we use github pull request for code contribution and review. These are roughly the steps we follow for development ...

  • Clone the development branch of repository.
  • Create you own branch from development. Use the following convention for branch name ...
    • For adding new feature: feature/<branch name>
    • For refactoring: refactor/<branch name>
    • For fixing bugs: bugs/<branch name>
    • For adding documentation: documentation/<branch name> Use short but meaningful ``branch name. For example if you want to add a blast loader use feature/blast-loader```. If its something not cover here use common sense.

Developer install

This is starkly different from a regular user oriented install. It is primarily intended for authoring and developmental purpose. Skip this whole document if your sole purpose is to use the commands.

Using cpanminus

We use cpanm for installing dependencies. Use your OS's package manager or perlbrew or plenv to install it.

  • Go to your project folder.
  • Run cpanm -n . The -n option allows for faster install, however if you prefer run it without -n.
  • It is recommended to use project specific local library path for managing dependencies. Use perlbrew, plenv or local::lib for that. For further information consult their documentation.
  • cpanm will not pull optional dependencies by default. In order to install optional dependencies just use
cpanm -n [module-name]
cpanm -n DBD::Oracle DBD::Pg (for example)

In case the dependencies resides only on github but not on cpan, use the git syntax of cpanm for install.

Unit testing

The standard practice is to have accompanying unit tests for any code addition or changes with any pull request. To write any unit test, first install Test::Chado module.

cpanm git://github.com/dictyBase/Test-Chado.git

Always do a build and test before starting any development.

perl Build.PL
./Build test

Make sure all test passes. If not, inform the author or apply a fix followed by a pull request.

To test a specific test file run

./Build test --test_files t/mytestfile.t

Once the test passes send a pull request and you're done.

Clone this wiki locally