-
Notifications
You must be signed in to change notification settings - Fork 614
chore(codegen,config-resolver): refactor how endpoint is resolved for non-AWS client #2287
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
...t-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
This depends on newly added CustomEndpointsConfig in @aws-sdk/config-resolver package.
Codecov Report
@@ Coverage Diff @@
## ssdk #2287 +/- ##
=======================================
Coverage ? 61.83%
=======================================
Files ? 454
Lines ? 23291
Branches ? 5520
=======================================
Hits ? 14403
Misses ? 8888
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.
* chore: serialize rest json error code header (#2166) * chore: short-circuit ssdk-incompatible integrations (#2167) * chore: disable idempotency autofill import when not generating a client (#2181) * Support generating non-AWS client (#2222) * 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 * chore(codegen,config-resolver): refactor how endpoint is resolved for non-AWS client (#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. * test(config-resolver): add test for CustomEndpointsConfig (#2305) Co-authored-by: Adam Thomas <[email protected]> Co-authored-by: Jaykumar Gosar <[email protected]>
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. |
Description
This is a refactoring of my earlier attempt at getting a non-AWS client working wrt endpoint resolution. This addresses the concern in #2279 (comment) by separating out the logic used by AWS client v/s non-AWS client. Also makes endpoint required for non-AWS client, addressing adamthom-amzn#1 (comment).
This approach adds some duplication. But seems to fit within the current plugin model in the codegen. Trying to use the same EndpointsConfig.ts but different methods/types would not fit easily into the ServiceGenerator logic. I thought it is better to have some minimal duplication in config-resolver than bigger restructing in codegen.
Testing
I generated the client used in our smithy-typescript-ssdk-demo package and it worked with these changes.
Questions:
chore(codegen,config-resolver): refactor how endpoint is resolved for non-AWS client
matches the expectation of git commit titles for when this is squashed and merged. Or ischore: refactor how endpoint is resolved for non-AWS client
better?By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.