From d9a58ebad4893d470aa40be7ceb20626d8803de6 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 30 Oct 2024 20:45:08 +0400 Subject: [PATCH 1/3] fix(util): tune aggregate outputs into one logic to not stop executionon none and copy --- src/if-run/util/aggregation-helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/if-run/util/aggregation-helper.ts b/src/if-run/util/aggregation-helper.ts index defa7172..6e9f4e07 100644 --- a/src/if-run/util/aggregation-helper.ts +++ b/src/if-run/util/aggregation-helper.ts @@ -39,12 +39,12 @@ export const aggregateOutputsIntoOne = ( const aggregationType = isTemporal ? 'component' : 'time'; if (aggregationParams[aggregationType] === 'none') { - return acc; + continue; } if (aggregationParams[aggregationType] === 'copy') { acc[metric] = output[metric]; - return acc; + continue; } acc[metric] = acc[metric] ?? 0; From 88ff03711ccdaa0d9c7d94ed689d3c1d451d7386 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 30 Oct 2024 20:51:40 +0400 Subject: [PATCH 2/3] fix(util): fix imports order in initialize --- src/if-run/lib/initialize.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/if-run/lib/initialize.ts b/src/if-run/lib/initialize.ts index 554b4f9c..5ae3787f 100644 --- a/src/if-run/lib/initialize.ts +++ b/src/if-run/lib/initialize.ts @@ -3,6 +3,8 @@ import * as path from 'node:path'; import {ERRORS} from '@grnsft/if-core/utils'; import {PluginInterface} from '@grnsft/if-core/types'; +import {storeAggregationMetrics} from './aggregate'; + import {logger} from '../../common/util/logger'; import {memoizedLog} from '../util/log-memoize'; import {pluginStorage} from '../util/plugin-storage'; @@ -11,7 +13,6 @@ import {CONFIG, STRINGS} from '../config'; import {Context, PluginOptions} from '../../common/types/manifest'; import {PluginStorageInterface} from '../types/plugin-storage'; -import {storeAggregationMetrics} from './aggregate'; const { PluginInitializationError, From 4b9d14ed6c518f071394125152ce73af584504f5 Mon Sep 17 00:00:00 2001 From: Narek Hovhannisyan Date: Wed, 30 Oct 2024 20:52:09 +0400 Subject: [PATCH 3/3] revert(lib): drop console.log from compute --- src/if-run/lib/compute.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/if-run/lib/compute.ts b/src/if-run/lib/compute.ts index 81bc768e..497d0b5e 100644 --- a/src/if-run/lib/compute.ts +++ b/src/if-run/lib/compute.ts @@ -184,7 +184,6 @@ const computeNode = async (node: Node, params: ComputeParams): Promise => { debugLogger.setExecutingPluginName(pluginName); outputStorage = await plugin.execute(outputStorage, nodeConfig); - console.log(outputStorage); debugLogger.setExecutingPluginName(); node.outputs = outputStorage;