Development Workflow - RPI-HASS/rpi_csdt_community GitHub Wiki
If this is your first time developing with us, please review the Django Tutorial, our style guide, and our architecture guide.
Developing
When developing software for CSnap or the CSDT Community Site, you should follow this process:
- Update your fork/create a fork of the CSDT Community Site Develop Branch
- Identify the issue you are fixing in the bug tracker; take ownership of it
- Setup the development environment
- Make a branch for this particular fix
- Fix it.
- Make a pull request
The commands for that flow are:
cd {{ Directory of this repo }}
git checkout -b {{name of changes to be made}} # Make a branch
# Make changes & test out changes
git add -A # Adds all changes to commit
git commit # Add a description to your changes
git push origin {{name of changes}} # Push changes to github
# Make pull request on github and reference your issue with #{{issue number}}
git checkout develop
Testing
You should test your changes before making a pull request. The commands for that assuming you're using the vagrant setup:
vagrant up # If not already
vagrant ssh # Access vagrant box
cd /vagrant/
python manage.py test # Runs all tests
python manage.py migrate # Migrates the database
Pull Requests
Please make pull requests to the develop branch. Master is updated once a week, or in a crisis. All pull requests need to be reviewed by someone else. Do not approve your own pull request without a good reason!
When you add code, you should be adding tests to verify the code you added. Please view the Django documentation on writing tests, or use the tests in project_share/tests as a template.
Doing a code review
Verify that the code builds and passes all tests pass. Make sure that all added code is commented as needed, and related to an issue.