Skip to content

Commit

Permalink
feat(lib): add empty pipeline message
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Aug 7, 2024
1 parent d673151 commit 4f6dc3d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/if-run/lib/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {addExplainData} from './explain';

import {mergeObjects} from '../util/helpers';
import {debugLogger} from '../../common/util/debug-logger';
import {logger} from '../../common/util/logger';

import {STRINGS} from '../config/strings';

import {ComputeParams, Node, PhasedPipeline} from '../types/compute';
import {isExecute} from '../types/interface';

const {MERGING_DEFAULTS_WITH_INPUT_DATA} = STRINGS;
const {MERGING_DEFAULTS_WITH_INPUT_DATA, EMPTY_PIPELINE} = STRINGS;

/**
* Traverses all child nodes based on children grouping.
Expand Down Expand Up @@ -77,6 +78,10 @@ const computeNode = async (node: Node, params: ComputeParams): Promise<any> => {
inputStorage = mergeDefaults(inputStorage, defaults);
const pipelineCopy = structuredClone(pipeline) || {};

if (Object.keys(pipelineCopy).length === 0) {
logger.warn(EMPTY_PIPELINE);
}

/**
* If iteration is on observe pipeline, then executes observe plugins and sets the inputs value.
*/
Expand Down

0 comments on commit 4f6dc3d

Please sign in to comment.