-
Notifications
You must be signed in to change notification settings - Fork 31
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 basic search detectors tool; pull plugin deps in gradle run #39
Conversation
Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: Tyler Ohlsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits.
build.gradle
Outdated
|
||
configurations { | ||
zipArchive | ||
all { | ||
resolutionStrategy { | ||
force "org.mockito:mockito-core:5.8.0" | ||
force "com.google.guava:guava:32.1.3-jre" // CVE for 31.1 | ||
force "com.google.guava:guava:32.1.2-jre" // CVE for 31.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment why we are not using the latest version? Mend will generate an auto-bump for this (if it hasn't already) and would like to include a reason when closing it to prevent future bumps...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch. Reverted this as it's a leftover change from my inter-plugin dependency issues.
src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java
Show resolved
Hide resolved
src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java
Show resolved
Hide resolved
src/test/java/org/opensearch/agent/tools/SearchAnomalyDetectorsToolTests.java
Outdated
Show resolved
Hide resolved
Build is failing, seems like missing dependency. |
@zane-neo See comment in description:
It is unsustainable to maintain passing builds on main since most plugin builds fail due to constant breaking changes on |
Signed-off-by: Tyler Ohlsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with comments
src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java
Show resolved
Hide resolved
Signed-off-by: Tyler Ohlsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with previous comments noted. However, not sure we should merge something that doesn't compile and breaks main
. That will kill all testing of future PRs.
LGTM but dismissing approval so this doesn't get merged until dependency fixed.
Signed-off-by: Tyler Ohlsen <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #39 +/- ##
=======================================
Coverage ? 21.21%
Complexity ? 6
=======================================
Files ? 3
Lines ? 231
Branches ? 31
=======================================
Hits ? 49
Misses ? 167
Partials ? 15 ☔ View full report in Codecov by Sentry. |
I've root caused this failure - the plugin name change has changed the underlying jar path in the zip, hence not adding it to the classpath. I also got AD to build and upload to sonatype so the snapshot is now successfully pulled in CI. |
Ah, yes! Should have remembered that. |
final Boolean highCardinality = parameters.containsKey("highCardinality") | ||
? Boolean.parseBoolean(parameters.get("highCardinality")) | ||
: null; | ||
final Long lastUpdateTime = parameters.containsKey("lastUpdateTime") ? Long.parseLong(parameters.get("lastUpdateTime")) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long.parseLong
might throw NumberFormatException if the input parameter is null or invalid number format, suggestion is to use StringUtils.isNumeric()
to check if the input is a number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will update.
SearchRequest searchDetectorRequest = new SearchRequest().source(searchSourceBuilder); | ||
|
||
if (running != null || disabled != null || failed != null) { | ||
// TODO: add a listener to trigger when the first response is received, to trigger the profile API call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this missed to address or will be addressed in future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be addressed in the future. I'll create a follow up issue alongside some other improvements soon.
Signed-off-by: Tyler Ohlsen <[email protected]>
Description
This PR adds 2 things:
./gradlew run
to run an integ test cluster with ML commons, SQL, AD, and job scheduler plugins for faster iterative testingConfirmed all build / test / run cmds work successfully on 2.11. The only difference for
main
is bumping to 3.0. Given the dependency list I'm not enforcing 3.0 builds to pass.Additionally, I will manually open a backport to 2.x with the correct version
Issues Resolved
[List any issues this PR will resolve]
Check List
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.