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

feat: add retry and http client plugins #671

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Conversation

AndrewFossAWS
Copy link
Contributor

@AndrewFossAWS AndrewFossAWS commented Feb 22, 2024

Description of changes

  • Add retry and http client plugins

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AndrewFossAWS AndrewFossAWS marked this pull request as ready for review February 22, 2024 22:45
Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Left a question & a comment. Also, nit: there're several swiftlint warnings that should be addressed.

config.retryStrategyOptions =
DefaultSDKRuntimeConfiguration<DefaultRetryStrategy, DefaultRetryErrorInfoProvider>
.defaultRetryStrategyOptions
}

if var config = clientConfiguration as? DefaultHttpClientConfiguration {
var httpClientConfiguration = DefaultSDKRuntimeConfiguration<DefaultRetryStrategy, DefaultRetryErrorInfoProvider>
Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand it, DefaultSDKRuntimeConfiguration (which is one of the old config structs) has not been refactored (e.g., refactor to conform to the new ClientConfiguration protocol, or delete and replace with the new SRA config) yet. Will the DefaultSDKRuntimeConfiguration struct used here be refactored down the line?

Copy link
Contributor Author

@AndrewFossAWS AndrewFossAWS Feb 26, 2024

Choose a reason for hiding this comment

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

Will the DefaultSDKRuntimeConfiguration struct used here be refactored down the line?

Yes. I will try to send out a PR later this week. I have refactored and included the changes in this PR.

@@ -81,19 +82,13 @@ open class HttpProtocolServiceClient(
writer.openBlock("return ClientBuilder<\$L>(defaultPlugins: [", "])", serviceSymbol.name) {

val defaultPlugins: MutableList<Plugin> = mutableListOf(DefaultClientPlugin())
val customPlugins: MutableList<Plugin> = mutableListOf()
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: What fell under customPlugins, and why is the codegen for it deleted now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There weren't any plugins that fell under custom plugins. It should only be default plugins.

@AndrewFossAWS AndrewFossAWS force-pushed the runtime-plugins branch 2 times, most recently from 555e17c to d1adea7 Compare February 27, 2024 01:05
Comment on lines -69 to +73
writer.write("let config = try \$L(\"\$L\", \"\$L\")", serviceConfig.typeName, serviceName, serviceSymbol.name)
writer.write("let config = try \$L()", serviceConfig.typeName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change 👍 . Are these set anywhere else right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope :)

@sichanyoo sichanyoo self-requested a review February 29, 2024 18:19
Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Just need swiftlint warnings (10) taken care of, should be good afterwards.

@sichanyoo sichanyoo self-requested a review March 1, 2024 18:22
@AndrewFossAWS AndrewFossAWS merged commit 189d48c into main Mar 1, 2024
12 checks passed
@AndrewFossAWS AndrewFossAWS deleted the runtime-plugins branch March 1, 2024 18:43
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.

3 participants