-
Notifications
You must be signed in to change notification settings - Fork 614
chore: merge ssdk branch into main #2279
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
Conversation
* feat(config-resolver): make region optional for non-AWS client * feat(codegen): skip integrations that are not relevant for non-AWS services This is an initial version to get a working version of generated code that compiles without manual edits in smithy-typescript-ssdk-demo. I expect to make updates to this logic. * chore(codegen): address code comments The minor ones from adamthom-amzn#1 * fix(codegen): use SigV4Trait check instead of ServiceTrait AddAwsRuntimeConfigTest is checking for some behaviors from AddAwsAuthPlugin too, which was failing with missing aws.auth#sigv4 trait after my change. Added the trait for now to the test, but unit tests will need to be added/refactored for all these changes. * chore(codegen): move isAwsService check to utils class * chore(codegen): code style formatting * chore(codegen): check SigV4 trait for including region
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov Report
@@ Coverage Diff @@
## main #2279 +/- ##
=======================================
Coverage ? 59.90%
=======================================
Files ? 467
Lines ? 24583
Branches ? 5834
=======================================
Hits ? 14726
Misses ? 9857
Partials ? 0 Continue to review full report at Codecov.
|
… non-AWS client (aws#2287) * chore(config-resolver): refactor EndpointsConfig for non AWS services This reverts an earlier change to EndpointsConfig.ts and instead provides the new functionality in separate CustomEndpointsConfig.ts. This will be used as a separate plugin for endpoint resolution in non AWS clients. * feat(codegen): Use separate CustomEndpointsConfig for non-AWS clients This depends on newly added CustomEndpointsConfig in @aws-sdk/config-resolver package.
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.
Looks good. only have a few comments.
.write("region?: string | __Provider<string>;\n"); | ||
if (isAwsService(settings, model)) { | ||
writer.writeDocs("Unique service identifier.\n@internal") | ||
.write("serviceId?: string;\n"); |
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.
Not a code suggestion but an idea: why not make serviceId as a required parameter just like custom endpoints? Since it's required to differentiate a request always.
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.
It's complicated because the service id is on an aws trait, which we don't want to require.
@Override | ||
protected void writeDefaultErrorHeaders(GenerationContext context, StructureShape error) { | ||
super.writeDefaultErrorHeaders(context, error); | ||
context.getWriter().write("'x-amzn-errortype': $S,", error.getId().getName()); | ||
} |
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.
Is this used anywhere?
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.
Yes, this is used for the ssdk when serializing errors
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This rebases the ssdk branch so that it can be merged into main. Keeping the ssdk branch as a separate feature branch has become cumbersome and will only become more problematic over time.
Note: this build won't pass until this is merged in: smithy-lang/smithy-typescript#315
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.