From 6da714f76344cb1f768f1d0c1c01f2421136bfde Mon Sep 17 00:00:00 2001 From: Steffen Neubauer Date: Mon, 25 Nov 2024 11:30:29 +0100 Subject: [PATCH 1/2] perf: skip handler return value validation --- core/src/router/base.ts | 11 ++++++----- core/src/router/module.ts | 9 +++++---- core/src/router/provider.ts | 5 +++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/router/base.ts b/core/src/router/base.ts index 9dfc7b2918..4e58a652d8 100644 --- a/core/src/router/base.ts +++ b/core/src/router/base.ts @@ -362,7 +362,7 @@ export abstract class BaseActionRouter extends BaseRouter handler: GetActionTypeHandler[T], any> ) { const pluginName = plugin.name - const schema = this.handlerDescriptions[handlerType].resultSchema + // const schema = this.handlerDescriptions[handlerType].resultSchema // Wrap the handler with identifying attributes const wrapped = Object.assign( @@ -375,10 +375,11 @@ export abstract class BaseActionRouter extends BaseRouter )} handler on ${pluginName} provider. Called with ${args.length} arguments.`, }) } - const kind = this.kind - return validateSchema(result, schema, { - context: `${String(handlerType)} handler output from provider ${pluginName} for ${kind} type ${actionType}`, - }) + // const kind = this.kind + // return validateSchema(result, schema, { + // context: `${String(handlerType)} handler output from provider ${pluginName} for ${kind} type ${actionType}`, + // }) + return result })), { handlerType, pluginName, actionType } ) diff --git a/core/src/router/module.ts b/core/src/router/module.ts index 6ad5fbef6d..3dc07d21d1 100644 --- a/core/src/router/module.ts +++ b/core/src/router/module.ts @@ -169,7 +169,7 @@ export class ModuleRouter extends BaseRouter { handler: ModuleActionHandlers[T] ) { const pluginName = plugin.name - const schema = this.moduleHandlerDescriptions[handlerType].resultSchema + // const schema = this.moduleHandlerDescriptions[handlerType].resultSchema // Wrap the handler with identifying attributes const wrapped = Object.assign( @@ -183,9 +183,10 @@ export class ModuleRouter extends BaseRouter { message: `Got empty response from ${moduleType}.${handlerType} handler (called with ${args.length} args) on ${pluginName} provider.`, }) } - return validateSchema(result, schema, { - context: `${handlerType} handler output from provider ${pluginName} for module type ${moduleType} `, - }) + // return validateSchema(result, schema, { + // context: `${handlerType} handler output from provider ${pluginName} for module type ${moduleType} `, + // }) + return result }), { handlerType, pluginName, moduleType, wrapped: handler } ) diff --git a/core/src/router/provider.ts b/core/src/router/provider.ts index 62e4874c04..35ba70d1a9 100644 --- a/core/src/router/provider.ts +++ b/core/src/router/provider.ts @@ -241,7 +241,7 @@ export class ProviderRouter extends BaseRouter { handler: ProviderHandlers[T] ) { const pluginName = plugin.name - const schema = this.pluginHandlerDescriptions[handlerType].resultSchema + // const schema = this.pluginHandlerDescriptions[handlerType].resultSchema // Wrap the handler with identifying attributes const wrapped: WrappedPluginHandlers[T] = Object.assign( @@ -255,7 +255,8 @@ export class ProviderRouter extends BaseRouter { message: `Got empty response from ${handlerType} handler on ${pluginName} provider. Called with ${args.length} args.`, }) } - return validateSchema(result, schema, { context: `${handlerType} output from plugin ${pluginName}` }) + // return validateSchema(result, schema, { context: `${handlerType} output from plugin ${pluginName}` }) + return result }, { handlerType, pluginName } ) as WrappedPluginHandlers[T] From 3f61764069906cff03d16be1130be33809df609a Mon Sep 17 00:00:00 2001 From: Vladimir Vagaytsev <10628074+vvagaytsev@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:21:43 +0100 Subject: [PATCH 2/2] test: fix assertions --- core/test/integ/src/plugins/kubernetes/helm/config.ts | 1 - core/test/integ/src/plugins/kubernetes/kubernetes-type/config.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/core/test/integ/src/plugins/kubernetes/helm/config.ts b/core/test/integ/src/plugins/kubernetes/helm/config.ts index f98233d3f1..912c5ae778 100644 --- a/core/test/integ/src/plugins/kubernetes/helm/config.ts +++ b/core/test/integ/src/plugins/kubernetes/helm/config.ts @@ -122,7 +122,6 @@ describe("configureHelmModule", () => { dependencies: [], disabled: false, sourceModuleName: "api-image", - timeout: DEFAULT_DEPLOY_TIMEOUT_SEC, spec: expectedSpec, }, ], diff --git a/core/test/integ/src/plugins/kubernetes/kubernetes-type/config.ts b/core/test/integ/src/plugins/kubernetes/kubernetes-type/config.ts index 017a84fbea..e73402cccf 100644 --- a/core/test/integ/src/plugins/kubernetes/kubernetes-type/config.ts +++ b/core/test/integ/src/plugins/kubernetes/kubernetes-type/config.ts @@ -133,7 +133,6 @@ describe("configureKubernetesModule", () => { tasks: [taskSpec], timeout: 300, }, - timeout: DEFAULT_DEPLOY_TIMEOUT_SEC, }, ])