Skip to content

Commit

Permalink
[Backport 2.14] Change AD jar name for 2.14 compatibility (#309)
Browse files Browse the repository at this point in the history
* Change AD jar name for 2.14 compatibility (#308)

Signed-off-by: Daniel Widdis <[email protected]>
(cherry picked from commit 8ee946b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Upgrade snapshot version

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

---------

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>
Co-authored-by: Daniel Widdis <[email protected]>
  • Loading branch information
3 people authored May 1, 2024
1 parent 92a9a3c commit eba9e1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "2.13.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.14.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
version_tokens = opensearch_version.tokenize('-')
Expand Down Expand Up @@ -107,7 +107,7 @@ task addJarsToClasspath(type: Copy) {
into("$buildDir/classes")

from(fileTree(dir: adJarDirectory)) {
include "opensearch-time-series-analytics-${opensearch_build}.jar"
include "opensearch-anomaly-detection-${opensearch_build}.jar"
}
into("$buildDir/classes")
}
Expand All @@ -124,7 +124,7 @@ dependencies {
// Plugin dependencies
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}"
implementation fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${opensearch_build}.jar"])
implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${opensearch_build}.jar"])
implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${opensearch_build}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${opensearch_build}.jar", "ppl-${opensearch_build}.jar", "protocol-${opensearch_build}.jar"])
compileOnly "org.opensearch:common-utils:${opensearch_build}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.opensearch.action.ActionType;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.ad.model.AnomalyDetector;
import org.opensearch.ad.model.IntervalTimeConfiguration;
import org.opensearch.ad.transport.GetAnomalyDetectorAction;
import org.opensearch.ad.transport.GetAnomalyDetectorResponse;
import org.opensearch.ad.transport.SearchAnomalyDetectorAction;
Expand All @@ -45,7 +46,6 @@
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.ml.common.spi.tools.Tool;
import org.opensearch.search.SearchHit;
import org.opensearch.timeseries.model.IntervalTimeConfiguration;

public class SearchAnomalyDetectorsToolTests {
@Mock
Expand Down Expand Up @@ -85,7 +85,6 @@ public void setup() {
Instant.now(),
Collections.emptyList(),
null,
null,
null
);
}
Expand Down Expand Up @@ -126,7 +125,7 @@ public void testRunWithSingleAnomalyDetector() throws Exception {
content.field("last_update_time", testDetector.getLastUpdateTime().toEpochMilli());
content.endObject();
SearchHit[] hits = new SearchHit[1];
hits[0] = new SearchHit(0, testDetector.getId(), null, null).sourceRef(BytesReference.bytes(content));
hits[0] = new SearchHit(0, testDetector.getDetectorId(), null, null).sourceRef(BytesReference.bytes(content));
SearchResponse getDetectorsResponse = TestHelpers.generateSearchResponse(hits);
String expectedResponseStr = getExpectedResponseString(testDetector);

Expand Down Expand Up @@ -461,7 +460,7 @@ private String getExpectedResponseString(AnomalyDetector testDetector) {
return String
.format(
"AnomalyDetectors=[{id=%s,name=%s,type=%s,description=%s,index=%s,lastUpdateTime=%d}]TotalAnomalyDetectors=%d",
testDetector.getId(),
testDetector.getDetectorId(),
testDetector.getName(),
testDetector.getDetectorType(),
testDetector.getDescription(),
Expand Down

0 comments on commit eba9e1c

Please sign in to comment.