Skip to content
David Durieux edited this page May 23, 2015 · 14 revisions

Developper guide

The goal of this guide is to help you to contribute to Alignak. We give info about files and folders of repository and procedure to commit.

Structure of files and folders

The most important to know

  • alignak folder of python library Alignak *
  • test forlder where you find all tests, used to maintain Alignak in a good health ;)
  • AUTHORS file where find all contributors of Alignak

other less important

  • libexec some scripts useful in some cases (nsca, libvirt...)
  • manpages manpages of shinken commands
  • setup.py file used to install Alignak (directly or througth pip)

Repository

Branches

There is a minimal number of branches in the repository to be simple:

  • master this branch is the branch of the current stable release
  • develop this branch is the branch where add new features for the next stable release

Rule to commit

Nobody commit code directly in the official repository (core developers included)! We work only with pull request (PR). A pull request is:

  • a branch on a forked repository of alignak (in this case, a forked version in your github repository)
  • one feature or one fix only. If you have many features / fixes, create one pull request for each
  • contain tests (of course)

When the pull request is created, one of core developers check your pull request.

Possible actions when the pull request has been reviewed:

  • it's ok, nice ;)

    • core developper accept the pull request and merge it in the official repository
  • it's not ok, core developper add comment in the pull request to inform the problem. This is some possible reasons:

    • tests not ok (each pull request run tests and you can see if your pull request not create problems)
    • tests are missing
    • not aggree with the code (syntax, implementation...)

Commands to commit / pull request

prepare your local repository

  1. clone the official repository

git clone [email protected]:Alignak-monitoring/alignak.git

  1. in github interface fork the officiel repository in your account space (for example, we use myspace)

TODO: screenshot

  1. add your forked repository in local git

git remote add myalignak [email protected]:myspace/alignak.git

  1. get all branches of your forker repository

git fetch myalignak

begin to work

  1. Be sure you are in branch develop

git checkout develop

  1. create a new branch in local for you feature or fix

git branch master+nameofyourfeatureorfix

  1. go in this branch

git checkout master+nameofyourfeatureofrix

  1. write your code + tests ;)

Let's go: think, write, think, write, think, write ^^

  1. Add your name

Add your name in file /AUTHORS if it is not in this. It's the list of persons have contributed to the project

6, check if your code is ok (like indentation...)

pep8 --max-line-length=100 --ignore=E303,E302,E301,E241 --exclude='.pyc' alignak/

  1. commit your changes

git add filex1 filex2 git commit -t "message for the commit"

  1. when finished, push your branch in your forked repository

git push myalignak master+nameofyourfeatureorfix:master+nameofyourfeatureorfix

  1. Go in github and gituhp propose you to create pull request from your branch and the develop branch of the official Alignak repository

  2. If you want to create another feature/fix, go to 1. ;)

How I can add another commit after the pull request has been created?

Don't be affraid, It's very simple:

  1. in your local repository, go in the branch of your pull request

git checkout master+nameofyourfeatureoffix

  1. make the changes and commit

git add filex1 filex2 git commit -t "message for the commit"

  1. update your local branch in your forked repository

git push myalignak master+nameofyourfeatureoffix:master+nameofyourfeatureoffix

  1. your new commit is automatically added in the pull request

Need more help, chat with us

We have multiple ways to chat:

  • IRC, channel #alignak on freenode
  • mailing list developers
  • gitter on github
  • github issues for questions of new features / fixes
Clone this wiki locally