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

Bump awsSdk from 2.26.25 to 2.28.7 #4909

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apache-commons-collections = "4.4"
apache-commons-io = "2.16.0"
assertJ = "3.26.3"
# match with <root>/settings.gradle.kts
awsSdk = "2.26.25"
awsSdk = "2.28.7"
commonmark = "0.22.0"
detekt = "1.23.6"
intellijExt = "1.1.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
import software.amazon.awssdk.core.interceptor.Context
import software.amazon.awssdk.core.interceptor.ExecutionAttributes
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute
import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyUserAgentStage
import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyUserAgentStage.HEADER_USER_AGENT
import software.amazon.awssdk.core.internal.useragent.SdkClientUserAgentProperties
import software.amazon.awssdk.core.internal.useragent.SdkUserAgentBuilder
import software.amazon.awssdk.core.internal.useragent.UserAgentConstant
import software.amazon.awssdk.core.retry.RetryMode
import software.amazon.awssdk.core.util.SystemUserAgent
import software.amazon.awssdk.http.SdkHttpClient
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.utils.SdkAutoCloseable
Expand Down Expand Up @@ -205,18 +207,22 @@
}

val clientType = executionAttributes.getAttribute(AwsExecutionAttribute.CLIENT_TYPE)
val sdkClient = executionAttributes.getAttribute(SdkInternalExecutionAttribute.SDK_CLIENT)
val serviceClientConfiguration = sdkClient.serviceClientConfiguration()
val retryMode = serviceClientConfiguration.overrideConfiguration().retryMode().orElse(RetryMode.defaultRetryMode())
val toolkitUserAgent = userAgent()

val requestUserAgent = ApplyUserAgentStage.resolveClientUserAgent(
toolkitUserAgent,
null,
clientType,
null,
null,
retryMode.toString().lowercase()
// no obvious clean way to do this and multiple people have wasted a lot of time here
// what we really want is to have a dynamic SdkAdvancedClientOption#USER_AGENT_PREFIX,
// but SDK only allows static values to be set on the client
val requestUserAgent = "$toolkitUserAgent " + SdkUserAgentBuilder.buildClientUserAgentString(
Copy link
Contributor

Choose a reason for hiding this comment

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

double check comma or space as separator

SystemUserAgent.getOrCreate(),
SdkClientUserAgentProperties().apply {

Check warning on line 217 in plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt

View check run for this annotation

Codecov / codecov/patch

plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt#L215-L217

Added lines #L215 - L217 were not covered by tests
// assume default because it is very complicated to resolve
putProperty(UserAgentConstant.RETRY_MODE, "standard")

Check warning on line 219 in plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt

View check run for this annotation

Codecov / codecov/patch

plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt#L219

Added line #L219 was not covered by tests

putProperty(UserAgentConstant.IO, clientType.name.lowercase())

Check warning on line 221 in plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt

View check run for this annotation

Codecov / codecov/patch

plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt#L221

Added line #L221 was not covered by tests

// can probably figure it out, but SDK default resolves as UNKNOWN anyways without our interceptor
putProperty(UserAgentConstant.HTTP, "UNKNOWN")
}

Check warning on line 225 in plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt

View check run for this annotation

Codecov / codecov/patch

plugins/core/core/src/migration/software/aws/toolkits/core/ToolkitClientManager.kt#L224-L225

Added lines #L224 - L225 were not covered by tests
)

val overrideConfiguration = request.overrideConfiguration()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ buildscript {
// match with version catalog, s3-build-cache has silent classpath conflict with codegen task
// also since this is a settings plugin, we can't use a version catalog
dependencies {
classpath(platform("software.amazon.awssdk:bom:2.26.25"))
classpath(platform("software.amazon.awssdk:bom:2.28.7"))
}
}

Expand Down
Loading