diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 433448421..720a005e8 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -26,7 +26,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests run: sbt ++2.12.12 test @@ -65,7 +65,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests run: sbt ++2.13.4 test @@ -105,7 +105,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests run: sbt ++3.3.0 elastic4s-scala3/test diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0310991ab..acefb719b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,7 +22,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests timeout-minutes: 30 @@ -42,7 +42,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests timeout-minutes: 30 @@ -62,7 +62,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: run tests run: sbt ++3.3.0 elastic4s-scala3/test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80a6e5886..122e8a675 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: java-version: 11 - name: Launch elastic docker - run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4 - name: Import GPG key id: import_gpg diff --git a/.java-version b/.java-version new file mode 100644 index 000000000..b4de39476 --- /dev/null +++ b/.java-version @@ -0,0 +1 @@ +11 diff --git a/build.sbt b/build.sbt index be15f8c27..0a09a7736 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ def ossrhUsername = sys.env.getOrElse("OSSRH_USERNAME", "") def ossrhPassword = sys.env.getOrElse("OSSRH_PASSWORD", "") val scala2Versions = Seq("2.12.17", "2.13.12") -val scalaAllVersions = scala2Versions :+ "3.3.1" +val scalaAllVersions = scala2Versions :+ "3.3.3" lazy val commonScalaVersionSettings = Seq( scalaVersion := "2.12.17", crossScalaVersions := Nil @@ -354,9 +354,9 @@ lazy val tests = (project in file("elastic4s-tests")) "com.fasterxml.jackson.core" % "jackson-core" % JacksonVersion % "test", "com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion % "test", "com.fasterxml.jackson.module" %% "jackson-module-scala" % JacksonVersion % "test" exclude("org.scala-lang", "scala-library"), - "org.apache.logging.log4j" % "log4j-api" % "2.22.1" % "test", - "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.22.1" % "test", - "org.apache.logging.log4j" % "log4j-core" % "2.22.1" % "test" + "org.apache.logging.log4j" % "log4j-api" % "2.23.0" % "test", + "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.23.0" % "test", + "org.apache.logging.log4j" % "log4j-core" % "2.23.0" % "test" ), Test / fork := false, Test / parallelExecution := false, diff --git a/docker-compose.yml b/docker-compose.yml index f836b38e8..ee987485a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.3' services: elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0 + image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4 environment: discovery.type: single-node network.host: 0.0.0.0 diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala index f8e860f1b..6635c2c2c 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala @@ -13,6 +13,6 @@ class SourceAsContentBuilderTest extends AnyFunSuite with Matchers { test("source as content builder should handle bigdecimals") { val map = Map("dec" -> BigDecimal("9223372036854776000")) - SourceAsContentBuilder(map).string shouldBe """{"dec":9.223372036854776E+18}""" + SourceAsContentBuilder(map).string shouldBe """{"dec":9223372036854776000}""" } } diff --git a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/admin/domain.scala b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/admin/domain.scala index e19d6a3c4..0946b4629 100644 --- a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/admin/domain.scala +++ b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/admin/domain.scala @@ -18,7 +18,7 @@ case class IndexStatsRequest(indices: Indexes) case class IndicesOptionsRequest(allowNoIndices: Boolean = false, ignoreUnavailable: Boolean = false, - expandWildcardsOpen: Boolean = false, + expandWildcardsOpen: Boolean = true, // Default ES value expandWildcardClosed: Boolean = false) case class IndicesExistsRequest( diff --git a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/snapshots/response.scala b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/snapshots/response.scala index 2974bed4b..5ed1d6669 100644 --- a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/snapshots/response.scala +++ b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/snapshots/response.scala @@ -1,7 +1,9 @@ package com.sksamuel.elastic4s.requests.snapshots import com.fasterxml.jackson.annotation.{JsonProperty, JsonSubTypes, JsonTypeInfo} +import com.sksamuel.elastic4s.ElasticError import com.sksamuel.elastic4s.requests.common.Shards + import scala.concurrent.duration._ case class CreateRepositoryResponse(acknowledged: Boolean) @@ -17,7 +19,7 @@ case class CreateSnapshotResponseAsync(accepted: Boolean) extends CreateSnapshot case class CreateSnapshotResponseAwait(snapshot: Snapshot) extends CreateSnapshotResponse { override def succeeded: Boolean = snapshot.state == "SUCCESS" } -case class GetSnapshotResponse(snapshots: Seq[Snapshot]) +case class GetSnapshotResponse(snapshots: Seq[Snapshot], failures : Map[String, ElasticError]) case class Snapshot(snapshot: String, uuid: String, @JsonProperty("version_id") versionId: String, diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/searches/aggs/PercentilesAggregationTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/searches/aggs/PercentilesAggregationTest.scala index ee29669ca..ce3948514 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/searches/aggs/PercentilesAggregationTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/searches/aggs/PercentilesAggregationTest.scala @@ -46,7 +46,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match }.await.result resp.totalHits shouldBe 8 val agg = resp.aggs.percentiles("agg1") - agg.values shouldBe Map("99.0" -> 2717.0, "25.0" -> 894.0, "95.0" -> 2717.0, "50.0" -> 1707.5, "75.0" -> 2022.0, "1.0" -> 169.0, "5.0" -> 169.0) + agg.values shouldBe Map("99.0" -> 2671.92, "25.0" -> 955.5, "95.0" -> 2491.5999999999995, "50.0" -> 1707.5, "75.0" -> 1996.5, "1.0" -> 211.14, "5.0" -> 379.70000000000005) } "should allow setting which percentiles to return" in { val resp = client.execute { @@ -56,7 +56,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match }.await.result resp.totalHits shouldBe 8 val agg = resp.aggs.percentiles("agg1") - agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2062.8) + agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2032.2) } "should support keyed=false" in { val resp = client.execute { @@ -66,7 +66,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match }.await.result resp.totalHits shouldBe 8 val agg = resp.aggs.percentiles("agg1") - agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2062.8) + agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2032.2) } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala index 6d78ce26d..96a7cdfcc 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala @@ -1,8 +1,7 @@ package com.sksamuel.elastic4s.requests.snapshots import java.util.UUID - -import com.sksamuel.elastic4s.Index +import com.sksamuel.elastic4s.{Index, Response} import com.sksamuel.elastic4s.testkit.DockerTests import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @@ -63,7 +62,7 @@ class SnapshotTest extends AnyFlatSpec with Matchers with DockerTests { it should "error when the repo does not exist" in { client.execute { getSnapshot(snapshotName, "bbbbb") - }.await.error.`type` shouldBe "repository_missing_exception" + }.await.result.failures("bbbbb").`type` shouldBe "repository_missing_exception" } "restore snapshot" should "error when an index clashes" in { diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/SearchTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/SearchTest.scala index 697b6d36d..3420deb16 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/SearchTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/SearchTest.scala @@ -47,14 +47,14 @@ class SearchTest extends AnyWordSpec with DockerTests with Matchers { "count" -> 2 ), indexInto("chess").fields( - "name" -> "knight", "aka" -> "horse", + "name" -> "knight", "value" -> 3, "count" -> 2 ), indexInto("chess").fields( - "name" -> "rook", "aka" -> "castle", + "name" -> "rook", "value" -> 5, "count" -> 2 ), diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 09ac4fc62..425c0e724 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,16 +5,16 @@ object Dependencies { val AkkaHttpVersion = "10.2.10" val AkkaVersion = "2.6.20" val CatsEffect2Version = "2.5.5" - val CatsEffectVersion = "3.5.3" + val CatsEffectVersion = "3.5.4" val CatsVersion = "2.0.0" val CirceVersion = "0.14.6" val CommonsIoVersion = "2.15.1" val ElasticsearchVersion = "8.11.4" val ExtsVersion = "1.61.1" - val JacksonVersion = "2.14.3" + val JacksonVersion = "2.16.0" val Json4sVersion = "4.0.7" val Log4jVersion = "2.15.0" - val MockitoVersion = "5.8.0" + val MockitoVersion = "5.11.0" val MonixVersion = "3.4.1" val PekkoHttpVersion = "1.0.0" val PekkoVersion = "1.0.2" @@ -26,7 +26,7 @@ object Dependencies { val ScalatestVersion = "3.2.16" val Slf4jVersion = "2.0.12" val SprayJsonVersion = "1.3.6" - val SttpVersion = "3.9.2" + val SttpVersion = "3.9.4" val ZIOJson1Version = "0.1.5" val ZIO1Version = "1.0.18" val ZIOVersion = "2.0.21" diff --git a/project/build.properties b/project/build.properties index c8fcab543..04267b14a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.9.9