Skip to content

Commit

Permalink
Migrate to Pekko
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed Feb 12, 2024
1 parent 24f07a9 commit abf2e20
Show file tree
Hide file tree
Showing 43 changed files with 199 additions and 198 deletions.
42 changes: 21 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lazy val template = project
libraryDependencies ++= Seq(
"com.github.nscala-time" %% "nscala-time" % V.nscalaTime,
"com.typesafe" % "config" % "1.4.3",
"com.typesafe.akka" %% "akka-http-core" % V.akkaHttp,
"org.apache.pekko" %% "pekko-http-core" % V.pekkoHttp,
"org.scalatest" %% "scalatest" % V.scalatest % Test
)
)
Expand All @@ -67,9 +67,9 @@ lazy val infra = project
libraryDependencies ++= Seq(
"com.sksamuel.elastic4s" %% "elastic4s-client-esjava" % V.elastic4s,
"org.flywaydb" % "flyway-core" % "8.5.13", // for database migration
"com.typesafe.akka" %% "akka-stream" % V.akka,
"com.typesafe.akka" %% "akka-http" % V.akkaHttp,
"de.heikoseeberger" %% "akka-http-circe" % "1.39.2",
"org.apache.pekko" %% "pekko-stream" % V.pekko,
"org.apache.pekko" %% "pekko-http" % V.pekkoHttp,
"com.github.pjfanning" %% "pekko-http-circe" % "2.3.4",
"io.get-coursier" %% "coursier" % V.coursier,
"io.get-coursier" %% "coursier-sbt-maven-repository" % V.coursier,
"org.tpolecat" %% "doobie-scalatest" % V.doobie % Test,
Expand Down Expand Up @@ -161,16 +161,16 @@ lazy val server = project
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
"com.typesafe.play" %%% "play-json" % V.playJson,
"org.scalatest" %% "scalatest" % V.scalatest % "test,it",
"com.typesafe.akka" %% "akka-testkit" % V.akka % "test,it",
"com.typesafe.akka" %% "akka-slf4j" % V.akka,
"com.typesafe.akka" %% "akka-serialization-jackson" % V.akka,
"com.typesafe.akka" %% "akka-actor-typed" % V.akka,
"com.typesafe.akka" %% "akka-stream-testkit" % V.akka % Test,
"com.typesafe.akka" %% "akka-http-testkit" % V.akkaHttp % Test,
"ch.megard" %% "akka-http-cors" % "1.2.0",
"com.softwaremill.akka-http-session" %% "core" % "0.7.1",
"com.typesafe.akka" %% "akka-http" % V.akkaHttp,
"org.endpoints4s" %% "akka-http-server" % "7.2.0",
"org.apache.pekko" %% "pekko-testkit" % V.pekko % "test,it",
"org.apache.pekko" %% "pekko-slf4j" % V.pekko,
"org.apache.pekko" %% "pekko-serialization-jackson" % V.pekko,
"org.apache.pekko" %% "pekko-actor-typed" % V.pekko,
"org.apache.pekko" %% "pekko-stream-testkit" % V.pekko % Test,
"org.apache.pekko" %% "pekko-http-testkit" % V.pekkoHttp % Test,
"org.apache.pekko" %% "pekko-http-cors" % V.pekkoHttp,
"com.softwaremill.pekko-http-session" %% "core" % "0.7.1",
"org.apache.pekko" %% "pekko-http" % V.pekkoHttp,
"org.endpoints4s" %% "pekko-http-server" % "1.0.1",
"org.webjars" % "bootstrap-sass" % "3.4.1",
"org.webjars" % "bootstrap-switch" % "3.3.4",
"org.webjars" % "bootstrap-select" % "1.13.18",
Expand Down Expand Up @@ -221,14 +221,14 @@ lazy val data = project
loggingSettings,
libraryDependencies ++= Seq(
"com.github.nscala-time" %% "nscala-time" % V.nscalaTime,
"com.typesafe.akka" %% "akka-stream" % V.akka,
"com.typesafe.akka" %% "akka-actor-typed" % V.akka,
"com.typesafe.akka" %% "akka-serialization-jackson" % V.akka,
"com.typesafe.akka" %% "akka-slf4j" % V.akka,
"org.apache.pekko" %% "pekko-stream" % V.pekko,
"org.apache.pekko" %% "pekko-actor-typed" % V.pekko,
"org.apache.pekko" %% "pekko-serialization-jackson" % V.pekko,
"org.apache.pekko" %% "pekko-slf4j" % V.pekko,
"org.apache.maven" % "maven-model-builder" % "3.9.5",
"org.jsoup" % "jsoup" % "1.17.2",
"org.apache.ivy" % "ivy" % "2.5.2",
"com.typesafe.akka" %% "akka-http" % V.akkaHttp,
"org.apache.pekko" %% "pekko-http" % V.pekkoHttp,
"org.json4s" %% "json4s-native" % V.json4s,
"org.scalatest" %% "scalatest" % V.scalatest % Test
),
Expand All @@ -242,8 +242,8 @@ lazy val data = project
lazy val V = new {
val doobie = "0.13.4"
val playJson = "2.9.4"
val akka = "2.6.18"
val akkaHttp = "10.2.10"
val pekko = "1.0.2"
val pekkoHttp = "1.0.1"
val elastic4s = "8.11.5"
val nscalaTime = "2.32.0"
val scalatest = "3.2.17"
Expand Down
2 changes: 1 addition & 1 deletion modules/data/src/main/scala/scaladex/data/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.sys.process.Process

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import cats.effect._
import com.typesafe.scalalogging.LazyLogging
import doobie.hikari._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scaladex.infra

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import org.scalatest.funspec.AsyncFunSpec
import org.scalatest.matchers.should.Matchers
import scaladex.core.model.Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import scala.util.Failure
import scala.util.Success
import scala.util.Try

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.HttpResponse
import akka.stream.OverflowStrategy
import akka.stream.QueueOfferResult
import akka.stream.scaladsl.Flow
import akka.stream.scaladsl.Keep
import akka.stream.scaladsl.Sink
import akka.stream.scaladsl.Source
import akka.stream.scaladsl.SourceQueueWithComplete
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.model.HttpRequest
import org.apache.pekko.http.scaladsl.model.HttpResponse
import org.apache.pekko.stream.OverflowStrategy
import org.apache.pekko.stream.QueueOfferResult
import org.apache.pekko.stream.scaladsl.Flow
import org.apache.pekko.stream.scaladsl.Keep
import org.apache.pekko.stream.scaladsl.Sink
import org.apache.pekko.stream.scaladsl.Source
import org.apache.pekko.stream.scaladsl.SourceQueueWithComplete
import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport

abstract class CommonAkkaHttpClient(implicit system: ActorSystem) extends FailFastCirceSupport {

Expand Down
36 changes: 18 additions & 18 deletions modules/infra/src/main/scala/scaladex/infra/GithubClientImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import scala.concurrent.Promise
import scala.concurrent.duration.DurationInt
import scala.util.Try

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.ContentTypes
import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.model.HttpHeader
import akka.http.scaladsl.model.HttpMethods
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.ResponseEntity
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.Uri
import akka.http.scaladsl.model.headers.Authorization
import akka.http.scaladsl.model.headers.OAuth2BearerToken
import akka.http.scaladsl.model.headers.RawHeader
import akka.http.scaladsl.settings.ConnectionPoolSettings
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Flow
import akka.util.ByteString
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.model.ContentTypes
import org.apache.pekko.http.scaladsl.model.HttpEntity
import org.apache.pekko.http.scaladsl.model.HttpHeader
import org.apache.pekko.http.scaladsl.model.HttpMethods
import org.apache.pekko.http.scaladsl.model.HttpRequest
import org.apache.pekko.http.scaladsl.model.HttpResponse
import org.apache.pekko.http.scaladsl.model.ResponseEntity
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.model.Uri
import org.apache.pekko.http.scaladsl.model.headers.Authorization
import org.apache.pekko.http.scaladsl.model.headers.OAuth2BearerToken
import org.apache.pekko.http.scaladsl.model.headers.RawHeader
import org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings
import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal
import org.apache.pekko.stream.scaladsl.Flow
import org.apache.pekko.util.ByteString
import cats.implicits.toTraverseOps
import com.typesafe.scalalogging.LazyLogging
import io.circe.Json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import scala.concurrent.Promise
import scala.util.Try
import scala.util.control.NonFatal

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.settings.ConnectionPoolSettings
import akka.http.scaladsl.unmarshalling.Unmarshaller
import akka.stream.scaladsl.Flow
import akka.util.ByteString
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.model
import org.apache.pekko.http.scaladsl.model.HttpRequest
import org.apache.pekko.http.scaladsl.model.HttpResponse
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings
import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshaller
import org.apache.pekko.stream.scaladsl.Flow
import org.apache.pekko.util.ByteString
import com.typesafe.scalalogging.LazyLogging
import scaladex.core.model.Artifact
import scaladex.core.model.Artifact.MavenReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scaladex.infra

import java.time.Instant

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import org.scalatest.funspec.AsyncFunSpec
import org.scalatest.matchers.should.Matchers
import scaladex.core.model.Artifact
Expand Down
4 changes: 2 additions & 2 deletions modules/server/src/it/scala/scaladex/RelevanceTest.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package scaladex

import scala.concurrent.Future
import akka.actor.ActorSystem
import akka.testkit.TestKit
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.testkit.TestKit
import org.scalatest.Assertion
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funsuite.AsyncFunSuiteLike
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package scaladex.server
import scala.collection.concurrent.TrieMap
import scala.concurrent.Future

import akka.actor.ActorSystem
import akka.http.scaladsl._
import akka.http.scaladsl.model.HttpMethods.POST
import akka.http.scaladsl.model.Uri._
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers._
import akka.http.scaladsl.unmarshalling.Unmarshal
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl._
import org.apache.pekko.http.scaladsl.model.HttpMethods.POST
import org.apache.pekko.http.scaladsl.model.Uri._
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.http.scaladsl.model.headers._
import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal
import com.typesafe.scalalogging.LazyLogging
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport
import io.circe.Json
import scaladex.core.model.GithubResponse
import scaladex.core.model.UserInfo
Expand Down
10 changes: 5 additions & 5 deletions modules/server/src/main/scala/scaladex/server/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import scala.util.Failure
import scala.util.Success
import scala.util.control.NonFatal

import akka.actor.ActorSystem
import akka.http.scaladsl._
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server._
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl._
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server._
import cats.effect.ContextShift
import cats.effect.IO
import com.typesafe.scalalogging.LazyLogging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package scaladex.server

// https://github.com/btomala/akka-http-twirl

import akka.http.scaladsl.marshalling.Marshaller
import akka.http.scaladsl.marshalling.ToEntityMarshaller
import akka.http.scaladsl.model.MediaType
import akka.http.scaladsl.model.MediaTypes._
import org.apache.pekko.http.scaladsl.marshalling.Marshaller
import org.apache.pekko.http.scaladsl.marshalling.ToEntityMarshaller
import org.apache.pekko.http.scaladsl.model.MediaType
import org.apache.pekko.http.scaladsl.model.MediaTypes._
import play.twirl.api.Html
import play.twirl.api.Txt
import play.twirl.api.Xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scaladex.server.config

import com.softwaremill.session.SessionConfig
import com.softwaremill.pekkohttpsession.SessionConfig
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import scaladex.core.model.Env
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package scaladex.server.route
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.Uri
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.model.Uri
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.Route
import scaladex.core.model.Artifact
import scaladex.core.model.Env
import scaladex.core.model.Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package scaladex.server.route
import scala.concurrent.ExecutionContext
import scala.util.Success

import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.Route
import com.typesafe.scalalogging.LazyLogging
import scaladex.core.model.Env
import scaladex.core.model.UserState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scaladex.server.route

import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.Route

object Assets {
val routes: Route =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import java.util.UUID
import scala.util.Success
import scala.util.Try

import akka.actor.ActorSystem
import akka.http.scaladsl.model.StatusCodes.TemporaryRedirect
import akka.http.scaladsl.model.Uri.Query
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.Referer
import akka.http.scaladsl.server.Directive1
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import com.softwaremill.session.CsrfDirectives._
import com.softwaremill.session.CsrfOptions._
import com.softwaremill.session.SessionConfig
import com.softwaremill.session.SessionDirectives._
import com.softwaremill.session.SessionManager
import com.softwaremill.session.SessionOptions._
import com.softwaremill.session.SessionSerializer
import com.softwaremill.session.SingleValueSessionSerializer
import com.softwaremill.session.javadsl.InMemoryRefreshTokenStorage
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl.model.StatusCodes.TemporaryRedirect
import org.apache.pekko.http.scaladsl.model.Uri.Query
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.http.scaladsl.model.headers.Referer
import org.apache.pekko.http.scaladsl.server.Directive1
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.Route
import com.softwaremill.pekkohttpsession.CsrfDirectives._
import com.softwaremill.pekkohttpsession.CsrfOptions._
import com.softwaremill.pekkohttpsession.SessionConfig
import com.softwaremill.pekkohttpsession.SessionDirectives._
import com.softwaremill.pekkohttpsession.SessionManager
import com.softwaremill.pekkohttpsession.SessionOptions._
import com.softwaremill.pekkohttpsession.SessionSerializer
import com.softwaremill.pekkohttpsession.SingleValueSessionSerializer
import com.softwaremill.pekkohttpsession.javadsl.InMemoryRefreshTokenStorage
import com.typesafe.scalalogging.LazyLogging
import scaladex.core.model.UserState
import scaladex.core.service.GithubAuth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package scaladex.server.route
import scala.concurrent.ExecutionContext
import scala.concurrent.Future

import akka.http.scaladsl.server.Directive1
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.PathMatcher1
import akka.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.server.Directive1
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.PathMatcher1
import org.apache.pekko.http.scaladsl.server.Route
import play.twirl.api.Html
import scaladex.core.model.Category
import scaladex.core.model.Env
Expand Down
14 changes: 7 additions & 7 deletions modules/server/src/main/scala/scaladex/server/route/Badges.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package scaladex.server.route
import scala.concurrent.ExecutionContext
import scala.concurrent.Future

import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.headers.CacheDirectives._
import akka.http.scaladsl.model.headers._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.RequestContext
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.server.RouteResult
import org.apache.pekko.http.scaladsl.model.StatusCodes._
import org.apache.pekko.http.scaladsl.model.headers.CacheDirectives._
import org.apache.pekko.http.scaladsl.model.headers._
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.RequestContext
import org.apache.pekko.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.server.RouteResult
import scaladex.core.model.Artifact
import scaladex.core.model.ArtifactSelection
import scaladex.core.model.BinaryVersion
Expand Down
Loading

0 comments on commit abf2e20

Please sign in to comment.