Development workflow

Working with devops in mind

Important

Of course we could type our flow commands by hand using bare git commands, because we know git, because we are git experts.

But it’s forbidden because it’s a bad practice. Use the git flow tools instead.

First, install git flow:

apt-get install git-flow

Usage of the branches

  • The develop branch
  • The feature branch

Don’t use the release nor the hotfix branches by now.

Everday gitflow commands

Only five commands are used, let’s have a look at them.

Clone your project’s repository

First clone of your working copy repository if needed, then please immediately initialize the flow with:

git flow init

please choose the default values.

Start your new task

Make sure you are going to work on an in progress and self assigned redmine task before starting a new feature.

To start a new feature, choose an apropriate feature’s name:

MYFEATURE = <RedmineTaskNumber>_<TaskName>

then just start the feature with:

git flow feature start MYFEATURE

Work on your task

  • preparing the coding session

    • start an open nebula virtual machine infrastructure
    • clone your repository on the VM
    • go in your working copy’s repository on the vm, checkout your feature branch
  • hack until it works

    1. code locally on your workstation
    2. add a file, commit, delete, modify, and so on
    3. pull the changes on your virtual machine
    4. type make install
    5. test and cycle to the first step until it works
  • test like a user

    • cleanup your local branch

    • merge, push an make a package

    • cleanup your virtual machine

      • delete / recreate your virtual machine
      • revert to the initial disk snapshot
    • upgrade the operating system, retrieve your new package

    • test

At the end of the day, in the corresponding redmine’s task

  • add the approximate time you spent implementing your great feature
  • update the remaining time

Terminate your task

Once the feature is finished, you must

  1. clean your history log with git rebase -i
  2. update your branch from the develop branch with the git flow command git flow feature rebase
  3. publish your branch with git flow feature publish

Publishing a feature branch is mandatory in the team because the other ones shall have a look at your code before merging the feature:

git flow feature publish MYFEATURE

Then update the corresponding redmine task, that is please update the Done percentage’s rate to 100% for the other can see that it is ready for the next step.

Once the code review is done and everything seems to be correct, close the feature:

git flow feature finish MYFEATURE

Make a paquet with git package.

Code review step

Important

It must be someone else’s job to close your feature

Install the paquet, verify that the expected functionnality works, and don’t forget to read the code before validating the feature.

Then close the corresponding feature in the redmine

At the end of the sprint

  • verify that all the feature branch are deleted

Attention

Your local feature branches may have already been deleted, use git remote prune before

git remote prune origin
  • merge develop into master
git chechout master
git merge develop
git push
  • tag master with the sprint name
git tag sprint/2016-48-50  -m "sprint 2016 48-50 - EWT"
git push origin sprint/2016-48-50