Skip to content

chore: update the DryRunService to improve error messages #4001

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viictoo
Copy link
Contributor

@viictoo viictoo commented May 6, 2025

  • 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.

EXT-610

Open Issues
Will require validation and additional testing for variants


This PR enhances error messaging in the CLI's DryRunService by differentiating between script variants within the same integration versus scripts across different integrations. When a script name conflict is detected, users now receive more specific guidance on whether to use '--variant' or '--integration-id' flags.

This summary was automatically generated by @propel-code-bot

…le 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.
Copy link

linear bot commented May 6, 2025

Copy link

cubic-dev-ai bot commented May 6, 2025

Your mrge subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use mrge.

@viictoo viictoo requested a review from a team May 6, 2025 17:54
Comment on lines 182 to 184
scriptInfo = script;
foundInProviderConfigKey = providerConfigKey;
providerConfigKey = integration.providerConfigKey;

Choose a reason for hiding this comment

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

[DataTypeCheck]

There's a potential issue with the assignment of providerConfigKey. You're assigning providerConfigKey to foundInProviderConfigKey and then reassigning providerConfigKey immediately after. This could lead to both variables having the same value by the next iteration, which might cause incorrect comparisons in the if (foundInProviderConfigKey === providerConfigKey) condition.

Consider storing the original value before reassigning:

scriptInfo = script;
foundInProviderConfigKey = providerConfigKey;
providerConfigKey = integration.providerConfigKey;

`Script "${syncName}" exists in multiple integrations (${foundInProviderConfigKey}, ${providerConfigKey}). Please specify which integration to use with "--integration-id"`
)
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure I follow the logic. I don't think you can detect if variants exist unless querying the API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, wasn't too sure about this one.
if we cant distinguish between the two should it just be an update to the existing error message to include variant?

Multiple integrations contain a script named "${syncName}". Please use "--integration-id or --variant to specify"

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe I don't really understand what the problem is with variants. Based on the code above it looks like if a variant is not specified the CLI default to the base one so I am not sure I understand the issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me dig into this further get what the root cause of this request was

@bodinsamuel bodinsamuel marked this pull request as draft May 13, 2025 08:53
@TBonnin TBonnin force-pushed the master branch 3 times, most recently from f519537 to 87a5092 Compare May 27, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants