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 it's tied to any existing issue, please make sure to refer it.

  • It is primarily intended for authoring and developmental purpose. Skip this whole document if your sole purpose is to use the commands. Instead follow this document.

  • Any issue regarding installation/use of third party modules is beyond the scope of this document, please refer to their individual documentation for details. Consulting and/or searching stackoverflow and/or google is highly recommended.

Requirements

A working knowledge with the following softwares and related workflows 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.
  • Basic knowledge of working with github, like tracking issues, managing pull requests and releases.

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

The purpose of this setup is different from a regular user oriented install.

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.

Testing presence of module or checking module installation

cpanm -n Devel::Loaded
  • Then run for any module you want to check
pmvers [Module-Name]
pmvers DBI
pmvers DBD::Oracle
pmvers Test::Chado

pmtools is also full of goodies and utility commands, might come handy.

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.

Doing a release

Release management is done through Dist::Zilla. For details about Dist::Zilla and how it works go through the tutorials.

  • Install Dist::Zilla.
cpanm -n Dist::Zilla

Get a coffee or something, should take a while.

  • Switch to develop branch.
  • Bump version number in dist.ini file. Use semver for versions.
  • Run dzil build.
  • Commit dist.ini and other toolchain files to git and push the commit.
  • Draft a new release and upload the tarball to the release page.