diff --git a/src/if-run/config/strings.ts b/src/if-run/config/strings.ts index da86657b8..6231e9ff7 100644 --- a/src/if-run/config/strings.ts +++ b/src/if-run/config/strings.ts @@ -57,6 +57,8 @@ Note that for the '--output' option you also need to define the output type in y PREPARING_OUTPUT_DATA: 'Preparing output data', EXPORTING_TO_YAML_FILE: (savepath: string) => `Exporting to yaml file: ${savepath}`, + EMPTY_PIPELINE: `You're using an old style manifest. Please update for phased execution. More information can be found here: +https://if.greensoftware.foundation/major-concepts/manifest-file`, /** Exhaust messages */ OUTPUT_REQUIRED: 'Output path is required, please make sure output is configured properly.', diff --git a/src/if-run/lib/compute.ts b/src/if-run/lib/compute.ts index 41a153448..710e15373 100644 --- a/src/if-run/lib/compute.ts +++ b/src/if-run/lib/compute.ts @@ -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. @@ -77,6 +78,16 @@ const computeNode = async (node: Node, params: ComputeParams): Promise => { inputStorage = mergeDefaults(inputStorage, defaults); const pipelineCopy = structuredClone(pipeline) || {}; + /** Checks if pipeline is not an array or empty object. */ + if ( + Array.isArray(pipelineCopy) || + (typeof pipelineCopy === 'object' && + pipelineCopy !== null && + Object.keys(pipelineCopy).length === 0) + ) { + logger.warn(EMPTY_PIPELINE); + } + /** * If iteration is on observe pipeline, then executes observe plugins and sets the inputs value. */