-
Notifications
You must be signed in to change notification settings - Fork 36
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
Substitute REST path or body parameters in Workflow Steps #525
Substitute REST path or body parameters in Workflow Steps #525
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #525 +/- ##
============================================
+ Coverage 71.91% 72.71% +0.79%
- Complexity 612 639 +27
============================================
Files 78 78
Lines 3201 3258 +57
Branches 246 255 +9
============================================
+ Hits 2302 2369 +67
+ Misses 787 777 -10
Partials 112 112 ☔ View full report in Codecov by Sentry. |
@YANG-DB FYI |
4f64879
to
c50b00f
Compare
Continuing the discussion here |
c50b00f
to
7a00506
Compare
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.
Overall looks good to me, just a small comment
src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java
Show resolved
Hide resolved
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.
Overall LGTM with few questions/comments
src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/WorkflowRequest.java
Show resolved
Hide resolved
In the description you highlight the changes for provision API and mention when provision=true on create. If we are creating a template without the provision parameter(false) then should we also allow users to have dynamic params? Additionally just so I understand correctly, technically a user can create this with create API and then when provisioning give the input to the params or give it during provisioning?
|
No, because the params are only substituted during provisioning, when processing the data in the Workflow Steps. They have no impact when we are not provisioning, as we are simply parsing and storing the template content.
Yes, classic example is the feature request issue. The template would include a step configuration with something like this (this exact syntax was from observability workflow RFC, our syntax is slightly different).
In this case we'd create the workflow with the "endpoint" field having a value of When we went to provision the workflow, if we passed Note that in our current code we couldn't provision a second time in this case, we'd have to "deprovision" first and I'll have to eventually address this before 2.13. We could then deprovision (TODO, not require this) and provision again passing |
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
7b63f78
to
098e75f
Compare
Yeah, generally I'm thinking with "fine grained provisioning" we could allow provisioning a "completed" workflow a second time, and do the "partial" deprovisioning by default as part of it. |
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.
LGTM! Thanks for patiently discussing comments
* Include params map in WorkflowRequest when provisioning Signed-off-by: Daniel Widdis <[email protected]> * Pass params to ProcessNode Signed-off-by: Daniel Widdis <[email protected]> * Pass params to WorkflowSteps Signed-off-by: Daniel Widdis <[email protected]> * Substitute params Signed-off-by: Daniel Widdis <[email protected]> * Add change log Signed-off-by: Daniel Widdis <[email protected]> * Improve param consuming checks, add coverage Signed-off-by: Daniel Widdis <[email protected]> * Allow specifying key-value pairs in body Signed-off-by: Daniel Widdis <[email protected]> * Update title in change log Signed-off-by: Daniel Widdis <[email protected]> * Refactor param and content map generation to a new method Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: Daniel Widdis <[email protected]> (cherry picked from commit 3019fb8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…eps (#536) Substitute REST path or body parameters in Workflow Steps (#525) * Include params map in WorkflowRequest when provisioning * Pass params to ProcessNode * Pass params to WorkflowSteps * Substitute params * Add change log * Improve param consuming checks, add coverage * Allow specifying key-value pairs in body * Update title in change log * Refactor param and content map generation to a new method --------- (cherry picked from commit 3019fb8) Signed-off-by: Daniel Widdis <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
When provisioning a workflow, additonal parameters can be passed on the REST path or in the body. For example:
or
When creating a workflow with provision=true the parameters are allowed on the path only, since the body already contains a template.
In this case, instances of the parameter in the template values (
user_params
,user_inputs
, orprevious_node_inputs
) will be replaced by its value, e.g.,will become
Issues Resolved
Part of #496 and #522.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.