Skip to content
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

Move default endpoint resolver into a runtime plugin #3072

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

rcoh
Copy link
Collaborator

@rcoh rcoh commented Oct 16, 2023

Motivation and Context

In preparation for inlining the old endpoint traits, I'm cleaning up the endpoint resolver behavior.

Description

  1. The Config field of service_runtime_plugin was unused to I deleted it
  2. Store the endpoint resolver in RuntimeComponents instead of in operation config. This allows a lot of complex logic around ConfigOverride to be removed.
  3. Move the default endpoint resolver into a runtime plugin.
  4. Don't have a fallback implementation for EndpointResolver, allow final construction of RuntimeComponents to fail
  5. ServiceRuntimePlugin has been changed to Defaults so that it doesn't overwrite settings set by the service config

Testing

Well covered by existing UT / IT

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the smithy-rs codegen or runtime crates
  • 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.

@rcoh rcoh requested a review from a team as a code owner October 16, 2023 21:15
@rcoh rcoh changed the title Refactor endpoints to remove default Move default endpoint resolver into a runtime plugin Oct 16, 2023
@rcoh rcoh requested a review from a team as a code owner October 16, 2023 21:16
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

fun addServiceRuntimePlugin(writer: RustWriter, plugin: Writable) {
writer.rustTemplate(".with_service_plugin(#{plugin})", "plugin" to plugin)
fun addClientPlugin(writer: RustWriter, plugin: Writable) {
writer.rustTemplate(".with_client_plugin(#{plugin})", "plugin" to plugin)
}

fun addOperationRuntimePlugin(writer: RustWriter, plugin: Writable) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: rename this to be consistent with the client level function

@rcoh rcoh enabled auto-merge October 17, 2023 17:31
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@rcoh rcoh added this pull request to the merge queue Oct 17, 2023
Merged via the queue into main with commit 6dceb8c Oct 17, 2023
40 of 41 checks passed
@rcoh rcoh deleted the endpoints-refactor-part1 branch October 17, 2023 20:11
github-merge-queue bot pushed a commit that referenced this pull request Oct 18, 2023
…-specific trait (#3078)

## Motivation and Context
- Fixes #3043

As a follow up to #3072 this removes the old endpoint resolver
interfaces in favor of creating a per-service resolver trait.

This trait defines a `into_shared_resolver()` method which converts the
local trait into a global resolver that can be used with the
orchestrator.

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## 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._
rcoh added a commit that referenced this pull request Oct 19, 2023
…-specific trait (#3078)

## Motivation and Context
- Fixes #3043

As a follow up to #3072 this removes the old endpoint resolver
interfaces in favor of creating a per-service resolver trait.

This trait defines a `into_shared_resolver()` method which converts the
local trait into a global resolver that can be used with the
orchestrator.

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## 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._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants