-
Notifications
You must be signed in to change notification settings - Fork 754
feat(smus): Upgrade sdk v2 to sdk v3 - DataZoneCustomClient #8411
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?
Conversation
2890cdb to
0f08f21
Compare
|
vpbhargav
left a comment
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.
Thanks for making these changes! How are we testing and ensuring there is no regression?
| const awsCredentialProvider = async () => { | ||
| const credentials = await this.credentialProvider.getCredentials() | ||
| return { | ||
| accessKeyId: credentials.accessKeyId, | ||
| secretAccessKey: credentials.secretAccessKey, | ||
| sessionToken: credentials.sessionToken, | ||
| expiration: credentials.expiration, | ||
| } | ||
| } |
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.
This wrapper needed? Unable to pass this.credentialProvider directly to the clientConfig? Seems like it but just want to confirm.
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.
Yeah it is needed. I am not Typescript pro, but here is my understanding:
- passing this.credentialProvider would only pass the method,
- with the wrapper it also passes the instance
we would need the correct instance to get the credentials
Inspired by @liuzulin:
https://github.com/aws/aws-toolkit-vscode/blame/20a5e850bc483e0d649eddf1880014e2873ca565/packages/core/src/sagemakerunifiedstudio/shared/client/s3Client.ts#L159
| listDomains: sinon.stub().returns({ | ||
| promise: () => Promise.resolve(mockResponse), | ||
| }), | ||
| send: sinon.stub().resolves(mockResponse), |
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.
Are we able to be specific with which method is being called for this sub as well? listDomains in this case?
| assert.deepStrictEqual(mockDataZoneClient.getDomain.firstCall.args[0], { | ||
| identifier: mockDomainId, | ||
| }) | ||
| assert.ok(mockDataZoneClient.send.calledOnce) |
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.
These assertion are not the same. We were validating input params earlier and now we are just validating that some send call is made. Are we able to maintain the old assertions?
Same for other places in test too.
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.
Yeah you are right, the verifications are over simplified. let me add some more detailed validation
| domainId: mockDomainId, | ||
| id: 'gp_profile1', | ||
| status: 'ACTIVATED', | ||
| status: 'ASSIGNED', |
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.
Why did this need to change? Previous test was wrong?
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.
Yeah it was wrong, it would be either UNASSIGNED or ASSIGNED
I did sanity test for each of the 3 SDK upgrade PRs, I think we would also want to let the team test the prerelease vsix after the 3 PRs are merged. |
0f08f21 to
8cc99e4
Compare
8cc99e4 to
024ac3d
Compare
Summary
This PR migrates the DataZone custom API client from the deprecated AWS SDK v2 generator pattern to standalone AWS SDK v3-compatible packages. This migration is required as part of the broader AWS Toolkit repository migration from SDK v2 to v3.
The AWS Toolkit VSCode repository is deprecating the centralized generateServiceClient.ts script that generates TypeScript clients from service JSON definitions. The SageMaker Unified Studio (SMUS) team currently uses this v2 generator for DataZone Custom API.
Solution
feature/xbranches will not be squash-merged at release time.