Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bump `commons-logging:commons-logging` from 1.3.5 to 1.3.6 ([#1922](https://github.com/opensearch-project/opensearch-java/pull/1922))
- Bump `gradle-wrapper` from 9.3.1 to 9.5.0 ([#1930](https://github.com/opensearch-project/opensearch-java/pull/1930), [#1934](https://github.com/opensearch-project/opensearch-java/pull/1934), [#1973](https://github.com/opensearch-project/opensearch-java/pull/1973))
- Bump `org.apache.httpcomponents.client5:httpclient5` from 5.6 to 5.6.1 ([#1967](https://github.com/opensearch-project/opensearch-java/pull/1967))
- Bump Jackson to 2.22.2 / 3.2.2 ([#2125](https://github.com/opensearch-project/opensearch-java/pull/2125))

### Added
- Run Java client integration tests with a Testcontainers-managed OpenSearch instance by default ([#2033](https://github.com/opensearch-project/opensearch-java/pull/2033))
Expand All @@ -31,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fix `unitTest` task not running the tests in the `test` source set ([#2074](https://github.com/opensearch-project/opensearch-java/pull/2074))
- Run model tests against both JSON mappers instead of picking one at random ([#2085](https://github.com/opensearch-project/opensearch-java/pull/2085))
- Fix currentSize calculation in BulkIngester ([#2113](https://github.com/opensearch-project/opensearch-java/pull/2113))
- Use protocol version from response (rather than request) ([#2118](https://github.com/opensearch-project/opensearch-java/pull/2118))

### Changed
- Updated API spec download URL to `https://api-spec.opensearch.org` ([#2116](https://github.com/opensearch-project/opensearch-java/pull/2116))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ repositories {

dependencies {
implementation("org.ajoberstar.grgit:grgit-gradle:5.3.3")
implementation("com.diffplug.spotless", "spotless-plugin-gradle", "6.25.0")
implementation("com.diffplug.spotless", "spotless-plugin-gradle", "8.8.0")
}

Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,23 @@ spotless {
bumpThisNumberIfACustomStepChanges(1)

val wildcardImportRegex = Regex("""^import\s+(?:static\s+)?[^*\s]+\.\*;$""", RegexOption.MULTILINE)
custom("Refuse wildcard imports") { contents ->
// Wildcard imports can't be resolved by spotless itself.
// This will require the developer themselves to adhere to best practices.
val wildcardImports = wildcardImportRegex.findAll(contents)
if (wildcardImports.any()) {
var msg = """
Please replace the following wildcard imports with explicit imports ('spotlessApply' cannot resolve this issue):
""".trimIndent()
wildcardImports.forEach {
msg += "\n\t- ${it.value}"
custom("Refuse wildcard imports", object : java.io.Serializable, com.diffplug.spotless.FormatterFunc {
override fun apply(contents: String) : String {
// Wildcard imports can't be resolved by spotless itself.
// This will require the developer themselves to adhere to best practices.
val wildcardImports = wildcardImportRegex.findAll(contents)
if (wildcardImports.any()) {
var msg = """
Please replace the following wildcard imports with explicit imports ('spotlessApply' cannot resolve this issue):
""".trimIndent()
wildcardImports.forEach {
msg += "\n\t- ${it.value}"
}
msg += "\n"
throw AssertionError(msg)
}
msg += "\n"
throw AssertionError(msg)
}
contents
}
return contents
}
})
}
}
2 changes: 1 addition & 1 deletion java-client-grpc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ java {
withSourcesJar()
}

val opensearchVersion = "3.5.0-SNAPSHOT"
val opensearchVersion = "3.9.0-SNAPSHOT"
val grpcVersion = "1.68.0"
val protobufVersion = "3.25.5"
val opensearchProtobufVersion = "1.2.0"
Expand Down
10 changes: 5 additions & 5 deletions java-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ tasks.build {
dependsOn("spotlessJavaCheck")
}

val opensearchVersion = "3.5.0-SNAPSHOT"
val opensearchVersion = "3.9.0-SNAPSHOT"
val opensearchDockerVersion = opensearchVersion.removeSuffix("-SNAPSHOT")

tasks.test {
Expand Down Expand Up @@ -190,10 +190,10 @@ val integrationTest = task<Test>("integrationTest") {
}

dependencies {
val jacksonVersion = "2.21.2"
val jacksonDatabindVersion = "2.21.2"
val jackson3Version = "3.1.1"
val jackson3DatabindVersion = "3.1.1"
val jacksonVersion = "2.22.2"
val jacksonDatabindVersion = "2.22.2"
val jackson3Version = "3.2.2"
val jackson3DatabindVersion = "3.2.2"

// Apache 2.0
api("commons-logging:commons-logging:1.4.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ private <ResponseT> ResponseT decodeResponse(
return rawEndpoint.responseDeserializer(
requestLine.getUri(),
requestLine.getMethod(),
requestLine.getProtocolVersion().format(),
statusLine.getProtocolVersion().format(),
statusLine.getStatusCode(),
statusLine.getReasonPhrase(),
Arrays.stream(clientResp.getHeaders())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private <ResponseT, ErrorT> ResponseT getHighLevelResponse(
final ResponseT error = rawEndpoint.responseDeserializer(
requestLine.getUri(),
requestLine.getMethod(),
requestLine.getProtocolVersion().format(),
statusLine.getProtocolVersion().format(),
statusLine.getStatusCode(),
statusLine.getReasonPhrase(),
Arrays.stream(clientResp.getHeaders())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Collections;
import java.util.Map;
import org.opensearch.client.opensearch.OpenSearchClient;
import org.opensearch.client.opensearch._types.OpenSearchVersionInfo;
import org.opensearch.client.opensearch.core.InfoResponse;
import org.opensearch.client.opensearch.generic.Bodies;
import org.opensearch.client.opensearch.generic.Requests;
Expand All @@ -34,7 +35,7 @@ public void testInfo() throws IOException {
// compare with what the low level client outputs
try (Response response = javaClient().generic().execute(Requests.builder().endpoint("/").method("GET").build())) {
assertThat(response.getStatus(), equalTo(200));
assertThat(response.getProtocol(), equalTo("HTTP/1.1"));
assertThat(response.getProtocol(), equalTo(expectedHttpProtocol(info.version())));
assertThat(response.getBody().isEmpty(), is(false));

Map<String, Object> infoAsMap = response.getBody()
Expand All @@ -56,4 +57,8 @@ public void testInfo() throws IOException {
assertTrue(versionMap.get("number").toString().startsWith(info.version().number()));
}
}

protected String expectedHttpProtocol(OpenSearchVersionInfo version) {
return "HTTP/1.1";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

package org.opensearch.client.opensearch.integTest.httpclient5;

import org.opensearch.client.opensearch._types.OpenSearchVersionInfo;
import org.opensearch.client.opensearch.integTest.AbstractPingAndInfoIT;

public class PingAndInfoIT extends AbstractPingAndInfoIT implements HttpClient5TransportSupport {}
public class PingAndInfoIT extends AbstractPingAndInfoIT implements HttpClient5TransportSupport {
@Override
protected String expectedHttpProtocol(OpenSearchVersionInfo version) {
return isHttps() && version.number().startsWith("3") ? "HTTP/2.0" : "HTTP/1.1";
}
}
6 changes: 3 additions & 3 deletions java-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ dependencies {
implementation("org.apache.logging.log4j", "log4j-slf4j2-impl", "[2.17.1,3.0)")

// Apache 2.0
implementation("com.fasterxml.jackson.core", "jackson-core", "2.17.1")
implementation("com.fasterxml.jackson.core", "jackson-databind", "2.17.1")
implementation("com.fasterxml.jackson.core", "jackson-core", "2.22.2")
implementation("com.fasterxml.jackson.core", "jackson-databind", "2.22.2")

// Apache 2.0
implementation("com.diffplug.spotless", "spotless-lib", "2.45.0")
Expand All @@ -175,7 +175,7 @@ dependencies {
implementation("org.commonmark", "commonmark", "0.24.0")

// EPL-2.0
testImplementation(platform("org.junit:junit-bom:6.1.3"))
testImplementation(platform("org.junit:junit-bom:5.14.4"))
testImplementation("org.junit.jupiter", "junit-jupiter")
testRuntimeOnly("org.junit.platform", "junit-platform-launcher")
}
Expand Down
2 changes: 1 addition & 1 deletion samples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
implementation("org.apache.logging.log4j", "log4j-core","[2.17.1,3.0)")
implementation("org.apache.logging.log4j", "log4j-slf4j2-impl","[2.17.1,3.0)")
implementation("commons-logging", "commons-logging", "1.2")
implementation("com.fasterxml.jackson.core", "jackson-databind", "2.15.2")
implementation("tools.jackson.core", "jackson-databind", "3.2.2")
implementation("software.amazon.awssdk", "sdk-core", "[2.21,3.0)")
implementation("software.amazon.awssdk", "auth", "[2.21,3.0)")
implementation("software.amazon.awssdk", "http-auth-aws", "[2.21,3.0)")
Expand Down
Loading