Skip to content

Conversation

@o-olaosebikan
Copy link
Collaborator

Migrate AWS SDK FROM Version 2 TO Version 3

Description

End of life support FOR AWS-SDK was reached on September 8, 2025

The JS AWS SDK is used to send metrics to cloudwatch from pwa kit runtime library. The goal is to update the library to use v3 version. We utilize codemod scripts for the migration (recommended by AWS) and manually adjust discrepancies between the two versions

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Change of import; use of client-cloudwatch instead for v3
  • The key maxRetries was renamed to maxAttempts for v3
  • v3 supports promises instead of callback functionality
  • Adjust metric sender to convert timestamp to Date where necessary

How to Test-Drive This PR

  • Run npm install and npm ci at the root
  • cd into packages/template-mrt-reference-app
  • Run the following commands:
npm run save-credentials -- --cloud-origin https://cloud-<env>.mobify-staging.com/ -u <email> -k <api-key>
npx pwa-kit-create-app
npm run push -- --cloud-origin https://cloud-<env>.mobify-staging.com -s <project>
  • Deploy the bundle to your target
  • Run the command below about 5 times to ping the endpoint
    curl -s -o /dev/null -w "%{http_code}\n" https://{project}-{target}.[mobify-storefront-staging.com](http://mobify-storefront-staging.com
    Wait for a few minutes and then check your subaccount of the target for the following metrics
    Cloudwatch > Metrics > ssr > Project, Target
    Ensure RequestTime and RequestSuccess are displayed in metrics
  • Run the command below about 5 times to ping the endpoint
    curl -s -o /dev/null -w "%{http_code}\n" https://{project}-{target}.[mobify-storefront-staging.com](http://mobify-storefront-staging.com/exception
    Wait for a few minutes and then check your subaccount of the target for the following metrics
    Cloudwatch > Metrics > ssr > Project, Target
    Ensure RequestTime and RequestFailed500 are displayed in metrics

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@o-olaosebikan o-olaosebikan requested a review from a team as a code owner January 7, 2026 23:02
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jan 7, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@o-olaosebikan o-olaosebikan added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Jan 7, 2026
@noahadams
Copy link
Collaborator

Followed test instructions, seeing metrics as expected from a bundle built from this branch 🙌 📈 . Happy to approve review once you address the nit above.

The one failing check I'm seeing from CI right now (SalesforceCommerceCloud/pwa-kit/test / pwa-kit-windows (22, 8) (pull_request)) seems unrelated to your change.
Screenshot 2026-01-08 at 2 51 44 PM

Copy link
Collaborator

@noahadams noahadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, CI happy 👍

@noahadams noahadams self-assigned this Jan 8, 2026
@o-olaosebikan o-olaosebikan merged commit e268e67 into develop Jan 9, 2026
73 of 74 checks passed
@o-olaosebikan o-olaosebikan deleted the o.olaosebikan/aws-sdk branch January 9, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants