Development + CI/CD

Development and CI/CD go hand-in-hand because they are both part of the basic iteration cycle of making code changes in a branch and getting those changes live in production. We have optimized the iteration cycle by automating common manual work, and in particular by supporting a preview environment.

Basic Process

The basic iteration cycle looks exactly like what all developers are already accustomed to, but with common points of friction removed:

  1. Create a branch in git and make code changes.

  2. Create a pull request (PR) in GitHub.

  3. A preview environment is automatically generated for the PR!

  4. Ensure the code changes work as expected in the local and/or preview environment. Share the preview link with a PM to validate a feature / bug fix, run demos from it, etc.

  5. Ensure all the CI tests have run successfully (merging is blocked otherwise).

  6. Ready to launch it?

    • (No) Make more code changes and repeat from step 4.

    • (Yes) Merge to the main branch from GitHub! It deploys to production automatically.

Architecture

More Detail

Each pull request (PR) produces a unique preview environment which can be easily shared for the purpose of demos, quality testing, performance testing, etc. Any runtime errors that may be triggered by the integration or E2E tests are logged to New Relic (or alternative) and force the failure of the job, thus adding even more protection than the test assertions themselves.

Simply merging to the main branch results in a production deployment if all CI checks pass.

Any bugs that are realized in production with real customer use will be logged into New Relic and then synchronized + aggregated into OpsGenie alerts and Jira tickets, which pushes notifications to the dev team such that they can respond immediately (read more in-depth information on error aggregation, alerting, and resolution). Troubleshooting a bug is facilitated by the rich New Relic web interfaces, and of course raw server and CDN logs can be accessed via CloudWatch if needed

Deploying a bug fix is simply a matter of creating a branch, opening a PR for it, and merging it after review.

Tooling

Keep in mind that the tools mentioned here (e.g. NewRelic, Jira) are not required, and several alternatives are available to choose when you configure your infrastructure.