-
Notifications
You must be signed in to change notification settings - Fork 49
[Fix #936] Adding Python implementation #1027
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: fjtirado <ftirados@redhat.com>
7d74e17 to
78b8d96
Compare
7ff3e23 to
8b57ec9
Compare
| private void addArg(List<String> list, String name, Object value) { | ||
| if (value instanceof Boolean bool) { | ||
| if (bool) { | ||
| list.add("--" + name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the way https://github.com/serverlessworkflow/catalog/blob/main/functions/log/1.0.0/function.yaml is implemented, params has to be prefixed with --
Notice that this impose restriction in other python scripts to be invoked, which has to follow the same structure.
Also this is assuming that, for boolean parameters, all python function will use store_true
This kind of conventions are one of the reasons why I feel we should change the spec to redefine scripts as calling embedded named parameters functions (which are supported both by JS and Python)
Signed-off-by: fjtirado <ftirados@redhat.com>
| <module>container</module> | ||
| <module>test</module> | ||
| <module>script-js</module> | ||
| <module>python</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to follow script-python naming to follow an standard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
mcruzdev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, I just left a comment about the module name.
| WorkflowContext workflowContext, | ||
| TaskContext taskContext, | ||
| WorkflowModel model) { | ||
| ProcessBuilder builder = new ProcessBuilder("python", "-c", scriptContext.code()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just a question, why we are using a process instead a embedded python like we did in Javascript? I mean, what is the motivation?
Fix #936