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

Wrap CreateIndexRequest mappings in _doc key as required #809

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

dbwiddis
Copy link
Member

Description

Adds the _doc key wrapper around index mapping as required by CreateIndexRequest javadoc.

Related Issues

Fixes #798

See also opensearch-project/OpenSearch#14984

Check List

  • New functionality includes testing. (Integ tests pass. I've manually tested as well.)
  • Commits are signed per the DCO using --signoff.

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.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@github-actions github-actions bot added the backport 2.x backport PRs to 2.x branch label Jul 26, 2024
@dbwiddis dbwiddis added backport 2.16 and removed backport 2.x backport PRs to 2.x branch labels Jul 26, 2024
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.77%. Comparing base (07fa010) to head (aacf89d).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #809   +/-   ##
=========================================
  Coverage     75.77%   75.77%           
  Complexity      834      834           
=========================================
  Files            88       88           
  Lines          4045     4046    +1     
  Branches        373      373           
=========================================
+ Hits           3065     3066    +1     
  Misses          824      824           
  Partials        156      156           

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

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@amitgalitz
Copy link
Member

Have we tested this fixes the issue btw

@dbwiddis
Copy link
Member Author

Have we tested this fixes the issue btw

I have manually tested the following 4 combinations:

  • with _doc, with no matching v1 template: expected mapping
  • with _doc, with a matching v1 template: expected mapping
  • without _doc, with no matching v1 template: expected mapping
  • without _doc, with a matching v1 template: wrong mapping (thus the bug)

The fix is precisely the specified in the javadoc. Following the javadoc should not cause an error.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis merged commit 834903f into opensearch-project:main Jul 26, 2024
20 checks passed
@dbwiddis dbwiddis deleted the create-index-mapping branch July 26, 2024 17:12
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.x
# Create a new branch
git switch --create backport/backport-809-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 834903f082e33eeea7360206745b5e2eaa160744
# Push it to GitHub
git push --set-upstream origin backport/backport-809-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-809-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.16
# Create a new branch
git switch --create backport/backport-809-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 834903f082e33eeea7360206745b5e2eaa160744
# Push it to GitHub
git push --set-upstream origin backport/backport-809-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-809-to-2.16.

@dbwiddis
Copy link
Member Author

backports failed due to release notes change. Instead of manually backporting will wait for that to merge and then toggle the backport tags

@dbwiddis dbwiddis added backport 2.x backport PRs to 2.x branch backport 2.16 and removed backport 2.x backport PRs to 2.x branch backport 2.16 labels Jul 26, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 26, 2024
* Wrap CreateIndexRequest mappings in _doc key as required

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

* Add changelog/release notes

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

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 834903f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 26, 2024
* Wrap CreateIndexRequest mappings in _doc key as required

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

* Add changelog/release notes

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

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 834903f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis pushed a commit that referenced this pull request Jul 26, 2024
…ed (#814)

Wrap CreateIndexRequest mappings in _doc key as required (#809)

* Wrap CreateIndexRequest mappings in _doc key as required



* Add changelog/release notes



---------


(cherry picked from commit 834903f)

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>
dbwiddis pushed a commit that referenced this pull request Jul 26, 2024
…red (#815)

Wrap CreateIndexRequest mappings in _doc key as required (#809)

* Wrap CreateIndexRequest mappings in _doc key as required



* Add changelog/release notes



---------


(cherry picked from commit 834903f)

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>
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 backport 2.16
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] System index mapping does not use required _doc wrapper
3 participants