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

Not blocking detector creation on unknown feature validation error #1366

Merged
merged 4 commits into from
Nov 17, 2024

Conversation

amitgalitz
Copy link
Member

Description

Currently during detector creation we check for a few different things in relation to the configured feature. If aggregation is valid, if we have at least one feature, that we don't aggregate over a non numerical field with something like average.
However we currently fail on any seen exception, we want to change this that if there is an unknown exception that we don't completely block detector creation. This is due to the fact that we might get things like timeout or search cancellation that are related to the cluster, not cause the configuration is wrong. Users should be able to still create the detector and handle any cluster or settings changes they need to later on if it effects the actual detector creation.

Related Issues

Resolves #1365

Check List

  • 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: Amit Galitzky <amgalitz@amazon.com>
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.04%. Comparing base (5ec87b2) to head (a0aa89f).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1366      +/-   ##
============================================
+ Coverage     80.02%   80.04%   +0.01%     
- Complexity     5664     5674      +10     
============================================
  Files           533      533              
  Lines         23434    23438       +4     
  Branches       2334     2334              
============================================
+ Hits          18753    18760       +7     
- Misses         3572     3578       +6     
+ Partials       1109     1100       -9     
Flag Coverage Δ
plugin 80.04% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../rest/handler/AbstractTimeSeriesActionHandler.java 95.07% <100.00%> (+0.04%) ⬆️

... and 11 files with indirect coverage changes

…at least not always consistent now

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
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.

Looks much cleaner! Thanks for addressing the comments

@amitgalitz amitgalitz merged commit 4c545ab into opensearch-project:main Nov 17, 2024
19 of 20 checks passed
@opensearch-trigger-bot
Copy link

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/anomaly-detection/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/anomaly-detection/backport-2.x
# Create a new branch
git switch --create backport/backport-1366-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4c545ab27d78be4859afde612719a4367c342f9e
# Push it to GitHub
git push --set-upstream origin backport/backport-1366-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/anomaly-detection/backport-2.x

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

@amitgalitz amitgalitz mentioned this pull request Nov 18, 2024
5 tasks
amitgalitz added a commit to amitgalitz/anomaly-detection-1 that referenced this pull request Nov 25, 2024
…pensearch-project#1366)

* don't fail on unknown exception

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* fixing test

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* order of needed permissions is changed on latest security version or at least not always consistent now

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* refactor customNodeclient

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

---------

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
amitgalitz added a commit to amitgalitz/anomaly-detection-1 that referenced this pull request Nov 25, 2024
…pensearch-project#1366)

* don't fail on unknown exception

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* fixing test

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* order of needed permissions is changed on latest security version or at least not always consistent now

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* refactor customNodeclient

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

---------

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
amitgalitz added a commit that referenced this pull request Nov 26, 2024
…1366) (#1371)

* don't fail on unknown exception



* fixing test



* order of needed permissions is changed on latest security version or at least not always consistent now



* refactor customNodeclient



---------

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
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.

[BUG] Feature validation blocks detector creation on all errors
2 participants