Code review, continuous integration, and deployment processes - adhocteam/ca-alert GitHub Wiki
This page describes the process used for code review, continuous integration, and deployment of the project. Before any code is deployed to the production site, it must be peer reviewed, and a series of automated tests must pass. We are using some external tools to make this process as automated as possible.
Code Review
GitHub's pull request (PR) tools are used to handle the code review process. When submitting code, developers build it out in a branch and then push that branch to the GitHub repo. They then create a PR and assign it to one or more peers for review. The PR configuration requires that at least one person approves of the request and that the continuous integration tests pass before it can be merged into master. Once the PR is approved, and the checks are passing, either the reviewer or the person who submitted it can merge it into master. We perform merges using the "Squash and Merge" tool, which keeps the git history clean and readable.
Continuous Integration (CI)
Continuous integration is a process that runs a series of tests against a codebase each time a change occurs. We are using CodeShip as our CI service. Each time code is pushed to GitHub on any branch, CodeShip kicks off a build. The build consists of a number of tests for both front-end and back-end code that includes: executing automated tests, checking for code quality, and ensuring that test coverage remains above 95%. Once the tests pass on a given branch, GitHub's PR tools will allow a merge into master to occur.
Deployment
CodeShip can kick off an automated deploy when a passing build occurs on a specific branch. We have set it up to deploy to Heroku each time changes occur in master, which means that with each merged PR a new deploy will be generated. This keeps the code in production up to speed with the latest changes, allows us to detect errors early, and eliminates the overhead of manual deploys.