databerry icon indicating copy to clipboard operation
databerry copied to clipboard

chore: migrate AWS SDK for JavaScript v2 APIs to v3

Open trivikr opened this issue 1 year ago • 6 comments

Issue

From AWS SDK for JavaScript v2 README:

We are formalizing our plans to make the Maintenance Announcement (Phase 2) for AWS SDK for JavaScript v2 in 2023.

Description

This PR migrates AWS SDK for JavaScript v2 APIs to v3 using aws-sdk-js-codemod.

$ npx [email protected] -t v2-to-v3 packages/lib/aws.ts

trivikr avatar Nov 08 '23 08:11 trivikr

@trivikr is attempting to deploy a commit to the databerry Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 08 '23 08:11 vercel[bot]

@trivikr there's other files where we call s3.(...).promise(), are those calls still compatible with v3 ?

// e.g. apps/dashboard/pages/api/datasources/index.ts 
await s3.putObject(params).promise();

gmpetrov avatar Nov 09 '23 15:11 gmpetrov

there's other files where we call s3.(...).promise(), are those calls still compatible with v3 ?

Thanks for the catch.

The codemod missed transforming these files, as the type of the client is any. Codemod only does API transformations which it knows are accurate. It doesn't remove .promise() from any other API calls the source code might be making. I've created a feature request for it at https://github.com/awslabs/aws-sdk-js-codemod/issues/697

I'll verify those usages, and manually remove .promise() calls though for the purpose of this PR.

trivikr avatar Nov 09 '23 20:11 trivikr

I'll verify those usages, and manually remove .promise() calls though for the purpose of this PR.

@gmpetrov Fixed in https://github.com/gmpetrov/databerry/pull/234/commits/61ec16538f0bbceab9d0720a528c89282f22057c

trivikr avatar Nov 09 '23 20:11 trivikr

@gmpetrov I rebase changes since last three months, and also migrated JS SDK v2 APIs in newly introduced webhook.

Are there any other changes needed to test this change in CI, and merge?

trivikr avatar Feb 19 '24 14:02 trivikr

AWS SDK for JavaScript v2 will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025.

For more information, check blog post at https://a.co/cUPnyil

trivikr avatar Mar 11 '24 16:03 trivikr