This section covers the process TownSites uses for developing new features and fixing bugs.
We use Asana for tracking tasks. Visit the Developer project board to view tasks currently in need of development.
Discovery Phase
Developer tasks typically include a preliminary “Discovery Phase” during which you will spend time investigating what needs to be completed. This includes:
- Familiarizing yourself with the code and the solution currently in place, if any
- Researching on the Internet the best method of developing the feature
- Getting information on other team members
Once you’ve decided how the feature is to be developed, put together a brief summary of your findings and place it in the task in Asana. Include links to resources and examples if necessary. Once it is approved, you can move on to the “Development Phase”.
Development Phase
Once you’re ready to start, use SSH to login to your Developer Environment and use Git to create a new branch. Our naming standard for branches is {type}/{task-name}
, where type
is the type of task and task-name
is the name of the task. For instance, bugfix/authentication-issues-on-facebook
Examples of task types include:
- Bugfix: A fix for an existing bug. Branched from
dev
. - Feature: Development for a new feature. Branched from
dev
. - Hotfix: An urgent fix to be deployed immediately. Branched from
main
.
As you code, your changes will be compiled and deployed to your environment immediately, allowing you to test simply by refreshing the browser. Once you are finished, you can commit your code and push your changes to Github.
Once your code is on GitHub, create a pull request to the dev
branch so that it can be tested. Your pull requests require approval before they can be merged into dev
. Once they are approved, you can merge the branch.
Important: Database changes are not merged along with your code! If you made any changes to the database during development (for example, changing WordPress settings or creating/editing pages) you must indicate this in your pull request. If possible, include an export file or an SQL command that can be placed directly into the new environment.
Testing Phase
After merging, update the Staging Environment so that the code can be tested by QA. To do this:
- The Staging Environment must be updated with your code. You can do this yourself by opening your terminal and entering:
git -C /home/townsitesdev/public_html/staging.townsites.dev pull origin dev
- Go to the Staging Environment in your browser (staging.townsites.dev) and ensure that your changes have merged.
- Make any database changes in the Staging Environment that were made to your Developer Environment (see note above).
- In Asana, indicate that the task is ready for testing and re-assign it to the QA Specialist. The QA Specialist will assign the task back to you if changes need to be made.