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

#709 Return empty response for empty mappings and no applied aliases #724

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

goyamegh
Copy link
Collaborator

@goyamegh goyamegh commented Nov 22, 2023

Description

Returns an empty response instead of exception in case of:

  1. empty index mappings are present,
  2. no applied aliases are present on the index

Issues Resolved

#709

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

@eirsep
Copy link
Member

eirsep commented Nov 22, 2023

plz add rest tests for both the scenarios

eirsep
eirsep previously approved these changes Nov 27, 2023
jowg-amazon
jowg-amazon previously approved these changes Nov 28, 2023
@goyamegh goyamegh dismissed stale reviews from jowg-amazon and eirsep via 6ad9519 November 29, 2023 23:04
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (24e94b4) 24.81% compared to head (6ad9519) 24.74%.
Report is 7 commits behind head on main.

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

Files Patch % Lines
...ch/securityanalytics/mapper/MappingsTraverser.java 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #724      +/-   ##
============================================
- Coverage     24.81%   24.74%   -0.08%     
  Complexity     1021     1021              
============================================
  Files           275      275              
  Lines         12670    12663       -7     
  Branches       1390     1389       -1     
============================================
- Hits           3144     3133      -11     
- Misses         9258     9264       +6     
+ Partials        268      266       -2     

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

@eirsep
Copy link
Member

eirsep commented Nov 30, 2023

fix dco

@jowg-amazon jowg-amazon merged commit c0f7bd9 into opensearch-project:main Nov 30, 2023
10 of 14 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.5 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-724-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c0f7bd934b79f7c3a911229fa63e157116ec5ca9
# Push it to GitHub
git push --set-upstream origin backport/backport-724-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.8 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.8 2.8
# Navigate to the new working tree
cd .worktrees/backport-2.8
# Create a new branch
git switch --create backport/backport-724-to-2.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c0f7bd934b79f7c3a911229fa63e157116ec5ca9
# Push it to GitHub
git push --set-upstream origin backport/backport-724-to-2.8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.8

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.6 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.6 2.6
# Navigate to the new working tree
cd .worktrees/backport-2.6
# Create a new branch
git switch --create backport/backport-724-to-2.6
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c0f7bd934b79f7c3a911229fa63e157116ec5ca9
# Push it to GitHub
git push --set-upstream origin backport/backport-724-to-2.6
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.6

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.7 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport/backport-724-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c0f7bd934b79f7c3a911229fa63e157116ec5ca9
# Push it to GitHub
git push --set-upstream origin backport/backport-724-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7

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

opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 30, 2023
…724)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 30, 2023
…724)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 30, 2023
…724)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 30, 2023
…724)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)
goyamegh added a commit to goyamegh/security-analytics that referenced this pull request Nov 30, 2023
…o applied aliases (opensearch-project#724)

* opensearch-project#709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)
eirsep pushed a commit that referenced this pull request Nov 30, 2023
…724) (#748)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
opensearch-trigger-bot bot added a commit that referenced this pull request Nov 30, 2023
…724) (#748)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
(cherry picked from commit 4f68164)
eirsep pushed a commit that referenced this pull request Nov 30, 2023
…724) (#748) (#758)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
(cherry picked from commit 4f68164)

Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
jowg-amazon pushed a commit that referenced this pull request Dec 1, 2023
…724) (#750)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
jowg-amazon pushed a commit that referenced this pull request Dec 1, 2023
…724) (#747)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
jowg-amazon pushed a commit that referenced this pull request Dec 1, 2023
…724) (#749)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

Co-authored-by: Megha Goyal <[email protected]>
eirsep pushed a commit that referenced this pull request Dec 27, 2023
#757)

* #709 Return empty response for empty mappings and no applied aliases (#724)

* #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <[email protected]>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <[email protected]>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit c0f7bd9)

* #709 Fix merge conflicts while backporting

Signed-off-by: Megha Goyal <[email protected]>

* #709 Fix merge conflicts while backporting

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
@toepkerd toepkerd mentioned this pull request Mar 19, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants