Labs/Jetpack/FlightDeck/Contribution

Draft-template-image.png THIS PAGE IS A WORKING DRAFT Pencil-emoji U270F-gray.png
The page may be difficult to navigate, and some information on its subject might be incomplete and/or evolving rapidly.
If you have any questions or ideas, please add them as a new topic on the discussion page.

Overview

  • Changes should follow Style Guide
  • All changes should be accompanied with test (no front-end tests yet)
  • Development should be done on Github
  • Every change should have a corresponding bug in bugzilla
  • Every change should be developed in a specific branch named bug-12345-human_readable where 123245 is a number of the bug
  • There is a number of developers who are able to merge and push from the private branch to the main repository
  • Production branch is for production only and it is merged from devel only

If you have questions, ask in #jetpack on IRC or on the Jetpack mailing list. You may also like to read the Code Workflow document.

How to start

We do work on github, but certainly we don't want to limit the user experience to github only. Feel free to use the server you like the most.

Installation

Based on Erik's blog. Aiming to work on any Un*x systems - a few commands may be different - Ubuntu commands are used. I assume if any other distro is used user already knows how to use it.

Requirements

  • Python 2.6
  • Git
  • MySQL
  • database `flightdeck-db`, with all privileges granted to `flightdeck-user`

Prepare the repository

Prepare the system

Install needed dev packages

sudo apt-get build-dep python-mysqldb libxslt-dev libxml2-dev
sudo easy_install pip
sudo pip install virtualenvwrapper
sudo pip install virtualenv

Prepare virtual environment

echo "export WORKON_HOME=~/Envs" > ~/.virtualenvwrapper.sh
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.virtualenvwrapper.sh
# OSX
echo "source ~/.virtualenvwrapper.sh" >> ~/.bash_profile
# Ubuntu
echo "source ~/.virtualenvwrapper.sh" >> ~/.bashrc
source ~/.virtualenvwrapper.sh
mkvirtualenv --no-site-packages flightdeck

Install repository

Clone

git clone https://github.com/{your_github_username}/FlightDeck.git
git remote add main https://github.com/mozilla/FlightDeck.git
git submodule update --init

Install required software to virtual environment

pip install simplejson
pip install mysql-python
cd FlightDeck
pip install -r requirements/development.txt

Configure your local settings

Copy contents of that file to ./settings_local.py, change the password to the database.

Test the configuration

The only test which may fail is the authentication against AMO database. To test this bug one needs to be under Mozilla's VPN and have access to AMO database configured in settings_local.py file.

./manage.py test

How to commit

  1. checkout to the branch you want to fix
    • master for current development
      git checkout master; git pull origin master
    • release-# branches for fixing the release
      git checkout release-1.0a3; git pull origin release-1.0a3
  2. fetch current remote branches
    git fetch
  3. Findor create bug in bugzilla
  4. check if the bug branch is already created
    git branch -r
    • if so - use it to create your branch
      git checkout -b bug-12345-name_of_the_feature main/bug-12345-name_of_the_feature
    • else create a new branch
      git checkout -b bug-12345-name_of_the_feature
  5. code
  6. commit changes
  7. push to your repository
    git push origin bug-12345-name_of_the_feature
  8. provide the link to the commit in bugzilla
  9. switch back to master branch
    git checkout master

If this is a fix to the current production system and it has to be implemented immediately please use the hotfix prefix instead of the bug one. Like hotfix-12345-name_of_the_fix.

Merging

Please always add --no-ff if using git merge