Labs/Jetpack/FlightDeck/Contribution: Difference between revisions

 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{draft}}
= Overview =
= Overview =


*Changes should follow [[Labs/Jetpack/FlightDeck/Contribution/Style_Guide|Style Guide]]
*Changes should follow [[Labs/Jetpack/FlightDeck/Contribution/Style_Guide|Style Guide]]
*All changes should be accompanied with test (no front-end tests yet)
*All changes should be accompanied with test. (front-end tests soon)
*Development should be done on [http://github.com/ Github]
*Development is done on [http://github.com/ Github], but we certainly don't want to limit the user experience to github only. Feel free to use the server of your choice.
*Every change should have a corresponding bug in [https://bugzilla.mozilla.org/buglist.cgi?component=FlightDeck&product=Mozilla%20Labs bugzilla]
*Every change should have a corresponding bug in [https://bugzilla.mozilla.org/buglist.cgi?component=FlightDeck&product=Mozilla%20Labs bugzilla]
*Every change should be developed in a specific branch named bug-12345-human_readable where 123245 is a number of the bug
*Every change should be developed in a specific branch, it would be good if it would contain the number of the bug in bugzilla (i.e. 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
*There is a number of developers who are able to merge and push from the contributor's branch to the main repository
*Production branch is for production only and it is merged from devel only
*Production is updated from the tags marked before launch of the specific version (i.e. 0.9.4)
*You may also like to read the [[Labs/Jetpack/FlightDeck/Code_Workflow|Code Workflow]] document.


If you have questions, ask in [irc://irc.mozilla.org/#jetpack #jetpack on IRC] or on the [http://groups.google.com/group/mozilla-labs-jetpack Jetpack mailing list].
== Development installation ==
You may also like to read the [[Labs/Jetpack/FlightDeck/Code_Workflow|Code Workflow]] document.
*[[Labs/Jetpack/FlightDeck/Contribution/Installation|Basic Installation instructions]]
*[[Labs/Jetpack/FlightDeck/Contribution/CeleryInstallation|Running Celery]]
*[[Labs/Jetpack/FlightDeck/Contribution/ElasticSearchInstallation|Running Elastic Search]]
*[[Labs/Jetpack/FlightDeck/Contribution/PrepareFirefox|Firefox Configuration]]


= How to start =
== Contact the team ==
 
If you have questions, ask in [irc://irc.mozilla.org/#flightdeck #flightdeck on irc.mozilla.org] or on the [http://groups.google.com/group/mozilla-labs-jetpack Jetpack mailing list].
''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
[http://erikvold.com/blog/index.cfm/2010/12/13/installing-flightdeck-on-osx 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 ===
* Create github account
* Fork from the official [http://github.com/mozilla/FlightDeck main 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 [http://pastebin.mozilla.org/1020232 that file] to ./settings_local.py, change the password to the database.
 
'''Test the configuration'''
 
./manage.py test
 
The result should look similar to this one:
 
16:23:1296778995 nose.plugins.manager:DEBUG DefaultPluginManager load plugin figleaf-sections = figleaf.nose_sections:FigleafSections :/home/zalun/Projects/FlightDeck/vendor/lib/python/nose/plugins/manager.py:359
nosetests --verbosity 1
16:23:1296778995 nose.plugins.manager:DEBUG DefaultPluginManager load plugin figleaf-sections = figleaf.nose_sections:FigleafSections :/home/zalun/Projects/FlightDeck/vendor/lib/python/nose/plugins/manager.py:359
Creating test database 'default'...
...Skipping setup of test_flightdeck!
...Try FORCE_DB=true if you need fresh databases.
No fixtures found.
....................S.....................16:24:1296779079 f.jetpack:ERROR Path not found: None, package: 1000001. :/home/zalun/Projects/FlightDeck/apps/jetpack/views.py:490
..S..............16:25:1296779107 f.xpi_utils:INFO Created: /tmp/AtFYdVQ2At.xpi :/home/zalun/Projects/FlightDeck/apps/xpi/xpi_utils.py:50
....16:25:1296779115 f.xpi_utils:INFO Created: /tmp/Sz2p9Xaffh.xpi :/home/zalun/Projects/FlightDeck/apps/xpi/xpi_utils.py:50
...16:25:1296779122 f.xpi_utils:INFO Created: /tmp/t5PWGw4A87.xpi :/home/zalun/Projects/FlightDeck/apps/xpi/xpi_utils.py:50
16:25:1296779122 f.cron:INFO Deleted: /tmp/t5PWGw4A87.xpi :/home/zalun/Projects/FlightDeck/apps/jetpack/cron.py:30
.16:25:1296779125 f.xpi_utils:INFO Created: /tmp/b49sQMCzeK.xpi :/home/zalun/Projects/FlightDeck/apps/xpi/xpi_utils.py:50
.16:25:1296779128 f.xpi_utils:INFO Created: /tmp/jrTvjdQMnq.xpi :/home/zalun/Projects/FlightDeck/apps/xpi/xpi_utils.py:50
..
----------------------------------------------------------------------
Ran 70 tests in 133.724s
OK (SKIP=2)
 
'''Sync database'''
 
./manage.py syncdb
 
You will be asked if admin user should be created. Create it. You will need it to authenticate in the site
 
'''Run dev server'''
 
./manage.py runserver
 
== Future use ==
 
To get into the flightdeck environment you will need to run
 
workon flightdeck


= How to commit =
= How to commit =


#checkout to the branch you want to fix  
#[https://bugzilla.mozilla.org/buglist.cgi?emailreporter2=1&emailtype2=exact&resolution=---&emailcc2=1&query_format=advanced&emailqa_contact2=1&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=REOPENED&email1=flightdeck%40mozilla.com&emailassigned_to1=1&emaillongdesc2=1&component=FlightDeck&product=Mozilla%20Labs Find]or [https://bugzilla.mozilla.org/enter_bug.cgi?product=Mozilla%20Labs&component=FlightDeck create] bug in bugzilla
#*master for current development <pre>git checkout master; git pull origin master</pre>
#checkout and update the branch you want to fix  
#*master for current development <pre>git checkout master; git pull main master</pre>
#*release-# branches for fixing the release <pre>git checkout release-1.0a3; git pull origin release-1.0a3</pre>
#*release-# branches for fixing the release <pre>git checkout release-1.0a3; git pull origin release-1.0a3</pre>
#fetch current remote branches <pre>git fetch</pre>
#fetch current remote branches <pre>git fetch</pre>
#[https://bugzilla.mozilla.org/buglist.cgi?emailreporter2=1&emailtype2=exact&resolution=---&emailcc2=1&query_format=advanced&emailqa_contact2=1&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=REOPENED&email1=flightdeck%40mozilla.com&emailassigned_to1=1&emaillongdesc2=1&component=FlightDeck&product=Mozilla%20Labs Find]or [https://bugzilla.mozilla.org/enter_bug.cgi?product=Mozilla%20Labs&component=FlightDeck create] bug in bugzilla
#create the branch you want to work on <pre>git checkout -b bug-12345-name_of_the_feature</pre>
#check if the bug branch is already created <pre>git branch -r</pre>
#*if so - use it to create your branch <pre>git checkout -b bug-12345-name_of_the_feature main/bug-12345-name_of_the_feature</pre>
#*else create a new branch <pre>git checkout -b bug-12345-name_of_the_feature</pre>
#code
#code
#commit changes
#test <pre>./manage test</pre>
#commit changes <pre>git commit -am "Please add comment here"</pre>
#push to your repository <pre>git push origin bug-12345-name_of_the_feature</pre>
#push to your repository <pre>git push origin bug-12345-name_of_the_feature</pre>
#provide the link to the commit in bugzilla
#provide the link to the commit in bugzilla
#switch back to master branch <pre>git checkout master</pre>
#switch back to master branch <pre>git checkout master</pre>
Ad 4. Sometimes you may want to work on some else's repository do following instead:
<pre>git remote add {username} {user_read_repository_at_github}
git fetch {username}
git checkout -b bug-12345-name_of_the_feature {username}/bug-12345-name_of_the_feature</pre>


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''.
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''.
Confirmed users
514

edits