From 43a4f5f8e9aa3b3d37417cc7c8b67665befb2c11 Mon Sep 17 00:00:00 2001 From: Yizhe Liu Date: Wed, 29 Jan 2025 12:34:25 -0800 Subject: [PATCH 1/4] Fixing integ tests due to missing opensearch-job-scheduler plugin Signed-off-by: Yizhe Liu --- build.gradle | 1 + qa/build.gradle | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/build.gradle b/build.gradle index 90b1ca1f1..9c512385a 100644 --- a/build.gradle +++ b/build.gradle @@ -250,6 +250,7 @@ def knnJarDirectory = "$buildDir/dependencies/opensearch-knn" dependencies { api "org.opensearch:opensearch:${opensearch_version}" + zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}" secureIntegTestPluginArchive group: 'org.opensearch.plugin', name:'opensearch-security', version: "${opensearch_build}" diff --git a/qa/build.gradle b/qa/build.gradle index 62d95ea49..844200f33 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -34,6 +34,7 @@ def knnJarDirectory = "$rootDir/build/dependencies/opensearch-knn" dependencies { api "org.opensearch:opensearch:${opensearch_version}" + zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}" compileOnly fileTree(dir: knnJarDirectory, include: "opensearch-knn-${opensearch_build}.jar") @@ -70,6 +71,16 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { ext{ plugins = [provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return configurations.zipArchive.asFileTree.matching{include "**/opensearch-job-scheduler-${opensearch_build}.zip"}.getSingleFile() + } + } + } + }), provider(new Callable(){ @Override RegularFile call() throws Exception { return new RegularFile() { From 9068a1da1bdaf1db80e9bcdbe4629e6581c069e2 Mon Sep 17 00:00:00 2001 From: Yizhe Liu Date: Wed, 29 Jan 2025 16:14:04 -0800 Subject: [PATCH 2/4] Add jayway as runtime dependency to fix issue #1145 Signed-off-by: Yizhe Liu --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 9c512385a..10d284400 100644 --- a/build.gradle +++ b/build.gradle @@ -269,6 +269,7 @@ dependencies { runtimeOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' runtimeOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1' runtimeOnly group: 'org.json', name: 'json', version: '20231013' + runtimeOnly 'com.jayway.jsonpath:json-path:2.9.0' runtimeOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}") testFixturesImplementation "org.opensearch:common-utils:${version}" From 28a61e57fb0af6c216f3a5615755e03b2fa9e9b4 Mon Sep 17 00:00:00 2001 From: Yizhe Liu Date: Wed, 29 Jan 2025 17:29:47 -0800 Subject: [PATCH 3/4] Add jayway as runtime dependency to qa/build.gradle to fix issue bwc test Signed-off-by: Yizhe Liu --- qa/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/build.gradle b/qa/build.gradle index 844200f33..d852b63f1 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -40,6 +40,7 @@ dependencies { compileOnly fileTree(dir: knnJarDirectory, include: "opensearch-knn-${opensearch_build}.jar") compileOnly group: 'com.google.guava', name: 'guava', version:'32.1.3-jre' compileOnly group: 'commons-lang', name: 'commons-lang', version: '2.6' + runtimeOnly 'com.jayway.jsonpath:json-path:2.9.0' api "org.apache.logging.log4j:log4j-api:${versions.log4j}" api "org.apache.logging.log4j:log4j-core:${versions.log4j}" api "junit:junit:${versions.junit}" From 9338ed9fa24a2a13f78391980b9940e2eb34355a Mon Sep 17 00:00:00 2001 From: Yizhe Liu Date: Thu, 30 Jan 2025 17:50:42 +0000 Subject: [PATCH 4/4] Exclude Sl4j to make sure jayway lib is being used Signed-off-by: Yizhe Liu --- build.gradle | 7 ++++++- qa/build.gradle | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 10d284400..7728763f3 100644 --- a/build.gradle +++ b/build.gradle @@ -269,7 +269,12 @@ dependencies { runtimeOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' runtimeOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1' runtimeOnly group: 'org.json', name: 'json', version: '20231013' - runtimeOnly 'com.jayway.jsonpath:json-path:2.9.0' + // json-path 2.9.0 depends on slf4j 2.0.11, which conflicts with the version used by OpenSearch core. + // Excluding slf4j here since json-path is only used for testing, and logging failures in this context are acceptable. + runtimeOnly('com.jayway.jsonpath:json-path:2.9.0') { + // OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here. + exclude group: 'org.slf4j', module: 'slf4j-api' + } runtimeOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}") testFixturesImplementation "org.opensearch:common-utils:${version}" diff --git a/qa/build.gradle b/qa/build.gradle index d852b63f1..9fe066664 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -40,7 +40,12 @@ dependencies { compileOnly fileTree(dir: knnJarDirectory, include: "opensearch-knn-${opensearch_build}.jar") compileOnly group: 'com.google.guava', name: 'guava', version:'32.1.3-jre' compileOnly group: 'commons-lang', name: 'commons-lang', version: '2.6' - runtimeOnly 'com.jayway.jsonpath:json-path:2.9.0' + // json-path 2.9.0 depends on slf4j 2.0.11, which conflicts with the version used by OpenSearch core. + // Excluding slf4j here since json-path is only used for testing, and logging failures in this context are acceptable. + testRuntimeOnly('com.jayway.jsonpath:json-path:2.9.0') { + // OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here. + exclude group: 'org.slf4j', module: 'slf4j-api' + } api "org.apache.logging.log4j:log4j-api:${versions.log4j}" api "org.apache.logging.log4j:log4j-core:${versions.log4j}" api "junit:junit:${versions.junit}"