-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: codegen visitor filtering bug #1049
Conversation
Quality Gate passedIssues Measures |
.sortedBy(KotlinIntegration::order) | ||
.toMutableList() |
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.
design suggestion: instead of making this a MutableList
, it might be better to have configuredIntegrations
and enabledIntegrations
(configuredIntegrations - disabledIntegrations
)
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.
example:
configuredIntegrations = ServiceLoader.load(KotlinIntegration::class.java, classLoader)
...
val enabledIntegrations = configuredIntegrations.mapNotNull { integration ->
if (integration.enabledForService(resolvedModel, settings)) {
println("Executing KotlinIntegration: ${integration.javaClass.name}")
resolvedModel = integration.preprocessModel(resolvedModel, settings)
integration
} else {
null
}
}
|
||
// Needs to be true due to the way integrations are filtered out before application and sigV4a customization. | ||
// See 'CodegenVisitor' & 'SigV4AsymmetricTraitCustomization' | ||
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean = true |
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.
note: There is one more of these hardcoded true
in UnsupportedSigningAlgorithmIntegration
, do you plan to change that one separately?
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.
Yes, that one is in aws-sdk-kotlin
. The change is in a pull request here: awslabs/aws-sdk-kotlin#1245
Issue #
N/A
The
CodegenVisitor
was filtering out integrations that would otherwise not be because of the filtering didn't take into account model pre-processing changes that would happenDescription of changes
Filtering was updated so Integrations take into account previous model pre-processing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.