The "One and Done" initiative, previously known as "QA Taskboard", is a workflow where Mozilla community contributors can pick tasks and work on them - one at a time, one day at a time - and feel good about doing them.
One and Done is wr 8000 itten with Playdoh and Django.
If you're interested in helping us out, please read through the blog post and reach out to us!
These instructions assume you have git, python, and pip
installed. If
you don't have pip
installed, you can install it with easy_install pip
.
-
Start by getting the source:
$ git clone --recursive git@github.com:mozilla/oneanddone.git $ cd oneanddone
Note you may want to fork and clone the repo as described in the github docs if you are doing active development.
-
Create a virtualenv for One and Done. Skip the first step if you already have
virtualenv
installed.$ pip install virtualenv $ virtualenv venv $ source venv/bin/activate
-
Install the compiled requirements:
$ pip install -r requirements/compiled.txt
-
Set up a local MySQL database. The MySQL Installation Documentation explains how to do this. Make sure your DB is utf8.
-
Configure your local settings by copying
oneanddone/settings/local.py-dist
tooneanddone/settings/local.py
and customizing the settings in it:$ cp oneanddone/settings/local.py-dist oneanddone/settings/local.py
The file is commented to explain what each setting does and how to customize them. One item in the local.py settings file you are going to want to change, if you are running this locally and not over HTTPS, is the following.
Open up local.py, find and uncomment SESSION_COOKIE_SECURE = False
-
Create the initial empty database:
# Start the MySQL server $ mysql.server start # Once successfully started, log into the console # using your username and password $ mysql -uroot -p # Create the database mysql> create database oneanddone;
-
Initialize your database structure:
$ python manage.py syncdb
We're using South to handle database migrations. To apply the migrations, run the following:
$ ./manage.py migrate oneanddone.tasks && ./manage.py migrate oneanddone.users
If you make changes to an existing model you will need to regeneratre the schema migration as follows:
$ ./manage.py schemamigration oneanddone.tasks --auto
To generate a blank schema migration:
$ ./manage.py datamigration oneanddone.mymodel data_migration_name
Then fill in the generated file with logic, fixtures, etc. You can then apply this migration as above with:
$ ./manage.py migrate oneanddone.mymodel
You can launch the development server like so:
$ python manage.py runserver
If you are asked to create a super user, just enter no and let the process complete.
There is a REST API support which enables:
- Getting complete list of Tasks.
- Getting detail about a Task with particular id.
- Create and Delete Tasks with particular id.
The Task queries can be made by appending
api/v1/task/
to the base url.
GET and DELETE queries example.
curl -X GET http://127.0.0.1:8000/api/v1/task/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
curl -X GET http://127.0.0.1:8000/api/v1/task/1/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
curl -X DELETE http://127.0.0.1:8000/api/v1/task/1/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
- Getting complete list of Users.
- Getting details about a User with particular email.
- Create and Delete Users with with particular email.
The User queries can be made by appending
api/v1/user/
to the base url.
GET and DELETE queries example.
curl -X GET http://127.0.0.1:8000/api/v1/user/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
curl -X GET http://127.0.0.1:8000/api/v1/user/testuser@tesmail.com/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
curl -X DELETE http://127.0.0.1:8000/api/v1/user/testuser@testmail.com/ -H 'Authorization: Token d81e33c57b2d9471f4d6849bab3cb233b3b30468'
Token used in examples above is just a sample and actual Tokens can be generated from the admin pannel by going to Authtoken > Tokens
.
Functional (Selenium) tests for oneanddone are maintained by the Web QA team and can be found at oneanddone-tests.
This software is licensed under the Mozilla Public License v. 2.0
_. For more
information, read the file LICENSE
.
.. _Mozilla Public License v. 2.0: http://mozilla.org/MPL/2.0/