From 7648f64489424c4d53f10568ed99b03903455758 Mon Sep 17 00:00:00 2001 From: Victor Lang'at Date: Tue, 6 May 2025 20:51:43 +0300 Subject: [PATCH] chore: update the DryRunService to improve error messages when multiple scripts with the same name are found across integrations. - Added logic to differentiate between variants within the same integration and scripts across different integrations, prompting users to specify the correct variant or integration ID as needed. --- packages/cli/lib/services/dryrun.service.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/cli/lib/services/dryrun.service.ts b/packages/cli/lib/services/dryrun.service.ts index c1127fe6897..c5c5c9da9f8 100644 --- a/packages/cli/lib/services/dryrun.service.ts +++ b/packages/cli/lib/services/dryrun.service.ts @@ -157,15 +157,30 @@ export class DryRunService { } // Priority for syncs and actions + let foundInProviderConfigKey: string | undefined; for (const script of [...integration.syncs, ...integration.actions]) { if (script.name !== syncName) { continue; } if (scriptInfo) { - console.log(chalk.red(`Multiple integrations contain a script named "${syncName}". Please use "--integration-id"`)); + // TODO: Confirm: If exists another script with the same name in the same integration, it's a variant issue + if (foundInProviderConfigKey === providerConfigKey) { + console.log( + chalk.red( + `Multiple variants of script "${syncName}" found in integration "${providerConfigKey}". Please specify which variant to use with "--variant"` + ) + ); + } else { + console.log( + chalk.red( + `Script "${syncName}" exists in multiple integrations (${foundInProviderConfigKey}, ${providerConfigKey}). Please specify which integration to use with "--integration-id"` + ) + ); + } return; } scriptInfo = script; + foundInProviderConfigKey = providerConfigKey; providerConfigKey = integration.providerConfigKey; }