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

Throw the correct error message in status API for WorkflowSteps #676

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

owaiskazi19
Copy link
Member

Description

Throw the correct error message in status API for WorkflowSteps. As called out in the issue, exceptions added in getException method are safe exceptions to be shown in status API.

Few examples:

{
    "workflow_id": "y_KgDY8BnN13dc10B7Lw",
    "error": "Missing credential during step create_claude_connector, restStatus: BAD_REQUEST",
    "state": "FAILED"
}
{
    "workflow_id": "MrGqDY8BlF2RpBCvbloe",
    "error": "No processor type exists with name [text_embeddinsg] during step create_ingest_pipeline, restStatus: BAD_REQUEST",
    "state": "FAILED"
}

Issues Resolved

Resolves #670

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.

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 57.57576% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 72.64%. Comparing base (757eaaf) to head (2a77791).

Files Patch % Lines
...flowframework/exception/WorkflowStepException.java 50.00% 0 Missing and 2 partials ⚠️
...rk/transport/ProvisionWorkflowTransportAction.java 0.00% 1 Missing ⚠️
...framework/workflow/AbstractCreatePipelineStep.java 50.00% 0 Missing and 1 partial ⚠️
...ework/workflow/AbstractRegisterLocalModelStep.java 75.00% 0 Missing and 1 partial ⚠️
...ch/flowframework/workflow/CreateConnectorStep.java 50.00% 0 Missing and 1 partial ⚠️
...search/flowframework/workflow/CreateIndexStep.java 75.00% 0 Missing and 1 partial ⚠️
...search/flowframework/workflow/DeleteAgentStep.java 50.00% 0 Missing and 1 partial ⚠️
...ch/flowframework/workflow/DeleteConnectorStep.java 50.00% 0 Missing and 1 partial ⚠️
...search/flowframework/workflow/DeleteModelStep.java 50.00% 0 Missing and 1 partial ⚠️
...search/flowframework/workflow/DeployModelStep.java 50.00% 0 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #676      +/-   ##
============================================
- Coverage     72.88%   72.64%   -0.25%     
- Complexity      694      697       +3     
============================================
  Files            82       82              
  Lines          3589     3605      +16     
  Branches        296      309      +13     
============================================
+ Hits           2616     2619       +3     
  Misses          841      841              
- Partials        132      145      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amitgalitz
Copy link
Member

Can you test case of how exception looks like when there is unsafe exception like remotetransportexception, when you deploy multiple models at the same time.

Also can we also add this to create index step, along with changing CreateIndexStep line here to workflowstepexception https://github.com/opensearch-project/flow-framework/blob/main/src/main/java/org/opensearch/flowframework/workflow/CreateIndexStep.java#L142

@owaiskazi19
Copy link
Member Author

Can you test case of how exception looks like when there is unsafe exception like remotetransportexception, when you deploy multiple models at the same time.

Added 2 tests for CreateIndex and RegisterRemoteStep

Also can we also add this to create index step, along with changing CreateIndexStep line here to workflowstepexception https://github.com/opensearch-project/flow-framework/blob/main/src/main/java/org/opensearch/flowframework/workflow/CreateIndexStep.java#L142

Done

…ect#680)

* Hide user and credential field from search response

Signed-off-by: Owais Kazi <[email protected]>

* Hid the user field for Get API as well

Signed-off-by: Owais Kazi <[email protected]>

* Addressed PR Comments

Signed-off-by: Owais Kazi <[email protected]>

* Added user permission and new tests

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
Signed-off-by: Owais Kazi <[email protected]>
Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Owais Kazi <[email protected]>
@dbwiddis dbwiddis merged commit 56e4a78 into opensearch-project:main Apr 26, 2024
31 of 32 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 26, 2024
* Hides user and credential field from search response (#680)

* Hide user and credential field from search response

Signed-off-by: Owais Kazi <[email protected]>

* Hid the user field for Get API as well

Signed-off-by: Owais Kazi <[email protected]>

* Addressed PR Comments

Signed-off-by: Owais Kazi <[email protected]>

* Added user permission and new tests

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>

* Addressed PR Comments

Signed-off-by: Owais Kazi <[email protected]>

* Fixed failing test

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit 56e4a78)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis pushed a commit that referenced this pull request Apr 26, 2024
…flowSteps (#683)

Throw the correct error message in status API for WorkflowSteps (#676)

* Hides user and credential field from search response (#680)

* Hide user and credential field from search response



* Hid the user field for Get API as well



* Addressed PR Comments



* Added user permission and new tests



---------



* Addressed PR Comments



* Fixed failing test



---------


(cherry picked from commit 56e4a78)

Signed-off-by: Owais Kazi <[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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport PRs to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Some error messages are being hidden during provisioning
3 participants