From fa2f4a2bd3811505d0e57b0b8b92bacaa041f73d Mon Sep 17 00:00:00 2001 From: Marius Soutier Date: Tue, 29 Oct 2024 11:45:24 +0100 Subject: [PATCH 1/5] sc8s: add collectRight to Either handling and align flattenF with other impls --- .../jvm/src/test/scala/StreamOpsSpec.scala | 10 ++++++++-- .../shared/src/main/scala/StreamOps.scala | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/akka-stream-utils/jvm/src/test/scala/StreamOpsSpec.scala b/akka-stream-utils/jvm/src/test/scala/StreamOpsSpec.scala index 45a7191..92e5eba 100644 --- a/akka-stream-utils/jvm/src/test/scala/StreamOpsSpec.scala +++ b/akka-stream-utils/jvm/src/test/scala/StreamOpsSpec.scala @@ -242,12 +242,18 @@ class StreamOpsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with checkTable2[Boolean, Int, Either](input, operations) } - "Either flattenF" in { + "Either collectRightF" in { Source(Seq(Right(1), Left(true), Right(2))) - .flattenF + .collectRightF .runWith(Sink.seq) .futureValue shouldBe Seq(1, 2) } + "Either flattenF" in { + Source(Seq(Right(Right(1)), Left(true), Right(Left(false)), Right(Right(2)))) + .flattenF + .runWith(Sink.seq) + .futureValue shouldBe Seq(Right(1), Left(true), Left(false), Right(2)) + } "Either flatMapMergeF" in { Source(Seq(Right(1), Left(true), Right(2))) .flatMapMergeF(8, element => Source(Seq(element * 2, element * 4))) diff --git a/akka-stream-utils/shared/src/main/scala/StreamOps.scala b/akka-stream-utils/shared/src/main/scala/StreamOps.scala index 1ec0d86..8e1d945 100644 --- a/akka-stream-utils/shared/src/main/scala/StreamOps.scala +++ b/akka-stream-utils/shared/src/main/scala/StreamOps.scala @@ -262,10 +262,16 @@ object StreamOps { case _ => Left(zero) }) - def flattenF: s.Repr[OutR] = s.collect { + def collectRightF: s.Repr[OutR] = s.collect { case Right(value) => value } + def flattenF[OutR2](implicit ev: OutR <:< Either[OutL, OutR2]): s.Repr[Either[OutL, OutR2]] = + s.map { + case Left(outL) => Left(outL) + case Right(outR) => ev.apply(outR) + } + def groupByF[K](maxSubstreams: Int, f: OutR => K): SubFlow[Either[OutL, OutR], Mat, s.Repr, s.Closed] = { s.groupBy(maxSubstreams, { case Right(value) => Some(f(value)) From 7e12a1590fa8944a902d436106baef7a291a9613 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 28 Oct 2024 14:22:46 +0000 Subject: [PATCH 2/5] Update sbt, sbt-dependency-tree, ... to 1.10.4 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 0b699c3..09feeee 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.2 +sbt.version=1.10.4 From 0633ef9a6de52ae6f5feb49194bb38c06c924b58 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 26 Oct 2024 13:11:00 +0000 Subject: [PATCH 3/5] Update logback-classic, logback-core to 1.5.12 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index caed3d2..f8bd84d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -161,7 +161,7 @@ object Dependencies { } object logback { - private val logback = "1.5.8" + private val logback = "1.5.12" val core = "ch.qos.logback" % "logback-core" % logback val classic = "ch.qos.logback" % "logback-classic" % logback From 3404a492c6e6e3e72d3dc761eeaf9427f4d2839a Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 22 Oct 2024 12:57:46 +0000 Subject: [PATCH 4/5] Update elastic4s-client-akka, ... to 8.15.3 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f8bd84d..a5b6731 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -168,7 +168,7 @@ object Dependencies { } object elastic4s { - private val elastic4s = "8.15.2" + private val elastic4s = "8.15.3" private val elasticsearch = "8.15.2" val clientAkka = "nl.gn0s1s" %% "elastic4s-client-akka" % elastic4s From 2df0c30f6cb1e9b16e46953f4d3284c28fd6ed0b Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 22 Oct 2024 12:57:41 +0000 Subject: [PATCH 5/5] Update sbt-ci-release to 1.9.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 72ebc6d..6eacb82 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0") addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.24.0") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.7.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0") addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.2") addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "4.3.0")