class: center, middle # Developing for edX Platform ![logo](static/mitx_logo.png) ### Carson Gee [@carsongee](https://github.com/carsongee) --- class: center, middle # Agenda - Application Architecture - Dev Stack Overview - Folder Structure - Managing Settings - Managing Branches - Working on a Feature - Running Tests - Submitting a PR - Additional Documentation --- class: full-width # edX Application Architecture ![arch](static/app-arch.png) --- # Major Technologies - Python - Django (1.4) - Mako Templates - CoffeeScript (deprecated) - SASS - Bok Choy (Acceptance tests) - Jasmine (JS Testing) - backbone.js - XBlock --- # "Dev Stack" - Vagrant & Ansible - Core platform development (or forums, xqueue, xblocks, and analytics) - Testing environment setup - Use your own tools - Development server and debug tools ready --- # Dev Stack - Install Vagrant - Install VirtualBox ```shell mkdir devstack cd devstack curl -L https://raw.githubusercontent.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile vagrant plugin install vagrant-vbguest vagrant up vagrant ssh sudo su edxapp paver run_all_servers ``` - Visit http://localhost:8000 for LMS - Visit http://localhost:8001 for Studio --- class: full-width # Folder structure ![folder](static/folder-structure.png) --- # Managing Settings - `/edx/app/edxapp/(lms|cms).env.json` and `/edx/app/edxapp/(lms|cms).auth.json` ```json ... "EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend", "FEATURES": { "ALLOW_ALL_ADVANCED_COMPONENTS": true, ... "USE_CUSTOM_THEME": true }, "FEEDBACK_SUBMISSION_EMAIL": "", "GITHUB_REPO_ROOT": "/edx/var/edxapp/data", ... ``` - [`/edx/app/edx_ansible/server-vars.yml`](https://gist.github.com/carsongee/2ca7eb51bf10afc3c1eb) - [`/edx/app/edxapp/edx-platform/(lms|cms)/private.py`](https://gist.github.com/carsongee/8bd342e426e5d05d4348) --- # Managing Branches Switch to using your fork: ```bash cd ~/devstack git remote set-url origin git@github.com:
/edx-platform git remote add edx https://github.com/edx/edx-platform git fetch ``` Update to new branch, or after rebase: ```bash sudo /edx/bin/update edx-platform
``` Rebase: ```bash git fetch edx && git rebase edx/master git push -f origin
vagrant ssh sudo /edx/bin/update edx-platform
``` --- # Running Tests - *Huge* test suite, probably don't want to run it all (let Jenkins do that on PR) - Paver helps automate running tests: `paver help` for all options --- class: small-inline-code # Python Tests - `paver test_system -s lms`, `paver test_system -s cms --fasttest` - More importantly: `paver test_system -s lms -t lms/djangoapps/ccx/tests/test_ccx_modulestore.py` - `paver coverage`, `paver run_quality`, `paver run_quality --percentage=100` --- # JavaScript and Acceptance - `paver test_js`, `paver test_js_run -s lms` - `paver run_jshint` - In your own browser: `paver test_js_dev -s lms` - Acceptance tests: `paver test_bokchoy` - supports -t option --- # Submitting a PR - [Official Process](http://edx.readthedocs.org/projects/edx-developer-guide/en/latest/process/overview.html) - General Rules: - If big, architecture and code list posting before code. - Make sure no quality violations, full coverage, documentation and your tests pass. - If user facing, or larger, you'll need a11y, i18n, and analytics. - Respond quickly to comments. - Be nice, win friends, and influence people (HipChat helps a lot here). --- # Extra Resources - [Configuration Dev Stack Wiki](https://github.com/edx/configuration/wiki/edX-Developer-Stack) - [Platform Dev Stack Wiki](https://github.com/edx/edx-platform/wiki/Developing-on-the-edX-Developer-Stack) - [Test Engineering FAQ](https://github.com/edx/edx-platform/wiki/Test-engineering-FAQ) - [Writing and Running Tests](https://github.com/edx/edx-platform/blob/master/docs/en_us/internal/testing.rst) - [Development Guide](http://edx-developer-guide.readthedocs.org/en/latest/) - [Extending the Platform](http://edx-developer-guide.readthedocs.org/en/latest/extending_platform/extending.html)