Skip to content

Commit 42905b4

Browse files
authored
Fix 2.19.5 Build Failures (opensearch-project#5195)
* fix 2.19.5 build failures Signed-off-by: Eric Wei <mengwei.eric@gmail.com> * fix 2.19.5 build issue Signed-off-by: Eric Wei <mengwei.eric@gmail.com> * fixed all failing CIs from previous commits Signed-off-by: Eric Wei <mengwei.eric@gmail.com> --------- Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent a7f36ce commit 42905b4

6 files changed

Lines changed: 23 additions & 9 deletions

File tree

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ allprojects {
123123
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
124124
resolutionStrategy.force "net.bytebuddy:byte-buddy:1.14.9"
125125
resolutionStrategy.force "org.apache.commons:commons-lang3:3.18.0"
126+
resolutionStrategy.force "com.google.errorprone:error_prone_annotations:2.45.0"
126127
}
127128
}
128129

doctest/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ fi
2121

2222
$DIR/.venv/bin/pip install -U pip setuptools wheel
2323
$DIR/.venv/bin/pip install -r $DIR/requirements.txt
24-
$DIR/.venv/bin/pip install -e ./sql-cli
24+
$DIR/.venv/bin/pip install -e $DIR/sql-cli

doctest/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ def plugin_path = project(':doctest').projectDir
2222

2323
task cloneSqlCli(type: Exec) {
2424
def repoDir = new File("${project.projectDir}/sql-cli")
25-
25+
2626
if (repoDir.exists()) {
27-
// Repository already exists, fetch and checkout latest
28-
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', 'main'
29-
commandLine 'git', '-C', repoDir.absolutePath, 'checkout', 'origin/main'
27+
// Repository already exists, fetch and checkout stable branch
28+
commandLine 'git', '-C', repoDir.absolutePath, 'fetch', 'origin', '1.0-legacy'
3029
} else {
31-
// Repository doesn't exist, clone it
32-
commandLine 'git', 'clone', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
30+
// Repository doesn't exist, clone the stable branch
31+
commandLine 'git', 'clone', '-b', '1.0-legacy', 'https://github.com/opensearch-project/sql-cli.git', repoDir.absolutePath
3332
}
3433
}
3534

integ-test/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,20 @@ testClusters {
251251
}
252252
}
253253

254+
def isPrometheusRunning() {
255+
try {
256+
def process = "pgrep -f prometheus".execute()
257+
def result = !process.text.trim().isEmpty()
258+
return result
259+
} catch (Exception e) {
260+
return false
261+
}
262+
}
263+
254264
task startPrometheus(type: SpawnProcessTask) {
255265
mustRunAfter ':doctest:doctest'
266+
pidLockFileName ".prom.pid.lock"
267+
onlyIf { !isPrometheusRunning() }
256268

257269
doFirst {
258270
download.run {
@@ -275,6 +287,7 @@ task startPrometheus(type: SpawnProcessTask) {
275287
}
276288

277289
task stopPrometheus(type: KillProcessTask) {
290+
pidLockFileName ".prom.pid.lock"
278291
doLast {
279292
file("$projectDir/bin/prometheus").deleteDir()
280293
file("$projectDir/bin/prometheus.tar.gz").delete()

plugin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ configurations.all {
115115
resolutionStrategy.force "org.apache.httpcomponents:httpcore:4.4.15"
116116
resolutionStrategy.force "org.apache.httpcomponents:httpclient:4.5.14"
117117
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0"
118+
resolutionStrategy.force "com.google.errorprone:error_prone_annotations:2.45.0"
118119
}
119120

120121
configurations {

prometheus/src/test/java/org/opensearch/sql/prometheus/storage/PrometheusStorageFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void testGetStorageEngineWithWrongAuthType() {
130130
.thenReturn(Collections.emptyList());
131131
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
132132
HashMap<String, String> properties = new HashMap<>();
133-
properties.put("prometheus.uri", "https://test.com");
133+
properties.put("prometheus.uri", "http://localhost:9090");
134134
properties.put("prometheus.auth.type", "random");
135135
properties.put("prometheus.auth.region", "us-east-1");
136136
properties.put("prometheus.auth.secret_key", "accessKey");
@@ -150,7 +150,7 @@ void testGetStorageEngineWithNONEAuthType() {
150150
.thenReturn(Collections.emptyList());
151151
PrometheusStorageFactory prometheusStorageFactory = new PrometheusStorageFactory(settings);
152152
HashMap<String, String> properties = new HashMap<>();
153-
properties.put("prometheus.uri", "https://test.com");
153+
properties.put("prometheus.uri", "http://localhost:9090");
154154
StorageEngine storageEngine = prometheusStorageFactory.getStorageEngine(properties);
155155
Assertions.assertTrue(storageEngine instanceof PrometheusStorageEngine);
156156
}

0 commit comments

Comments
 (0)