diff --git a/build.sbt b/build.sbt index 48c219a139..f051b14744 100755 --- a/build.sbt +++ b/build.sbt @@ -20,7 +20,7 @@ val akkaHttpCirceVersion = "1.39.2" val akkaCorsVersion = "1.2.0" val akkaVersion = "2.6.21" val alpakkaVersion = "3.0.4" -val awsSdkVersion = "2.28.21" +val awsSdkVersion = "2.28.27" val betterMonadicForVersion = "0.3.1" val caffeineVersion = "3.1.8" val catsEffectVersion = "3.5.4" @@ -44,7 +44,7 @@ val kamonVersion = "2.7.5" val kanelaAgentVersion = "1.0.18" val kindProjectorVersion = "0.13.3" val log4catsVersion = "2.7.0" -val logbackVersion = "1.5.10" +val logbackVersion = "1.5.11" val magnoliaVersion = "1.1.10" val munitVersion = "1.0.2" val munitCatsEffectVersion = "2.0.0" @@ -57,8 +57,6 @@ val topBraidVersion = "1.4.3" val testContainersVersion = "1.20.2" val testContainersScalaVersion = "0.41.4" -lazy val akkaActorTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion - lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion lazy val akkaHttpCore = "com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion lazy val akkaHttpCirce = "de.heikoseeberger" %% "akka-http-circe" % akkaHttpCirceVersion @@ -69,7 +67,6 @@ lazy val akkaHttpXml = "com.typesafe.akka" %% "akka-http-xml" % akkaHttp lazy val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % akkaVersion lazy val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaVersion lazy val akkaTestKit = "com.typesafe.akka" %% "akka-testkit" % akkaVersion -lazy val akkaTestKitTyped = "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion lazy val alpakkaFile = "com.lightbend.akka" %% "akka-stream-alpakka-file" % alpakkaVersion lazy val alpakkaSse = "com.lightbend.akka" %% "akka-stream-alpakka-sse" % alpakkaVersion lazy val awsSdk = "software.amazon.awssdk" % "s3" % awsSdkVersion @@ -204,7 +201,7 @@ lazy val kernel = project .settings(shared, compilation, coverage, release, assertJavaVersion) .settings( libraryDependencies ++= Seq( - akkaActorTyped, // Needed to create content type + akkaStream, // Needed to create content type akkaHttpCore, caffeine, catsCore, @@ -237,9 +234,6 @@ lazy val testkit = project .settings( coverageMinimumStmtTotal := 0, libraryDependencies ++= Seq( - akkaActorTyped, // Needed to create Uri - akkaHttpCore, - akkaStream, alpakkaFile excludeAll ( ExclusionRule(organization = "com.typesafe.akka", name = "akka-stream_2.13") ), @@ -291,8 +285,6 @@ lazy val rdf = project ) .settings( libraryDependencies ++= Seq( - akkaActorTyped, // Needed to create Uri - akkaHttpCore, catsCore, circeParser, circeGeneric, @@ -302,10 +294,7 @@ lazy val rdf = project magnolia, scalaReflect, topBraidShacl, - akkaSlf4j % Test, - akkaTestKit % Test, - logback % Test, - scalaTest % Test + logback % Test ), Test / fork := true, addCompilerPlugin(betterMonadicFor) @@ -322,18 +311,14 @@ lazy val sdk = project .settings( coverageFailOnMinimum := false, libraryDependencies ++= Seq( - akkaStream, - akkaHttp, akkaHttpXml exclude ("org.scala-lang.modules", "scala-xml_2.13"), scalaXml, circeLiteral, circeGenericExtras, distageCore, - akkaTestKitTyped % Test, - akkaHttpTestKit % Test, - munit % Test, - munitCatsEffect % Test, - scalaTest % Test + akkaSlf4j % Test, + akkaTestKit % Test, + akkaHttpTestKit % Test ), addCompilerPlugin(kindProjector), addCompilerPlugin(betterMonadicFor) @@ -354,9 +339,7 @@ lazy val app = project akkaHttpCors, akkaSlf4j, classgraph, - logback, - akkaHttpTestKit % Test, - scalaTest % Test + logback ), addCompilerPlugin(betterMonadicFor), run / fork := true, @@ -451,11 +434,8 @@ lazy val elasticsearchPlugin = project assembly / assemblyJarName := "elasticsearch.jar", assembly / assemblyOption := (assembly / assemblyOption).value.withIncludeScala(false), libraryDependencies ++= Seq( - kamonAkkaHttp % Provided, - akkaTestKitTyped % Test, - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + kamonAkkaHttp % Provided, + logback % Test ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch", @@ -478,9 +458,7 @@ lazy val blazegraphPlugin = project moduleName := "delta-blazegraph-plugin", libraryDependencies ++= Seq( kamonAkkaHttp % Provided, - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + logback % Test ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.blazegraph", @@ -510,9 +488,7 @@ lazy val compositeViewsPlugin = project ExclusionRule(organization = "com.typesafe.akka", name = "akka-http_2.13") ), kamonAkkaHttp % Provided, - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + logback % Test ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.compositeviews", @@ -540,9 +516,7 @@ lazy val searchPlugin = project moduleName := "delta-search-plugin", libraryDependencies ++= Seq( kamonAkkaHttp % Provided, - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + logback % Test ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.search", @@ -568,11 +542,8 @@ lazy val storagePlugin = project name := "delta-storage-plugin", moduleName := "delta-storage-plugin", libraryDependencies ++= Seq( - kamonAkkaHttp % Provided, - akkaSlf4j % Test, - akkaTestKitTyped % Test, - akkaHttpTestKit % Test, - logback % Test + kamonAkkaHttp % Provided, + logback % Test ) ++ Seq( fs2ReactiveStreams, fs2Aws, @@ -615,9 +586,7 @@ lazy val archivePlugin = project alpakkaFile excludeAll ( ExclusionRule(organization = "com.typesafe.akka", name = "akka-stream_2.13") ), - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + logback % Test ), addCompilerPlugin(betterMonadicFor), buildInfoKeys := Seq[BuildInfoKey](version), @@ -640,8 +609,7 @@ lazy val projectDeletionPlugin = project name := "delta-project-deletion-plugin", moduleName := "delta-project-deletion-plugin", libraryDependencies ++= Seq( - kamonAkkaHttp % Provided, - scalaTest % Test + kamonAkkaHttp % Provided ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.projectdeletion", @@ -668,9 +636,7 @@ lazy val graphAnalyticsPlugin = project moduleName := "delta-graph-analytics-plugin", libraryDependencies ++= Seq( kamonAkkaHttp % Provided, - akkaSlf4j % Test, - logback % Test, - scalaTest % Test + logback % Test ), addCompilerPlugin(betterMonadicFor), buildInfoKeys := Seq[BuildInfoKey](version), @@ -695,8 +661,7 @@ lazy val jiraPlugin = project moduleName := "delta-jira-plugin", libraryDependencies ++= Seq( googleAuthClient, - kamonAkkaHttp % Provided, - scalaTest % Test + kamonAkkaHttp % Provided ), buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "ch.epfl.bluebrain.nexus.delta.plugins.jira", diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala index 9cde00abcd..903b4f3c11 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala @@ -1,8 +1,6 @@ package ch.epfl.bluebrain.nexus.delta -import akka.actor.typed.ActorSystem -import akka.actor.typed.scaladsl.adapter._ -import akka.actor.{ActorSystem => ActorSystemClassic} +import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.model.headers.RawHeader import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler, Route, RouteResult} @@ -151,8 +149,8 @@ object Main extends IOApp { } private def bootstrap(locator: Locator, plugins: List[Plugin]): Resource[IO, Unit] = { - implicit val as: ActorSystemClassic = locator.get[ActorSystem[Nothing]].toClassic - implicit val cfg: AppConfig = locator.get[AppConfig] + implicit val as: ActorSystem = locator.get[ActorSystem] + implicit val cfg: AppConfig = locator.get[AppConfig] val startHttpServer = IOFuture.defaultCancelable( IO( diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala index 582bcb401a..90876e7264 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala @@ -1,8 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.wiring -import akka.actor.BootstrapSetup -import akka.actor.typed.ActorSystem -import akka.actor.typed.scaladsl.Behaviors +import akka.actor.{ActorSystem, BootstrapSetup} import akka.http.scaladsl.model.HttpMethods._ import akka.http.scaladsl.model.headers.Location import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler, Route} @@ -134,21 +132,19 @@ class DeltaModule(appCfg: AppConfig, config: Config)(implicit classLoader: Class JWSPayloadHelper(config.jws) } - make[ActorSystem[Nothing]].fromResource { () => + make[ActorSystem].fromResource { () => val make = IO.delay( - ActorSystem[Nothing]( - Behaviors.empty, + ActorSystem( appCfg.description.fullName, BootstrapSetup().withConfig(config).withClassloader(classLoader) ) ) - val release = (as: ActorSystem[Nothing]) => { - import akka.actor.typed.scaladsl.adapter._ - IOFuture.defaultCancelable(IO(as.toClassic.terminate()).timeout(15.seconds)).void + val release = (as: ActorSystem) => { + IOFuture.defaultCancelable(IO(as.terminate()).timeout(15.seconds)).void } Resource.make(make)(release) } - make[Materializer].from((as: ActorSystem[Nothing]) => SystemMaterializer(as).materializer) + make[Materializer].from((as: ActorSystem) => SystemMaterializer(as).materializer) make[Logger].from { LoggerFactory.getLogger("delta") } make[RejectionHandler].from { (cr: RemoteContextResolution @Id("aggregate"), ordering: JsonKeyOrdering) => RdfRejectionHandler(cr, ordering) diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/RealmsModule.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/RealmsModule.scala index bc005e4a4e..750fc161ef 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/RealmsModule.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/RealmsModule.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.wiring -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import akka.http.scaladsl.model.{HttpRequest, Uri} import cats.effect.{Clock, IO} import ch.epfl.bluebrain.nexus.delta.Main.pluginsMaxPriority @@ -50,8 +50,8 @@ object RealmsModule extends ModuleDef { new RealmsRoutes(identities, realms, aclCheck)(cfg.http.baseUri, cfg.realms.pagination, cr, ordering) } - make[HttpClient].named("realm").from { (as: ActorSystem[Nothing]) => - HttpClient.noRetry(compression = false)(as.classicSystem) + make[HttpClient].named("realm").from { (as: ActorSystem) => + HttpClient.noRetry(compression = false)(as) } many[MetadataContextValue].addEffect(MetadataContextValue.fromFile("contexts/realms-metadata.json")) diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/MainSuite.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/MainSuite.scala index 9876e71404..3842b36a54 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/MainSuite.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/MainSuite.scala @@ -84,21 +84,20 @@ object MainSuite { ) Map( - "app.defaults.database.access.host" -> postgres.getHost, - "app.defaults.database.access.port" -> postgres.getMappedPort(5432).toString, - "app.database.tables-autocreate" -> "true", - "app.defaults.database.access.username" -> PostgresUser, - "app.default.database.access.password" -> PostgresPassword, - "akka.actor.testkit.typed.throw-on-shutdown-timeout" -> "false", - "plugins.elasticsearch.indexing-enabled" -> "false", + "app.defaults.database.access.host" -> postgres.getHost, + "app.defaults.database.access.port" -> postgres.getMappedPort(5432).toString, + "app.database.tables-autocreate" -> "true", + "app.defaults.database.access.username" -> PostgresUser, + "app.default.database.access.password" -> PostgresPassword, + "plugins.elasticsearch.indexing-enabled" -> "false", //TODO Investigate how to remove this property from the config - "plugins.elasticsearch.disable-metrics-projection" -> "true", - "plugins.graph-analytics.enabled" -> "true", - "plugins.graph-analytics.indexing-enabled" -> "false", - "plugins.search.enabled" -> "true", - "plugins.search.indexing.resource-types" -> resourceTypesFile.toString, - "plugins.search.indexing.mapping" -> mappingFile.toString, - "plugins.search.indexing.query" -> queryFile.toString + "plugins.elasticsearch.disable-metrics-projection" -> "true", + "plugins.graph-analytics.enabled" -> "true", + "plugins.graph-analytics.indexing-enabled" -> "false", + "plugins.search.enabled" -> "true", + "plugins.search.indexing.resource-types" -> resourceTypesFile.toString, + "plugins.search.indexing.mapping" -> mappingFile.toString, + "plugins.search.indexing.query" -> queryFile.toString ) } diff --git a/delta/plugins/blazegraph/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphPluginModule.scala b/delta/plugins/blazegraph/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphPluginModule.scala index 80b91a08a5..273603c847 100644 --- a/delta/plugins/blazegraph/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphPluginModule.scala +++ b/delta/plugins/blazegraph/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphPluginModule.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.blazegraph -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import cats.effect.{Clock, IO} import ch.epfl.bluebrain.nexus.delta.kernel.utils.{ClasspathResourceLoader, UUIDF} import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.client.BlazegraphClient @@ -48,12 +48,8 @@ class BlazegraphPluginModule(priority: Int) extends ModuleDef { loader.propertiesOf("blazegraph/index.properties").map(DefaultProperties) } - make[HttpClient].named("http-indexing-client").from { - ( - cfg: BlazegraphViewsConfig, - as: ActorSystem[Nothing] - ) => - HttpClient()(cfg.indexingClient, as.classicSystem) + make[HttpClient].named("http-indexing-client").from { (cfg: BlazegraphViewsConfig, as: ActorSystem) => + HttpClient()(cfg.indexingClient, as) } make[BlazegraphSlowQueryStore].from { (xas: Transactors) => @@ -82,29 +78,25 @@ class BlazegraphPluginModule(priority: Int) extends ModuleDef { ( cfg: BlazegraphViewsConfig, client: HttpClient @Id("http-indexing-client"), - as: ActorSystem[Nothing], + as: ActorSystem, properties: DefaultProperties ) => - BlazegraphClient(client, cfg.base, cfg.credentials, cfg.queryTimeout, properties.value)( - as.classicSystem - ) + BlazegraphClient(client, cfg.base, cfg.credentials, cfg.queryTimeout, properties.value)(as) } - make[HttpClient].named("http-query-client").from { (as: ActorSystem[Nothing]) => + make[HttpClient].named("http-query-client").from { (as: ActorSystem) => val httpConfig = HttpClientConfig.noRetry(false) - HttpClient()(httpConfig, as.classicSystem) + HttpClient()(httpConfig, as) } make[BlazegraphClient].named("blazegraph-query-client").from { ( cfg: BlazegraphViewsConfig, client: HttpClient @Id("http-query-client"), - as: ActorSystem[Nothing], + as: ActorSystem, properties: DefaultProperties ) => - BlazegraphClient(client, cfg.base, cfg.credentials, cfg.queryTimeout, properties.value)( - as.classicSystem - ) + BlazegraphClient(client, cfg.base, cfg.credentials, cfg.queryTimeout, properties.value)(as) } make[ValidateBlazegraphView].from { diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewRoutesFixtures.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewRoutesFixtures.scala index dc7c0a16a3..aaeae6577a 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewRoutesFixtures.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewRoutesFixtures.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.routes -import akka.actor.typed.ActorSystem import akka.http.scaladsl.model.headers.OAuth2BearerToken import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler} import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.Fixtures @@ -43,10 +42,7 @@ trait BlazegraphViewRoutesFixtures with BeforeAndAfterAll with Fixtures { - import akka.actor.typed.scaladsl.adapter._ - - implicit val typedSystem: ActorSystem[Nothing] = system.toTyped - implicit val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) + implicit val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) implicit val ordering: JsonKeyOrdering = JsonKeyOrdering.default(topKeys = diff --git a/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsPluginModule.scala b/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsPluginModule.scala index c7021a042c..3f1a2fcb93 100644 --- a/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsPluginModule.scala +++ b/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsPluginModule.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.compositeviews -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import cats.effect.{Clock, IO} import ch.epfl.bluebrain.nexus.delta.kernel.utils.{ClasspathResourceLoader, UUIDF} import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.client.BlazegraphClient @@ -51,11 +51,11 @@ class CompositeViewsPluginModule(priority: Int) extends ModuleDef { make[DeltaClient].from { ( cfg: CompositeViewsConfig, - as: ActorSystem[Nothing], + as: ActorSystem, authTokenProvider: AuthTokenProvider ) => val httpConfig = HttpClientConfig.noRetry(true) - val httpClient = HttpClient()(httpConfig, as.classicSystem) + val httpClient = HttpClient()(httpConfig, as) DeltaClient(httpClient, authTokenProvider, cfg.remoteSourceCredentials, cfg.remoteSourceClient.retryDelay)( as ) @@ -65,7 +65,7 @@ class CompositeViewsPluginModule(priority: Int) extends ModuleDef { ( cfg: CompositeViewsConfig, client: HttpClient @Id("http-indexing-client"), - as: ActorSystem[Nothing], + as: ActorSystem, properties: DefaultProperties ) => BlazegraphClient( @@ -74,14 +74,14 @@ class CompositeViewsPluginModule(priority: Int) extends ModuleDef { cfg.blazegraphAccess.credentials, cfg.blazegraphAccess.queryTimeout, properties.value - )(as.classicSystem) + )(as) } make[BlazegraphClient].named("blazegraph-composite-query-client").from { ( cfg: CompositeViewsConfig, client: HttpClient @Id("http-query-client"), - as: ActorSystem[Nothing], + as: ActorSystem, properties: DefaultProperties ) => BlazegraphClient( @@ -90,7 +90,7 @@ class CompositeViewsPluginModule(priority: Int) extends ModuleDef { cfg.blazegraphAccess.credentials, cfg.blazegraphAccess.queryTimeout, properties.value - )(as.classicSystem) + )(as) } make[ValidateCompositeView].from { diff --git a/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClient.scala b/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClient.scala index 75933aaf60..e95e09592a 100644 --- a/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClient.scala +++ b/delta/plugins/composite-views/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClient.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.client -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import akka.http.scaladsl.client.RequestBuilding.{Get, Head} import akka.http.scaladsl.model.ContentTypes.`application/json` import akka.http.scaladsl.model.Uri.Query @@ -84,9 +84,8 @@ object DeltaClient { authTokenProvider: AuthTokenProvider, credentials: Credentials, retryDelay: FiniteDuration - )(implicit - as: ActorSystem[Nothing] - ) extends DeltaClient { + )(implicit as: ActorSystem) + extends DeltaClient { override def projectStatistics(source: RemoteProjectSource): IO[ProjectStatistics] = { for { @@ -184,6 +183,6 @@ object DeltaClient { authTokenProvider: AuthTokenProvider, credentials: Credentials, retryDelay: FiniteDuration - )(implicit as: ActorSystem[Nothing]): DeltaClient = + )(implicit as: ActorSystem): DeltaClient = new DeltaClientImpl(client, authTokenProvider, credentials, retryDelay) } diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClientSpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClientSpec.scala index 8223bed408..8a74fe10f6 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClientSpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/client/DeltaClientSpec.scala @@ -1,7 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.client -import akka.actor.typed.scaladsl.adapter._ -import akka.actor.{typed, ActorSystem} +import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.marshalling.sse.EventStreamMarshalling._ import akka.http.scaladsl.model._ @@ -44,8 +43,6 @@ class DeltaClientSpec with BeforeAndAfterAll with QueryParamsUnmarshalling { - implicit val typedSystem: typed.ActorSystem[Nothing] = system.toTyped - var server: Option[Http.ServerBinding] = None private val token = "secretToken" diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/routes/CompositeViewsRoutesFixtures.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/routes/CompositeViewsRoutesFixtures.scala index 20ff27e90a..20f2f3a432 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/routes/CompositeViewsRoutesFixtures.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/routes/CompositeViewsRoutesFixtures.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.routes -import akka.actor.typed.ActorSystem import akka.http.scaladsl.model.headers.OAuth2BearerToken import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler} import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.{CompositeViewsFixture, Fixtures} @@ -37,10 +36,6 @@ trait CompositeViewsRoutesFixtures with CompositeViewsFixture with Fixtures { - import akka.actor.typed.scaladsl.adapter._ - - implicit val typedSystem: ActorSystem[Nothing] = system.toTyped - implicit val ordering: JsonKeyOrdering = JsonKeyOrdering.default(topKeys = List("@context", "@id", "@type", "reason", "details", "sourceId", "projectionId", "_total", "_results") diff --git a/delta/plugins/elasticsearch/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchPluginModule.scala b/delta/plugins/elasticsearch/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchPluginModule.scala index 69c8c432dc..a5eb5728bf 100644 --- a/delta/plugins/elasticsearch/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchPluginModule.scala +++ b/delta/plugins/elasticsearch/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchPluginModule.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import cats.effect.{Clock, IO} import ch.epfl.bluebrain.nexus.delta.kernel.utils.{ClasspathResourceLoader, UUIDF} import ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.client.ElasticSearchClient @@ -52,20 +52,17 @@ class ElasticSearchPluginModule(priority: Int) extends ModuleDef { make[HttpClient].named("elasticsearch-client").from { val httpConfig = HttpClientConfig.noRetry(true) - (as: ActorSystem[Nothing]) => HttpClient()(httpConfig, as.classicSystem) + (as: ActorSystem) => HttpClient()(httpConfig, as) } make[ElasticSearchClient].from { ( cfg: ElasticSearchViewsConfig, client: HttpClient @Id("elasticsearch-client"), - as: ActorSystem[Nothing], + as: ActorSystem, files: ElasticSearchFiles ) => - new ElasticSearchClient(client, cfg.base, cfg.maxIndexPathLength, files.emptyResults)( - cfg.credentials, - as.classicSystem - ) + new ElasticSearchClient(client, cfg.base, cfg.maxIndexPathLength, files.emptyResults)(cfg.credentials, as) } make[ValidateElasticSearchView].from { diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala index f729ddeaf6..81d97e061f 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.routes -import akka.actor.typed.ActorSystem import akka.http.scaladsl.model.headers.OAuth2BearerToken import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler} import ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.Fixtures @@ -38,12 +37,8 @@ class ElasticSearchViewsRoutesFixtures with CirceMarshalling with Fixtures { - import akka.actor.typed.scaladsl.adapter._ - val uuid: UUID = UUID.randomUUID() - implicit val typedSystem: ActorSystem[Nothing] = system.toTyped - implicit val ordering: JsonKeyOrdering = JsonKeyOrdering.default(topKeys = List("@context", "@id", "@type", "reason", "details", "sourceId", "projectionId", "_total", "_results") diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StoragePluginModule.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StoragePluginModule.scala index dd58b7448a..a69b342719 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StoragePluginModule.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StoragePluginModule.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.plugins.storage -import akka.actor.typed.ActorSystem +import akka.actor.ActorSystem import akka.http.scaladsl.model.Uri.Path import akka.http.scaladsl.server.Directives.concat import cats.effect.{Clock, IO} @@ -66,8 +66,8 @@ class StoragePluginModule(priority: Int) extends ModuleDef { make[ShowFileLocation].from { cfg: StorageTypeConfig => cfg.showFileLocation } - make[HttpClient].named("storage").from { (as: ActorSystem[Nothing]) => - HttpClient.noRetry(compression = false)(as.classicSystem) + make[HttpClient].named("storage").from { (as: ActorSystem) => + HttpClient.noRetry(compression = false)(as) } make[S3StorageClient].fromResource { (cfg: StoragePluginConfig) => @@ -174,8 +174,8 @@ class StoragePluginModule(priority: Int) extends ModuleDef { ScopedEventLog(Files.definition(clock), cfg.files.eventLog, xas) } - make[DiskFileOperations].from { (uuidF: UUIDF, as: ActorSystem[Nothing]) => - DiskFileOperations.mk(as.classicSystem, uuidF) + make[DiskFileOperations].from { (uuidF: UUIDF, as: ActorSystem) => + DiskFileOperations.mk(as, uuidF) } make[RemoteDiskFileOperations].from { (client: RemoteDiskStorageClient, uuidF: UUIDF) => @@ -183,8 +183,8 @@ class StoragePluginModule(priority: Int) extends ModuleDef { } make[S3FileOperations].from { - (client: S3StorageClient, locationGenerator: S3LocationGenerator, uuidF: UUIDF, as: ActorSystem[Nothing]) => - S3FileOperations.mk(client, locationGenerator)(as.classicSystem, uuidF) + (client: S3StorageClient, locationGenerator: S3LocationGenerator, uuidF: UUIDF, as: ActorSystem) => + S3FileOperations.mk(client, locationGenerator)(as, uuidF) } make[FileOperations].from { (disk: DiskFileOperations, remoteDisk: RemoteDiskFileOperations, s3: S3FileOperations) => @@ -208,7 +208,7 @@ class StoragePluginModule(priority: Int) extends ModuleDef { xas: Transactors, clock: Clock[IO], uuidF: UUIDF, - as: ActorSystem[Nothing], + as: ActorSystem, fileOps: FileOperations, mediaTypeDetector: MediaTypeDetector, linkFileAction: LinkFileAction @@ -216,7 +216,7 @@ class StoragePluginModule(priority: Int) extends ModuleDef { Files( fetchContext, fetchStorage, - FormDataExtractor(mediaTypeDetector)(as.classicSystem), + FormDataExtractor(mediaTypeDetector)(as), xas, cfg.files.eventLog, fileOps, @@ -304,11 +304,11 @@ class StoragePluginModule(priority: Int) extends ModuleDef { make[RemoteDiskStorageClient].from { ( client: HttpClient @Id("storage"), - as: ActorSystem[Nothing], + as: ActorSystem, authTokenProvider: AuthTokenProvider, cfg: StorageTypeConfig ) => - RemoteDiskStorageClient(client, authTokenProvider, cfg.remoteDisk)(as.classicSystem) + RemoteDiskStorageClient(client, authTokenProvider, cfg.remoteDisk)(as) } many[ServiceDependency].addSet { diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala index 1123a78697..93d04dcec3 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala @@ -256,7 +256,7 @@ object RemoteDiskStorageClient { authTokenProvider, config.defaultEndpoint, config.credentials - )(as.classicSystem) + )(as) } .getOrElse(RemoteDiskStorageClientDisabled) } diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/routes/StoragesRoutesSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/routes/StoragesRoutesSpec.scala index 694afea686..85bdfdbdf5 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/routes/StoragesRoutesSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/routes/StoragesRoutesSpec.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.routes -import akka.actor.typed.ActorSystem import akka.http.scaladsl.model.MediaTypes.`text/html` import akka.http.scaladsl.model.headers.{Accept, Location, OAuth2BearerToken} import akka.http.scaladsl.model.{StatusCodes, Uri} @@ -37,9 +36,6 @@ import org.scalatest.Assertion class StoragesRoutesSpec extends BaseRouteSpec with StorageFixtures with UUIDFFixtures.Random { - import akka.actor.typed.scaladsl.adapter._ - implicit private val typedSystem: ActorSystem[Nothing] = system.toTyped - // TODO: sort out how we handle this in tests implicit override def rcr: RemoteContextResolution = RemoteContextResolution.fixedIO(