cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
35 stars 13 forks source link

Integration of new `StatusCreatedAt` GSI in web application #4287

Open srtalbot opened 2 months ago

srtalbot commented 2 months ago

Context on why we had to create a new GSI: https://github.com/cds-snc/platform-forms-client/issues/4205#event-14308835557

Deployment plan (for both Staging and Production):

  1. Review, update, merge and release https://github.com/cds-snc/forms-terraform/pull/810
  2. Write an run migration script to update all existing Vault CONF# items
    • Add CreatedAt property (equal to the one that already exists in NAME# items) in CONF# items.
  3. Review, update, merge and release https://github.com/cds-snc/platform-forms-client/pull/4257
  4. Write and run migration script to update existing Vault NAME# items. This script should be executed in a period where there is the lowest traffic possible on GC Forms (e.g. Saturday at noon) as there is a very very very minimal risk of race condition where both the script and a user of GC Forms would try to update the exact same item in the Vault.
    • Add or update Status#CreatedAt property (using the existing Status and CreatedAt properties from the same item) in NAME# items
  5. Switch use of the Status GSI by StatusCreatedAt in the web application. New index does not return as many properties as the old one so we need to change how the web app loads all the data needed to render a complete response page
  6. Delete the Status GSI in DynamoDB Vault table
  7. Remove any reference to the old Status property in the web application. If applicable, use Status#CreatedAt instead of Status
  8. Remove any reference to the old Status property in the infra (Nagware). If applicable, use Status#CreatedAt instead of Status
anikbrazeau commented 3 weeks ago

Related issue: https://github.com/cds-snc/platform-forms-client/issues/3051

craigzour commented 6 days ago

Deployment plan has been updated after I discovered a scenario that was not originally taken into account. @srtalbot @Abi-Nada

srtalbot commented 4 days ago

Part 2 is now in prod!

On part 3 of the deployment plan. Testing before merging to staging.

craigzour commented 14 hours ago

Part 3 is now released in Production.

Will now be testing part 4 in Staging.