You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/README.md
+7
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,13 @@ If you're ready for the challenge, navigate to the [Getting Started Guide](/gett
26
26
27
27
Otherwise, if you're just interested in a particular topic, you can find it in the sidebar.
28
28
29
+
## Onboarding Resources
30
+
31
+
The onboarding checklist and quick reference guide will be handy as you navigate your first couple months. Please reach out to your onboarding buddy with questions. If you don't have a buddy and want one, please ask the team about it!
32
+
33
+
1.[Onboarding Checklist](https://docs.google.com/document/d/12twlx5nLG6B4R6ds96wh_gZ6wR5Y_PGjsmSeP98V6o0): Make a copy as this will be your personal checklist of important tasks as you onboard
34
+
2.[Onboarding Quick Reference Guide](https://docs.google.com/document/d/1ObraR8X5YUzR1GIwsm903EhS7-AQbpy90--5aAWysKU): A hodge-podge of helpful links, information, who's who, what's what
35
+
29
36
## Looking for Old Docs?
30
37
31
38
Most of the older documentation was moved directly into this docsify directory. The goal is to eventually incorporate them into the top level sections of this documentation, or move them to a common sub directory if they don't fit well into the incremental introduction approach the documentation is attempting to follow. They can be found on one of the following links:
Copy file name to clipboardexpand all lines: docs/additional-resources/blue-green-migration.md
+82-8
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,30 @@
4
4
5
5
Every deployment, whether it's to production or a development environment, is a blue-green deployment. We build a copy for the resources that are required to run a second version of the application. When the copy is ready and tested, we switch the client over to run off of the newly deployed color and have the old color available for rolling back.
6
6
7
-
Additionally, for deployments that require change in the data schema or broad stroke changes to the database in order for the application to function, we build an empty copy of the data stores (DynamoDB and Elasticsearch). Then we perform a migration of information from the old data store into the newly createdone. This migration passes all of the data through a lambda to update and verify the data before saving it into a new data store.
7
+
Additionally, for deployments that require change in the data schema or elasticsearch mappings in order for the application to function, we build an empty copy of the data stores (DynamoDB and Elasticsearch). Then we perform a migration of information from currently running DynamoDB database table (*source table*) into the newly created, empty one (*destination table*). This migration passes all of the data through a lambda to update and verify the data before saving it into the destination table.
8
8
9
9
## Automated Migration Steps
10
10
11
11
**All of the automated migration steps are now handled by CircleCI, as defined in `config.yml`.**
12
12
13
13
Some key steps, excluding automated tests, include:
14
14
15
+
### Manual Steps required before attempting an automated Migration
16
+
17
+
If the destination table exists in either `us-east-1` or `us-west=1`, you will have to delete it before kicking off a CircleCI deployment.
18
+
15
19
### Deploy, Migrate, and Reindex
20
+
16
21
- Deploy updated infrastructure.
17
22
-`migrate` is automatically determined if there are expected migration scripts that do not exist in the DynamoDB table.
18
-
- Disable destination table stream.
19
-
- Migration runs.
20
-
- SQS queue empties.
21
-
- Enable destination table stream.
23
+
- Disable destination table stream.
24
+
- Migration runs.
25
+
- SQS queue empties.
26
+
- Enable destination table stream.
22
27
- ElasticSearch reindexes, and a cron runs to determine if the reindex completes. This will approve the next step in the workflow to run.
23
28
24
29
### Post-successful Deploy
30
+
25
31
- Switch the current color and deployed color.
26
32
- If deploying the `prod` environment, backup the source's DynamoDB table.
27
33
- Delete the source's API gateway mappings, both non-public and public.
- Delete the source's DynamoDB table in `east` and `west` regions.
31
37
- Toggle the deploy table's values for `migrate` and `source-table-version`.
32
38
33
-
34
39
## Manual Migration Steps
35
40
36
41
The application kicks off a migration automatically if it detects migrations that need to be run in the codebase that haven't yet been run upon that environment. In order to force a migration, perform the following manual steps. You might do this if you were doing a package update that might impact the migration and wanted to test it fully.
37
42
38
-
1. Remove a migration script item from the environment's `efcms-<ENV>-deploy` DynamoDB table that is expected to migrate, from the `migrationsToRun.js` file. For example, if `migrationsToRun.js` includes a script called `0001-test-script.js`, delete that item from the DynamoDB table.
39
-
2. Kick off a CircleCI workflow, which will follow the steps above for Automated Migration Steps.
43
+
There are two good ways to trigger a manual migration. You can either [remove the record from the deploy table](#remove-record-of-previous-migration) of one of the previously run migrations, or you can [explicitly configure the deploy table to run a migration](#explicitly-configure-deploy-table) on next deploy.
44
+
45
+
The first step of either is to [delete the destination table](#delete-the-destination-tables)
46
+
47
+
### Delete the Destination Tables
48
+
49
+
We need to delete the destination tables (if they exist) in order to perform a blue green migration. It is preferred to delete the `west` table first mainly because we are using a DynamoDB Global table and replication.
50
+
51
+
The `east` table is master table, and if you delete these tables and recreate them. You will be unable to delete the `east` table until you delete the `west` table. AWS will throw an error if you attempt to delete the `east` table before the `west` table if both exist and they have been deleted within the last 24 hours.
52
+
53
+
#### Via the command line
54
+
55
+
1. Identify the **destination table**. For example, if we're performing a deployment to `dev`:
56
+
57
+
```bash
58
+
$ ./scripts/dynamo/get-source-table.sh dev
59
+
efcms-dev-beta
60
+
$ ./scripts/dynamo/get-destination-table.sh dev
61
+
efcms-dev-beta
62
+
```
63
+
64
+
Both should be the same value, and that is what the application is currently using as it its main data store. If they are both `alpha`, then the destination table is `beta`. If they are both `beta`, the destination table is `alpha`.
65
+
66
+
If they are different, inspect the Lamdba's environment config to determine what table the application is currently using. If that is `beta`, then the destination table is `alpha`, and vice versa.
67
+
68
+
2. Check to see if the **destination table** exists. You can do this via the AWS Console or AWS CLI:
If you get an error, `An error occurred (ResourceNotFoundException) when calling the DescribeTable operation: Requested resource not found: Table: efcms-dev-alpha not found`, then you are ready to proceed with the deployment.
75
+
76
+
If you do not, then it exists, and you must delete the table.
77
+
78
+
3. If it exists, delete the **destination table** in both `east` and `west`. You can do this via the AWS Console or AWS CLI:
NOTE: after deleting the `west` table, you may have to wait a few minutes before you can delete the `east` table.
86
+
87
+
88
+
#### Via the console
89
+
90
+
1. Identify the source table and destination table. Both should be the same value, and that is what the application is currently using as it its main data store. If they are both `alpha`, then the destination table is `beta`. If they are both `beta`, the destination table is `alpha`. If they are different, inspect at the current color Lamdba's environment config to determine the dynamo table that the application is currently using as its data store.
91
+
2. Change the value forthe `current` key of the `pk`:`destination-table-version` to the destination table you identifiedin step 3 (`alpha` or `beta`).
92
+
3. Switch to the `west-1` region.
93
+
4. Delete the destination table in`west`
94
+
5. Go back to east region
95
+
6. Delete the destination table in`east`; note this may take a few minutes as the west table is deleting.
96
+
97
+
### Remove Record of Previous Migration
98
+
99
+
1. Delete the Destination table [see instructions](#delete-the-destination-tables)
100
+
2. Remove a migration script item from the environment's `efcms-<ENV>-deploy` DynamoDB table that is expected to migrate, from the `migrationsToRun.js` file. For example, if `migrationsToRun.js` includes a script called `0001-test-script.js`, delete that item from the DynamoDB table.
101
+
3. Kick off a CircleCI workflow, which will follow the steps above for Automated Migration Steps.
102
+
103
+
### Explicitly Configure Deploy Table
104
+
105
+
1. Go into the environment's deploy table `efcms-<ENV>-deploy`
106
+
2. Change the `migrate` flag to `true`
107
+
3. Identify the source table and destination table. Both should be the same value, and that is what the application is currently using as it its main data store. If they are both `alpha`, then the destination table is `beta`. If they are both `beta`, the destination table is `alpha`. If they are different, inspect at the current color Lamdba's environment config to determine the dynamo table that the application is currently using as its data store.
108
+
4. Change the value for the `current` key of the `pk`:`destination-table-version` to the destination table you identified in step 3 (`alpha` or `beta`).
109
+
5. Switch to the `west-1` region.
110
+
6. Delete the destination table in `west`
111
+
7. Go back to east region
112
+
8. Delete the destination table in `east`; note this may take a few minutes as the west table is deleting.
113
+
9. Kick off a CircleCI workflow, which will follow the steps above for Automated Migration Steps.
40
114
41
115
See [the troubleshooting guide](TROUBLESHOOTING.md) for solutions to problems that may arise during the migration process.
Copy file name to clipboardexpand all lines: docs/team-process.md
+11-15
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,6 @@
2
2
3
3
Now that you've logged in and played around with our Dawson system a bit on a deployed environment, let's talk about our team process and what is expected from our fellow teammates. This part of the documentation should help members get on the same page when it comes to the soft-skills required to work as a well-oiled agile machine.
4
4
5
-
## Onboarding
6
-
7
-
Here are some few resources for documentation associated with onboarding:
If you do not have permissions to view these documents, please reach out to the document owner.
13
-
14
5
## Working Agreement
15
6
16
7
We have talked about writing some form of working agreement so team members have a common understanding of what is expected from them during their daily work. Great teams strive for open communication, safe spaces to speak their mind, and continuous improvement in process. Embracing some of the following ideologies will help grow and sustain a healthy team.
@@ -158,9 +149,14 @@ If dependencies have no patch, replace it with an alternative, or wait for the l
158
149
159
150
Below is a list of dependencies that are locked down due to known issues with security, integration problems within DAWSON, etc. Try to update these items but please be aware of the issue that's documented and ensure it's been resolved.
160
151
161
-
-`@fortawesome` packages locked down to versions pre-6.x.x to maintain consistency of icon styling until there is usability feedback and research that determines we should change them. This includes packages:
162
-
-`@fortawesome/free-solid-svg-icons`
163
-
-`@fortawesome/free-regular-svg-icons`
164
-
-`@fortawesome/fontawesome-svg-core`
165
-
166
-
- It'd be good to keep an eye on `s3rver` for when it exceeds 3.7.1. We have a patch in place for called `s3rver+3.7.1.patch` in order to address the high severity issue exposed by `s3rver`'s dependency on `busboy` 0.3.1, which relies on `dicer` that actually has the [security issue](https://github.com/advisories/GHSA-wm7h-9275-46v2). Unfortunately, `busboy` >0.3.1, aka ^1.0.0, is incompatible with s3rver which is why there's a patch in place to make it compatible.
152
+
1.`@fortawesome` packages locked down to versions pre-6.x.x to maintain consistency of icon styling until there is usability feedback and research that determines we should change them. This includes packages:
153
+
-`@fortawesome/free-solid-svg-icons`
154
+
-`@fortawesome/free-regular-svg-icons`
155
+
-`@fortawesome/fontawesome-svg-core`
156
+
157
+
2. Check if there are updates to `s3rver` above version [3.7.1](https://www.npmjs.com/package/s3rver).
158
+
- Why is there a patch called `s3rver+3.7.1.patch`?
159
+
- To address the high severity issue exposed by `s3rver`'s dependency on `busboy` 0.3.1, which relies on `dicer` that actually has the [security issue](https://github.com/advisories/GHSA-wm7h-9275-46v2). Unfortunately, `busboy` >0.3.1, aka ^1.0.0, is incompatible with s3rver which is why there's a patch in place to make it compatible.
160
+
- How does the patch run?
161
+
- This runs as part of the `npm postinstall` step.
162
+
- Common troubleshooting: If you see the high severity audit issue warning for `dicer`, run a full `npm install` rather than a single package update, as this will run the `postinstall` which is required to run the patch that addresses the security issue.
Copy file name to clipboardexpand all lines: docs/testing.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -311,9 +311,9 @@ This will run the linter, Shellcheck, audit, build, test, Cypress, Cerebral test
311
311
312
312
## PDF Testing
313
313
314
-
Since our system generates a lot of PDFs, we have a set of tests that verify the pdfs didn't change using a checksum of the first exported image of the pdfs. Since all of these PDFs share a single .scss file, there is risk involved when trying to update a single PDF to accidentally change the styles of other PDFs. Therefore, we have a set of tests that verify that the PDFs are not changing.
314
+
Since our system generates a lot of PDFs, we have a set of tests that verify the PDFs didn't change using a checksum of the first exported image of the PDFs. Since all of these PDFs share a single .scss file, there is risk involved when trying to update a single PDF to accidentally change the styles of other PDFs. Therefore, we have a set of tests that verify that the PDFs are not changing.
315
315
316
-
If you are adding/creating a new PDF you must add the PDF name to the pdfs array in image-compare-pdfs.js.
316
+
If you are adding/creating a new PDF you must add the PDF name to the `pdfs` array in image-compare-pdfs.js.
317
317
318
318
All of the expected output images are found in the `./shared/test-pdf-expected-images` directory. In order to update these, you will need to run the following command:
0 commit comments