Skip to content
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

Emit warning #942

Merged
merged 5 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/if-run/config/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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've using an old style manifest. Please update for phased execution. More information can be found here:
narekhovhannisyan marked this conversation as resolved.
Show resolved Hide resolved
https://if.greensoftware.foundation/major-concepts/manifest-file`,
/** Exhaust messages */
OUTPUT_REQUIRED:
'Output path is required, please make sure output is configured properly.',
Expand Down
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Object.keys(pipelineCopy).length has [ '0' ] if there isn't compute, observe or regroup in the manifest. You can test manifests/examples/builtins/sum/success.yml
by commenting compute and fixing the tabulation

logger.warn(EMPTY_PIPELINE);
}

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