[PLUGIN-1792] Enable macro for plugin config script#26
Merged
psainics merged 1 commit intodata-integrations:developfrom Jul 23, 2024
Merged
[PLUGIN-1792] Enable macro for plugin config script#26psainics merged 1 commit intodata-integrations:developfrom
psainics merged 1 commit intodata-integrations:developfrom
Conversation
c154e08 to
67af410
Compare
| // try evaluating the script to fail application creation | ||
| // if the script is invalid (only possible for interpreted mode) | ||
| if (config.executionMode.equalsIgnoreCase(EXECUTION_MODE_INTERPRETED)) { | ||
| if (config.executionMode != null && config.executionMode.equalsIgnoreCase(EXECUTION_MODE_INTERPRETED)) { |
There was a problem hiding this comment.
please add a check here that script is not macro before we try to compile it in JythonPythonExecutor
Contributor
Author
There was a problem hiding this comment.
if (config.executionMode != null &&
!config.containsMacro(Config.SCRIPT) &&
config.executionMode.equalsIgnoreCase(EXECUTION_MODE_INTERPRETED)) 67af410 to
750f3cb
Compare
Contributor
Author
Is there api for testing macro ? |
| // try evaluating the script to fail application creation | ||
| // if the script is invalid (only possible for interpreted mode) | ||
| if (config.executionMode.equalsIgnoreCase(EXECUTION_MODE_INTERPRETED)) { | ||
| if (config.executionMode != null && |
There was a problem hiding this comment.
!containsMacro(config.executionMode)
We should also throw validation exception if executionMode is null:
private static final String EXECUTION_MODE = "executionMode";
if (!containsMacro(config.EXECUTION_MODE) && Strings.isNullOrEmpty(config.executionMode)) {
.....
return;
}
if (!config.containsMacro(config.EXECUTION_MODE) && !config.containsMacro(Config.SCRIPT) &&
config.executionMode.equalsIgnoreCase(EXECUTION_MODE_INTERPRETED)) {
try {
new JythonPythonExecutor(config).initialize(null);
} catch (IOException | InterruptedException e) {
collector.addFailure("Could not compile script: " + e.getMessage(), null)
.withStacktrace(e.getStackTrace()).withConfigProperty(Config.SCRIPT);
}
}
750f3cb to
f83013d
Compare
itsankit-google
approved these changes
Jul 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable macro for plugin config script
Jira : PLUGIN-1792
Description
This PR makes the plugin config
scripta macro.Code change
PythonEvaluator.java