Unverified Commit 12338ad5 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Change the orchestrator feature gate into a quad state (#2657)

## Motivation and Context
So far we have been testing with the orchestrator on or off, with "on"
meaning that both the middleware and orchestrator implementations exist,
and you have to opt into the orchestrator via a `send_v2` function call
(instead of `send`). This approach makes it difficult to test against
the orchestrator exclusively, and also test the existing integration
tests with the orchestrator implementation.

This PR changes `enableNewSmithyRuntime` into a quad-state with:
- middleware
- both middleware and orchestrator, defaulting to middleware
- both middleware and orchestrator, defaulting to orchestrator
- orchestrator

This allows for generating a client with the orchestrator exclusively,
or generating both and defaulting to the orchestrator, to reduce testing
friction.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 65e376d8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ val allCodegenTests = listOf(
            ,
            "codegen": {
                "includeFluentClient": false,
                "enableNewCrateOrganizationScheme": true
            },
            "customizationConfig": {
                "awsSdk": {
@@ -63,7 +62,6 @@ val allCodegenTests = listOf(
            ,
            "codegen": {
                "includeFluentClient": false,
                "enableNewCrateOrganizationScheme": true
            },
            "customizationConfig": {
                "awsSdk": {
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class CredentialsProviderDecorator : ClientCodegenDecorator {
        codegenContext: ClientCodegenContext,
        baseCustomizations: List<ServiceRuntimePluginCustomization>,
    ): List<ServiceRuntimePluginCustomization> =
        baseCustomizations.letIf(codegenContext.settings.codegenConfig.enableNewSmithyRuntime) {
        baseCustomizations.letIf(codegenContext.smithyRuntimeMode.generateOrchestrator) {
            it + listOf(CredentialsIdentityResolverRegistration(codegenContext))
        }

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class HttpConnectorDecorator : ClientCodegenDecorator {
        codegenContext: ClientCodegenContext,
        baseCustomizations: List<ConfigCustomization>,
    ): List<ConfigCustomization> =
        baseCustomizations.letIf(!codegenContext.settings.codegenConfig.enableNewSmithyRuntime) {
        baseCustomizations.letIf(codegenContext.smithyRuntimeMode.exclusivelyGenerateMiddleware) {
            it + HttpConnectorConfigCustomization(codegenContext)
        }
}
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ class HttpRequestChecksumDecorator : ClientCodegenDecorator {

    // TODO(enableNewSmithyRuntime): Implement checksumming via interceptor and delete this decorator
    private fun applies(codegenContext: ClientCodegenContext): Boolean =
        !codegenContext.settings.codegenConfig.enableNewSmithyRuntime
        codegenContext.smithyRuntimeMode.exclusivelyGenerateMiddleware

    override fun operationCustomizations(
        codegenContext: ClientCodegenContext,
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class HttpResponseChecksumDecorator : ClientCodegenDecorator {

    // TODO(enableNewSmithyRuntime): Implement checksumming via interceptor and delete this decorator
    private fun applies(codegenContext: ClientCodegenContext, operationShape: OperationShape): Boolean =
        !codegenContext.settings.codegenConfig.enableNewSmithyRuntime && operationShape.outputShape != ShapeId.from("com.amazonaws.s3#GetObjectOutput")
        codegenContext.smithyRuntimeMode.generateMiddleware && operationShape.outputShape != ShapeId.from("com.amazonaws.s3#GetObjectOutput")

    override fun operationCustomizations(
        codegenContext: ClientCodegenContext,
Loading