-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/continous integration continous delivery #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||||||||||
| # Continuous Integration and Continuous Delivery | ||||||||||||||||||
|
|
||||||||||||||||||
| Continuous Integration and Continuous Delivery (CI/CD) is a software development practice that aims to automate the building, testing, and deploying of code changes in a frequent and reliable manner. It helps to ensure that new features can be delivered faster, bugs are caught earlier, and the codebase remains more stable. To achieve faster delivery, automation is used to test and validate all changes and provide feedback to the developer on the state of the system with the inclusion of the changes. | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Continuous Integration | ||||||||||||||||||
|
|
||||||||||||||||||
| Pull requests to merge code changes triggers the automation pipeline. The pipeline runs validation checks and ensures the changes are ready for peer review. The following stages go into detail how the code changes are validated. This pipeline needs to reside in a dedicated, preferrably ephemeral, environment. | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Building | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think 1-3 are "building". 4 definitely is. Maybe this could be "Building and analysis" or separate sections. 1&2 could realistically be part of Testing below.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me place 1-3 in a "Style and Static Analysis" section. I would like to keep the "Testing" section to unit tests and functional tests (with deployment steps to the PR environment), unless you feel strongly about including 1&2 in that section. |
||||||||||||||||||
| 1. Style/lint checks. Ensure consistency in coding styles and convention makes code easier to read and understand. | ||||||||||||||||||
| 2. Static analysis tools. Scans code for quality and potential security risks. | ||||||||||||||||||
| 3. Dependency auditing. Checks third party package for vulnerabilities and updates. | ||||||||||||||||||
| 4. Compilation (for compiled code). Catches syntax/compliation errors. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| ### Testing | ||||||||||||||||||
| 1. Run unit tests. Code changes include new unit tests and modifying existing tests to ensure functionality is working as expected. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 2. Enforce test Coverage. Ensures code base meets testing coverage threshold. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 3. Deploy code to testing environment. Ideally an ephemeral environment that will be used for functional testing. Otherwise use a blocking environment that serializes pull request jobs during the functional tests. | ||||||||||||||||||
| 4. Run database migrations. Scaffolding database and running migrations to build a consistent database that mirrors those in production. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this definitely sounds much better than my initial sentence. |
||||||||||||||||||
| 5. Seed any new application database data. Also seed any test data required for functional tests. | ||||||||||||||||||
| 6. Run functional/integration tests. These tests are written from the perspective of end user/application feature perspective. A typical example uses browser drivers that mimic user interactions with the application, in a repeatable deterministic script. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| ### Code Review | ||||||||||||||||||
| 1. Peer code review and approval. Peer review is ready once all automated checks passes. This ensures that the changes meet the minimum validation threshold before review begins. Any new code changes during the review will trigger the automation pipeline again. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 2. Merge code change. Once the pull request is approved, the author merges the changes. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
While I prefer to merge my own changes, it's pretty common for the reviewer, not the author to merge. One major issue with doing that in a CD system like this though is that the original author may not be aware when the code goes out and available to help if the deploy fails. I see that you're not actually doing full CD - where changes roll out to prod automatically - so its less of a concern.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. In the past, we've done both reviewer merges and author merges. I will mention both options with pro/con of either approach. Having a reliable notification system (to the author of the PR) definitely helps with reviewer merging the PR. |
||||||||||||||||||
|
|
||||||||||||||||||
| ## Continuous Delivery | ||||||||||||||||||
|
|
||||||||||||||||||
| Merging code changes to the development branch triggers automation to deploy the code to a staging environment. | ||||||||||||||||||
|
|
||||||||||||||||||
| 1. Deploy code to qa/staging environment. This environment is a long-lived environment for feature acceptance. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 2. Run database migrations. Run any wew migrations. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 3. Populate database seed data. Populate any new seed data. | ||||||||||||||||||
| 4. Feature Acceptance on staging environment. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous ones in this section read as imperatives (commands). This one doesn't.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| ## Production Deployment | ||||||||||||||||||
|
|
||||||||||||||||||
| Production deployment strategy should include handling rollback and recovery in case of any issues that might happen during deployment. Using release tagging with a version control like Git can help reverting the application to a previously known working state. Combined with regular backups of application data and configuration, will enable fast rollback in case of failure. The follow are steps recommended when deploying to production. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or the chatgpt take:
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like ChatGPT's version with maybe a few of the word replacements removed. Ex: "Paired" vs "Combined". |
||||||||||||||||||
|
|
||||||||||||||||||
| 1. Create a release tag in source control. This will create a snapshot of the codebase for the code that will be deployed to production. | ||||||||||||||||||
| 2. Manual approval for merging of the release tag to the source control. This acts as the final trigger for deployment to production. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are inconsistencies in the terminology used throughout the guide. At times, "source control" is referenced without an article, while in other instances, it's preceded by "the."
Suggested change
There's also some inconsistency in sentence structure for these steps... I think this applies to the other sections of this doc as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me do another path through this to try to fix up the sentence structure. This is definitely a product of my "bullet point" draft -> turning it into a "guide" approach to writing this up. |
||||||||||||||||||
| 3. Automation triggers on the merging of the release tag to the source control. The automation should run through the build stage with the same checks a those for the continous integration build steps. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| 4. The testing stage would run the full unit test suites, and User Acceptance Testing suites in the functional end to end testing if the application has special UAT created accounts on the production application. The goal is to have a set of UAT tests that validates the deployment but not impact production data. | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.