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

Add param to delete workflow API to clear status even if resources exist #719

Merged
merged 2 commits into from
May 31, 2024

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented May 29, 2024

Description

Adds an optional clear_status param to the delete workflow API (defaulting false).

If present, overrides the "do resources exist" check and permits deleting the workflow state as long as provisioning is not IN_PROGRESS

Please also review Documentation PR: opensearch-project/documentation-website#7268

Issues Resolved

Resolves #692

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.

@github-actions github-actions bot added the backport 2.x backport PRs to 2.x branch label May 29, 2024
Copy link

codecov bot commented May 29, 2024

Codecov Report

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

Project coverage is 74.33%. Comparing base (4ee2171) to head (641ab33).

Files Patch % Lines
...ork/transport/GetWorkflowStateTransportAction.java 0.00% 2 Missing ⚠️
...h/flowframework/rest/RestDeleteWorkflowAction.java 50.00% 1 Missing ⚠️
...flowframework/rest/RestGetWorkflowStateAction.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #719      +/-   ##
============================================
+ Coverage     74.32%   74.33%   +0.01%     
- Complexity      741      742       +1     
============================================
  Files            84       84              
  Lines          3805     3807       +2     
  Branches        331      332       +1     
============================================
+ Hits           2828     2830       +2     
  Misses          823      823              
  Partials        154      154              

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

@dbwiddis dbwiddis changed the title Add clear_status param to delete workflow state even if resources exist Add param to delete workflow API to clear status even if resources exist May 29, 2024
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Copy link
Member

@joshpalis joshpalis left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just had a question

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for addressing this issue

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis merged commit 4ea348a into opensearch-project:main May 31, 2024
30 of 32 checks passed
@dbwiddis dbwiddis deleted the clear-status branch May 31, 2024 01:00
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 31, 2024
…ist (#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 4ea348a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis pushed a commit that referenced this pull request May 31, 2024
…if resources exist (#723)

Add param to delete workflow API to clear status even if resources exist (#719)


(cherry picked from commit 4ea348a)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
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>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 1, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
…ist (opensearch-project#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
dbwiddis added a commit that referenced this pull request Jun 3, 2024
…ith new method (#721)

* Add user mapping to Workflow State index (#705)

* Add user mapping to Workflow State index

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Increment schema version

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added a new parse util method to avoid repetition / refactored code with new method

Signed-off-by: martinpkr <devilmarti@abv.bg>

* refactored method name and added unit test

Signed-off-by: martinpkr <devilmarti@abv.bg>

* made method use generics + added test

Signed-off-by: martinpkr <devilmarti@abv.bg>

* fixed javadoc

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Incorporating parseIfExist method into ReindexStep class

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Add param to delete workflow API to clear status even if resources exist (#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* refactored method to use parseBoolean and parseFloat methods

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Adding a missing param in javaDoc

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Add param to delete workflow API to clear status even if resources exist (#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added a chagelog entry

Signed-off-by: martinpkr <devilmarti@abv.bg>

* fixed failing spotless check

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* removed unnecessary changelog info

Signed-off-by: martinpkr <devilmarti@abv.bg>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 3, 2024
…ith new method (#721)

* Add user mapping to Workflow State index (#705)

* Add user mapping to Workflow State index

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Increment schema version

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added a new parse util method to avoid repetition / refactored code with new method

Signed-off-by: martinpkr <devilmarti@abv.bg>

* refactored method name and added unit test

Signed-off-by: martinpkr <devilmarti@abv.bg>

* made method use generics + added test

Signed-off-by: martinpkr <devilmarti@abv.bg>

* fixed javadoc

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Incorporating parseIfExist method into ReindexStep class

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Add param to delete workflow API to clear status even if resources exist (#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* refactored method to use parseBoolean and parseFloat methods

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Adding a missing param in javaDoc

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Add param to delete workflow API to clear status even if resources exist (#719)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added a chagelog entry

Signed-off-by: martinpkr <devilmarti@abv.bg>

* fixed failing spotless check

Signed-off-by: martinpkr <devilmarti@abv.bg>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed PR comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

* Minor comments

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>

---------

Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>

* removed unnecessary changelog info

Signed-off-by: martinpkr <devilmarti@abv.bg>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
(cherry picked from commit 13b32f1)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
owaiskazi19 added a commit that referenced this pull request Jun 3, 2024
…factored code with new method (#728)

Added a new parse util method to avoid repetition / refactored code with new method (#721)

* Add user mapping to Workflow State index (#705)

* Add user mapping to Workflow State index



* Increment schema version



---------




* Added a new parse util method to avoid repetition / refactored code with new method



* refactored method name and added unit test



* made method use generics + added test



* fixed javadoc



* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params



* Addressed PR comments



* Changed request per second to Float



* Addressed string array for source indices and removed state index entry



* Minor comments



---------




* Incorporating parseIfExist method into ReindexStep class



* Add param to delete workflow API to clear status even if resources exist (#719)




* refactored method to use parseBoolean and parseFloat methods



* Adding a missing param in javaDoc



* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params



* Addressed PR comments



* Changed request per second to Float



* Addressed string array for source indices and removed state index entry



* Minor comments



---------




* Add param to delete workflow API to clear status even if resources exist (#719)




* Added a chagelog entry



* fixed failing spotless check



* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params



* Addressed PR comments



* Changed request per second to Float



* Addressed string array for source indices and removed state index entry



* Minor comments



---------




* removed unnecessary changelog info



---------






(cherry picked from commit 13b32f1)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: martinpkr <devilmarti@abv.bg>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
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>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
Co-authored-by: Owais Kazi <owaiskazi19@gmail.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.

[FEATURE] Add a parameter to force deletion of workflow state document when a template is deleted
3 participants