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 user mapping to Workflow State index #705

Merged
merged 2 commits into from
May 7, 2024

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented May 4, 2024

Description

Adds the missing mapping for the user field. (Copy/paste from same field in the template mapping.)

Issues Resolved

Fixes #700

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 4, 2024
Copy link

codecov bot commented May 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.44%. Comparing base (3318d31) to head (9717188).
Report is 2 commits behind head on main.

❗ Current head 9717188 differs from pull request most recent head c66a1ad. Consider uploading reports for the commit c66a1ad to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #705      +/-   ##
============================================
+ Coverage     74.36%   74.44%   +0.08%     
  Complexity      738      738              
============================================
  Files            83       83              
  Lines          3741     3741              
  Branches        322      322              
============================================
+ Hits           2782     2785       +3     
+ Misses          815      811       -4     
- Partials        144      145       +1     

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

@dbwiddis dbwiddis force-pushed the user-mapping branch 4 times, most recently from 9717188 to 66bf879 Compare May 7, 2024 01:12
@amitgalitz
Copy link
Member

So for this case the bwc could be a little different. Since we are only changing the mapping here I think where this would have an effect is in some sort of rollover, where we are creating the index again based of the new mapping. Would that be the only case here also in your opinion?

@dbwiddis
Copy link
Member Author

dbwiddis commented May 7, 2024

So for this case the bwc could be a little different. Since we are only changing the mapping here

I don't think we're changing the mapping. The source stored in the index will be identical. We're just documenting the mapping in the index metadata to permit clients to directly act on the source fields rather than having to parse it first.

I think where this would have an effect is in some sort of rollover

This is a system index, so we're not rolling it over. The concern here would be an index that already exists with the previous mapping; we would update the mapping with the new one which our code does if the versions differ (which reminds me, I should have incremented the mapping version, so that's a needed change here).

Would that be the only case here also in your opinion?

The only case I see this being relevant is an upgrade from 2.12-2.14 to 2.15 or later, when the index metadata would be updated.

Signed-off-by: Daniel Widdis <[email protected]>
Copy link
Member

@amitgalitz amitgalitz left a comment

Choose a reason for hiding this comment

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

LGTM, lets add a TODO or issue to have bwc with security enabled added and general increase of coverage with security

@dbwiddis
Copy link
Member Author

dbwiddis commented May 7, 2024

LGTM, lets add a TODO or issue to have bwc with security enabled added and general increase of coverage with security

#710

@dbwiddis dbwiddis merged commit e3a8784 into opensearch-project:main May 7, 2024
30 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 7, 2024
* Add user mapping to Workflow State index

Signed-off-by: Daniel Widdis <[email protected]>

* Increment schema version

Signed-off-by: Daniel Widdis <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
(cherry picked from commit e3a8784)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis pushed a commit that referenced this pull request May 8, 2024
Add user mapping to Workflow State index (#705)

* Add user mapping to Workflow State index



* Increment schema version



---------


(cherry picked from commit e3a8784)

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>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
* Add user mapping to Workflow State index

Signed-off-by: Daniel Widdis <[email protected]>

* Increment schema version

Signed-off-by: Daniel Widdis <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>
martinpkr pushed a commit to martinpkr/flow-framework that referenced this pull request Jun 2, 2024
* Add user mapping to Workflow State index

Signed-off-by: Daniel Widdis <[email protected]>

* Increment schema version

Signed-off-by: Daniel Widdis <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>
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 <[email protected]>

* Increment schema version

Signed-off-by: Daniel Widdis <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: martinpkr <[email protected]>

* refactored method name and added unit test

Signed-off-by: martinpkr <[email protected]>

* made method use generics + added test

Signed-off-by: martinpkr <[email protected]>

* fixed javadoc

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* Incorporating parseIfExist method into ReindexStep class

Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* refactored method to use parseBoolean and parseFloat methods

Signed-off-by: martinpkr <[email protected]>

* Adding a missing param in javaDoc

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* Added a chagelog entry

Signed-off-by: martinpkr <[email protected]>

* fixed failing spotless check

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* removed unnecessary changelog info

Signed-off-by: martinpkr <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>
Signed-off-by: owaiskazi19 <[email protected]>
Co-authored-by: Daniel Widdis <[email protected]>
Co-authored-by: Owais Kazi <[email protected]>
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 <[email protected]>

* Increment schema version

Signed-off-by: Daniel Widdis <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: martinpkr <[email protected]>

* refactored method name and added unit test

Signed-off-by: martinpkr <[email protected]>

* made method use generics + added test

Signed-off-by: martinpkr <[email protected]>

* fixed javadoc

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* Incorporating parseIfExist method into ReindexStep class

Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* refactored method to use parseBoolean and parseFloat methods

Signed-off-by: martinpkr <[email protected]>

* Adding a missing param in javaDoc

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

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

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* Added a chagelog entry

Signed-off-by: martinpkr <[email protected]>

* fixed failing spotless check

Signed-off-by: martinpkr <[email protected]>

* Added workflow step for ReIndex Step (#718)

* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

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

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
Signed-off-by: martinpkr <[email protected]>

* removed unnecessary changelog info

Signed-off-by: martinpkr <[email protected]>

---------

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: martinpkr <[email protected]>
Signed-off-by: owaiskazi19 <[email protected]>
Co-authored-by: Daniel Widdis <[email protected]>
Co-authored-by: Owais Kazi <[email protected]>
(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 <[email protected]>
Signed-off-by: martinpkr <[email protected]>
Signed-off-by: owaiskazi19 <[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>
Co-authored-by: Daniel Widdis <[email protected]>
Co-authored-by: Owais Kazi <[email protected]>
@dbwiddis dbwiddis deleted the user-mapping branch June 10, 2024 16:34
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] The Workflow State mapping doesn't include the user field
3 participants