Skip to content
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

[Backport 2.x] Updates exception handling with FlowFrameworkException AND adds dryrun param to Create Workflow #144

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport c547658 from #137.

…n param to Create Workflow (#137)

* Simplifying Template format, removing operations, resources created, user outputs

Signed-off-by: Joshua Palis <[email protected]>

* Initial commit, modifies use case template to seperate workflow inputs into previous_node_inputs and user_inputs, adds graph validation after topologically sorting a workflow into a list of ProcessNode

Signed-off-by: Joshua Palis <[email protected]>

* Adding tests

Signed-off-by: Joshua Palis <[email protected]>

* Adding validate graph test

Signed-off-by: Joshua Palis <[email protected]>

* Addressing PR comments, moving sorting/validating prior to executing async, adding success test case for graph validation

Signed-off-by: Joshua Palis <[email protected]>

* Adding javadocs

Signed-off-by: Joshua Palis <[email protected]>

* Moving validation prior to updating workflow state to provisioning

Signed-off-by: Joshua Palis <[email protected]>

* Addressing PR comments Part 1

Signed-off-by: Joshua Palis <[email protected]>

* Addressing PR comments Part 2 : Moving field names to common value class and using constants

Signed-off-by: Joshua Palis <[email protected]>

* Adding definition for noop workflow step

Signed-off-by: Joshua Palis <[email protected]>

* Addressing PR comments Part 3

Signed-off-by: Joshua Palis <[email protected]>

* Modifies rest actions to throw flow framework exceptions, transport actions to create flow framework exceptions

Signed-off-by: Joshua Palis <[email protected]>

* Fixing credentials field in workflow-step json

Signed-off-by: Joshua Palis <[email protected]>

* Fixing test

Signed-off-by: Joshua Palis <[email protected]>

* Using ExceptionsHelper.status() to determine the rest status code based on exceptions thrown by the transport client

Signed-off-by: Joshua Palis <[email protected]>

* Adding dryrun param to create workflow API, allows for validation before saving

Signed-off-by: Joshua Palis <[email protected]>

* concatenating log message with exception message on failure

Signed-off-by: Joshua Palis <[email protected]>

* Adding dry run test

Signed-off-by: Joshua Palis <[email protected]>

* Simplifying FlowFrameworkException::toXContent

Signed-off-by: Joshua Palis <[email protected]>

---------

Signed-off-by: Joshua Palis <[email protected]>
(cherry picked from commit c547658)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #144 (6a0c899) into 2.x (1e3c399) will decrease coverage by 1.97%.
The diff coverage is 31.20%.

@@             Coverage Diff              @@
##                2.x     #144      +/-   ##
============================================
- Coverage     69.05%   67.09%   -1.97%     
- Complexity      302      311       +9     
============================================
  Files            37       37              
  Lines          1393     1468      +75     
  Branches        132      139       +7     
============================================
+ Hits            962      985      +23     
- Misses          386      434      +48     
- Partials         45       49       +4     
Files Coverage Δ
...g/opensearch/flowframework/common/CommonValue.java 100.00% <ø> (ø)
...lowframework/exception/FlowFrameworkException.java 45.45% <100.00%> (+5.45%) ⬆️
...earch/flowframework/transport/WorkflowRequest.java 100.00% <100.00%> (ø)
...a/org/opensearch/flowframework/model/Template.java 89.36% <0.00%> (ø)
.../flowframework/workflow/WorkflowProcessSorter.java 97.82% <87.50%> (+0.02%) ⬆️
...rk/transport/ProvisionWorkflowTransportAction.java 49.27% <33.33%> (ø)
...lowframework/rest/RestProvisionWorkflowAction.java 48.00% <35.00%> (-24.73%) ⬇️
...h/flowframework/rest/RestCreateWorkflowAction.java 44.00% <30.00%> (-22.67%) ⬇️
...ework/transport/CreateWorkflowTransportAction.java 45.71% <29.62%> (-9.61%) ⬇️
...framework/indices/FlowFrameworkIndicesHandler.java 29.18% <2.85%> (-2.39%) ⬇️

@joshpalis joshpalis merged commit 80efe24 into 2.x Nov 3, 2023
14 of 15 checks passed
@github-actions github-actions bot deleted the backport/backport-137-to-2.x branch November 3, 2023 16:06
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.

1 participant