-
Notifications
You must be signed in to change notification settings - Fork 197
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
Make service config just contain a FrozenLayer
in the orchestrator mode
#2762
Conversation
This commit updates service configs to contain only a single field `FrozenLayer` and remove individual fields. Note that their builders still contain individual fields instead of just containing a `Layer` because `Layer` is currently not `Clone`able.
A new generated diff is ready to view.
A new doc preview is ready to view. |
This commit modifies a Kotlin test for verifying dependencies brought in by an inlineable module. Prior to the commit, the test used an idempotency token, but with smithy-rs#2762, `IdempotencyTokenProvider` will bring in `aws_smithy_types` due to that provider being defined in an inlineable module. The test needed to be bifurcated between middleware and orchestrator but that was not possible because the test was in codegen-core and bifurcation was only possible in codegen-client. For this reason, this commit switches the test to use another inlineable module.
A new generated diff is ready to view.
A new doc preview is ready to view. |
...in/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointConfigCustomization.kt
Show resolved
Hide resolved
...are/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGeneratorTest.kt
Outdated
Show resolved
Hide resolved
...are/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGeneratorTest.kt
Show resolved
Hide resolved
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.
Overall I really like the direction here.
Some things we should think about:
-
In a RuntimePlugin world, I don't think we need to set defaults in the service config do we? We might want a separate plugin that sets defaults and keep the fields on service config optional...
-
Some more thought about how we handle identity resolvers / interceptors is required I think
-
In a RuntimePlugin world, I guess service config only needs to handle fields we aren't taking care of elsewhere, maybe eventually, it just holds onto the SdkConfig in it's runtime plugin state?
...n/src/main/kotlin/software/amazon/smithy/rustsdk/customize/timestream/TimestreamDecorator.kt
Outdated
Show resolved
Hide resolved
...kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt
Show resolved
Hide resolved
...ware/amazon/smithy/rust/codegen/client/smithy/customizations/HttpConnectorConfigDecorator.kt
Outdated
Show resolved
Hide resolved
...re/amazon/smithy/rust/codegen/client/smithy/customizations/InterceptorConfigCustomization.kt
Outdated
Show resolved
Hide resolved
...are/amazon/smithy/rust/codegen/client/smithy/customizations/ResiliencyConfigCustomization.kt
Outdated
Show resolved
Hide resolved
…egen/client/smithy/generators/config/ServiceConfigGeneratorTest.kt Co-authored-by: Zelda Hessler <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
Shared with Russell off-line that this PR is meant to be as dumb and mechanical as possible, simply translating what we currently have into the new way. We'll address provided feedback in a series of upcoming PRs (especially 1 and 3 above). |
This commit addresses #2762 (comment)
This commit addresses #2762 (comment)
This commit addresses #2762 (comment) #2762 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
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.
Would it be simpler to use a ConfigBag
in both middleware and orchestrator mode, and just change middleware code to call accessor methods instead?
...smithy/rust/codegen/client/smithy/generators/config/IdempotencyTokenProviderCustomization.kt
Show resolved
Hide resolved
...hy/rust/codegen/client/smithy/generators/config/IdempotencyTokenProviderCustomizationTest.kt
Outdated
Show resolved
Hide resolved
...hy/rust/codegen/client/smithy/generators/config/IdempotencyTokenProviderCustomizationTest.kt
Outdated
Show resolved
Hide resolved
This commit addresses #2762 (comment)
This commit addresses #2762 (comment)
It's true that using |
A new generated diff is ready to view.
A new doc preview is ready to view. |
We should add a changelog entry for the |
Renaming `make_token` to `idempotency_token_provider` will be handled in a separate PR.
Will do that as part of the next PR. Thanks for the suggestion. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
This commit addresses #2762 (comment)
## Motivation and Context Incorporates suggestion made in #2762 (comment) ## Description This PR renames `make_token` to `idempotency_token_provider` for clarity wherever it is referred to in the fields and API in service configs and their builders. ## Testing Existing tests in CI ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Yuki Saito <[email protected]>
This commit addresses #2762 (comment)
## Motivation and Context This PR will reduce fields in service config builders to contain only `CloneableLayer` (except for `interceptors` and `identity_resolvers`). ## Description This is the third PR in a series of config refactoring in the orchestrator mode. Just like #2762, this PR reduces fields in service config builders to contain `CloneableLayer`. The code changes follow a straightforward pattern where builders' setters are implemented via a config layer. ## Testing Relies on the existing tests in CI ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Yuki Saito <[email protected]> Co-authored-by: Zelda Hessler <[email protected]>
## Motivation and Context Incorporates suggestion made in smithy-lang/smithy-rs#2762 (comment) ## Description This PR renames `make_token` to `idempotency_token_provider` for clarity wherever it is referred to in the fields and API in service configs and their builders. ## Testing Existing tests in CI ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Yuki Saito <[email protected]>
Motivation and Context
Service config structs now only contain a
aws_smithy_types::config_bag::FrozenLayer
in the orchestrator mode (no changes for the middleware mode).Description
This PR reduces the individual fields of service configs to contain just
FrozenLayer
. This makes service configs work more seamlessly with runtime plugins in the orchestrator mode.Note that service config builder s still contain individual fields. We're planning to make them just contain
aws_smithy_types::config_bag::Layer
. To do that, though, we need to makeLayer
cloneable and that will be handled in a separate PR. For builders, the only change you will in the PR is that theirbuild
method will put fields into aLayer
, freeze it, and pass it to service configs.This PR is marked as a breaking change because it's based on another PR that's also breaking change.
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.