Skip to content

Commit

Permalink
ci: fix scala-steward after moving repo to hyperledger (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro authored May 1, 2024
1 parent a002269 commit a9a2c6f
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.7.17
343e8a9fc72b5bb036ff5de7d78e4ca661d3daeb
5 changes: 0 additions & 5 deletions .github/.scala-steward.conf

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Scala Steward Workflow
# This workflow will launch at 00:00 every Sunday
on:
schedule:
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
Expand All @@ -24,9 +24,9 @@ jobs:
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github-token: ${{ secrets.ATALA_GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
sign-commits: true
author-email: ${{ steps.import_gpg.outputs.email }}
author-name: ${{ steps.import_gpg.outputs.name }}
Expand Down
12 changes: 12 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
buildRoots = [ "." ]

pullRequests.grouping = [
{ name = "all", title = "build: scala-steward dependency updates", "filter" = [{"group" = "*"}] }
]

updates.ignore = [
# { groupId = "com.softwaremill.sttp.tapir", artifactId = "tapir-json-zio" }, #TODO
{ groupId = "com.github.dasniko", artifactId = "testcontainers-keycloak" }, #TODO
{ groupId = "org.keycloak", artifactId = "keycloak-authz-client" }, #TODO
{ groupId = "dev.zio", artifactId = "zio-interop-cats" } #TODO
]
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.10
version = 3.7.17
runner.dialect = scala3

maxColumn = 120
Expand Down
65 changes: 34 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,54 +44,57 @@ inThisBuild(
)

lazy val V = new {
val munit = "1.0.0-M8" // "0.7.29"
val munitZio = "0.1.1"
val munit = "1.0.0-RC1" // "0.7.29"
val munitZio = "0.2.0"

// https://mvnrepository.com/artifact/dev.zio/zio
val zio = "2.0.18"
val zio = "2.0.22"
val zioConfig = "4.0.1"
val zioLogging = "2.1.16"
val zioJson = "0.3.0"
val zioHttp = "3.0.0-RC4"
val zioCatsInterop = "3.3.0"
val zioMetricsConnector = "2.1.0"
val zioMock = "1.0.0-RC11"
val mockito = "3.2.16.0"
val monocle = "3.1.0"
val zioLogging = "2.1.17"
val zioJson = "0.6.2"
val zioHttp = "3.0.0-RC6"
val zioCatsInterop = "3.3.0" // TODO "23.1.0.2" // https://mvnrepository.com/artifact/dev.zio/zio-interop-cats
val zioMetricsConnector = "2.3.1"
val zioMock = "1.0.0-RC12"
val mockito = "3.2.18.0"
val monocle = "3.2.0"

// https://mvnrepository.com/artifact/io.circe/circe-core
val circe = "0.14.6"
val circe = "0.14.7"

val tapir = "1.6.4"
val tapir = "1.6.4" // scala-steward:off // TODO "1.10.5"
val http4sBlaze = "0.23.15" // scala-steward:off // TODO "0.23.16"

val typesafeConfig = "1.4.2"
val typesafeConfig = "1.4.3"
val protobuf = "3.1.9"
val testContainersScala = "0.41.0"
val testContainersScala = "0.41.3"
val testContainersJavaKeycloak = "3.2.0" // scala-steward:off

val doobie = "1.0.0-RC2"
val quill = "4.7.3"
val flyway = "9.8.3"
val postgresDriver = "42.2.27"
val logback = "1.4.8"
val slf4j = "2.0.7"
val flyway = "9.22.3"
val postgresDriver = "42.2.29"
val logback = "1.4.14"
val slf4j = "2.0.13"

val prismSdk = "1.4.1" // scala-steward:off
val scalaUri = "4.0.3"

val jwtCirceVersion = "9.1.2"
val zioPreludeVersion = "1.0.0-RC16"
val jwtCirceVersion = "9.4.6"
val zioPreludeVersion = "1.0.0-RC24"

val apollo = "1.2.14"
val bouncyCastle = "1.70"
val bouncyCastle = "1.78.1"

val jsonSchemaValidator = "1.3.2"
val jsonSchemaValidator = "1.3.2" // scala-steward:off //TODO 1.3.2 need to fix:
// [error] org.hyperledger.identus.pollux.core.model.schema.AnoncredSchemaTypeSpec
// [error] org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaSpec

val vaultDriver = "6.2.0"
val micrometer = "1.11.2"
val micrometer = "1.11.11"

val nimbusJwt = "10.0.0"
val keycloak = "23.0.7" // scala-steward:off
val keycloak = "23.0.7" // scala-steward:off //TODO 24.0.3 // update all quay.io/keycloak/keycloak

}

Expand Down Expand Up @@ -123,7 +126,7 @@ lazy val D = new {
val scodecBits: ModuleID = "org.scodec" %% "scodec-bits" % "1.1.38"

// https://mvnrepository.com/artifact/org.didcommx/didcomm/0.3.2
val didcommx: ModuleID = "org.didcommx" % "didcomm" % "0.3.1"
val didcommx: ModuleID = "org.didcommx" % "didcomm" % "0.3.2"
val peerDidcommx: ModuleID = "org.didcommx" % "peerdid" % "0.5.0"
val didScala: ModuleID = "app.fmgp" %% "did" % "0.0.0+113-61efa271-SNAPSHOT"

Expand Down Expand Up @@ -170,8 +173,8 @@ lazy val D = new {
)
// Added here to make prism-crypto works.
// Once migrated to apollo, re-evaluate if this should be removed.
val bouncyBcpkix = "org.bouncycastle" % "bcpkix-jdk15on" % V.bouncyCastle
val bouncyBcprov = "org.bouncycastle" % "bcprov-jdk15on" % V.bouncyCastle
val bouncyBcpkix = "org.bouncycastle" % "bcpkix-jdk18on" % V.bouncyCastle
val bouncyBcprov = "org.bouncycastle" % "bcprov-jdk18on" % V.bouncyCastle

// LIST of Dependencies
val doobieDependencies: Seq[ModuleID] =
Expand Down Expand Up @@ -311,7 +314,7 @@ lazy val D_Pollux = new {

lazy val D_Pollux_VC_JWT = new {

private lazy val circeJsonSchema = ("net.reactivecore" %% "circe-json-schema" % "0.3.0")
private lazy val circeJsonSchema = ("net.reactivecore" %% "circe-json-schema" % "0.4.1")
.cross(CrossVersion.for3Use2_13)
.exclude("io.circe", "circe-core_2.13")
.exclude("io.circe", "circe-generic_2.13")
Expand Down Expand Up @@ -360,13 +363,13 @@ lazy val D_CloudAgent = new {

val tapirZioHttpServer = "com.softwaremill.sttp.tapir" %% "tapir-zio-http-server" % V.tapir
val tapirHttp4sServerZio = "com.softwaremill.sttp.tapir" %% "tapir-http4s-server-zio" % V.tapir
val http4sBlazeServer = "org.http4s" %% "http4s-blaze-server" % "0.23.12"
val http4sBlazeServer = "org.http4s" %% "http4s-blaze-server" % V.http4sBlaze

val tapirRedocBundle = "com.softwaremill.sttp.tapir" %% "tapir-redoc-bundle" % V.tapir

val tapirSttpStubServer =
"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % V.tapir % Test
val sttpClient3ZioJson = "com.softwaremill.sttp.client3" %% "zio-json" % "3.8.3" % Test
val sttpClient3ZioJson = "com.softwaremill.sttp.client3" %% "zio-json" % "3.8.16" % Test

val quillDoobie =
"io.getquill" %% "quill-doobie" % V.quill exclude ("org.scala-lang.modules", "scala-java8-compat_3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import zio.test.TestAspect.*

import java.util.UUID

/* testOnly org.hyperledger.identus.iam.authorization.keycloak.admin.KeycloakPermissionManagementServiceSpec */
object KeycloakPermissionManagementServiceSpec
extends ZIOSpecDefault
with KeycloakTestContainerSupport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ object MediateGrant {
* FIXME https://github.com/roots-id/didcomm-mediator/issues/17
*/
final case class Body(routing_did: String) // Seq[String])

object Body {
given Encoder[Body] = deriveEncoder[Body]
given Decoder[Body] = deriveDecoder[Body]
}
}

final case class KeylistUpdate(id: String, `type`: PIURI, body: KeylistUpdate.Body) {
Expand All @@ -51,6 +56,11 @@ object KeylistUpdate {

final case class Body(updates: Seq[Update])

object Body {
given Encoder[Body] = deriveEncoder[Body]
given Decoder[Body] = deriveDecoder[Body]
}

/** @param recipient_did
* DID subject of the update.
* @param action
Expand All @@ -60,6 +70,10 @@ object KeylistUpdate {
enum Action:
case add extends Action
case remove extends Action
object Action {
given Encoder[Action] = deriveEncoder[Action]
given Decoder[Action] = deriveDecoder[Action]
}
}

final case class KeylistResponse(id: String, `type`: PIURI, body: KeylistResponse.Body) {
Expand All @@ -74,6 +88,11 @@ object KeylistResponse {

final case class Body(updated: Seq[Update])

object Body {
given Encoder[Body] = deriveEncoder[Body]
given Decoder[Body] = deriveDecoder[Body]
}

/** @param recipient_did
* DID subject of the update.
* @param action
Expand All @@ -85,11 +104,20 @@ object KeylistResponse {
enum Action:
case add extends Action
case remove extends Action
object Action {
given Encoder[Action] = deriveEncoder[Action]
given Decoder[Action] = deriveDecoder[Action]
}

enum Result:
case client_error extends Result
case server_error extends Result
case no_change extends Result
case success extends Result
object Result {
given Encoder[Result] = deriveEncoder[Result]
given Decoder[Result] = deriveDecoder[Result]
}
}

final case class KeylistQuery(id: String, `type`: PIURI, body: KeylistQuery.Body) {
Expand All @@ -102,6 +130,14 @@ object KeylistQuery {

final case class Body(paginate: Option[Paginate] = None)
final case class Paginate(limit: Int, offset: Int)
object Body {
given Encoder[Body] = deriveEncoder[Body]
given Decoder[Body] = deriveDecoder[Body]
}
object Paginate {
given Encoder[Paginate] = deriveEncoder[Paginate]
given Decoder[Paginate] = deriveDecoder[Paginate]
}
}

final case class Keylist(id: String, `type`: PIURI, body: Keylist.Body) {
Expand All @@ -117,4 +153,17 @@ object Keylist {
final case class Body(keys: Seq[Key], pagination: Option[Pagination])
final case class Key(recipient_did: String)
final case class Pagination(count: Int, offset: Int, remaining: Int)

object Body {
given Encoder[Body] = deriveEncoder[Body]
given Decoder[Body] = deriveDecoder[Body]
}
object Key {
given Encoder[Key] = deriveEncoder[Key]
given Decoder[Key] = deriveDecoder[Key]
}
object Pagination {
given Encoder[Pagination] = deriveEncoder[Pagination]
given Decoder[Pagination] = deriveDecoder[Pagination]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ object CredentialPreview {

case class CredentialPreviewBody(attributes: Seq[Attribute])

object CredentialPreviewBody {
given Encoder[CredentialPreviewBody] = deriveEncoder[CredentialPreviewBody]
given Decoder[CredentialPreviewBody] = deriveDecoder[CredentialPreviewBody]
}

/** @param name
* name key maps to the attribute name as a string.
* @param media_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ class JdbcCredentialRepository(xa: Transactor[ContextAwareTask], xb: Transactor[
case Nil =>
connection.pure(Nil)
case head +: tail =>
val nel = NonEmptyList.of(head, tail: _*)
val inClauseFragment = Fragments.in(fr"protocol_state", nel)
val conditionFragment = Fragments.andOpt(
Some(inClauseFragment),
Option.when(ignoreWithZeroRetries)(fr"meta_retries > 0")
)
val conditionFragment = {
val nel = NonEmptyList.of(head, tail: _*)
val inClauseFragment = Fragments.in(fr"protocol_state", nel)
if (!ignoreWithZeroRetries) inClauseFragment
else Fragments.and(inClauseFragment, fr"meta_retries > 0")
}
val cxnIO = sql"""
| SELECT
| id,
Expand Down
3 changes: 1 addition & 2 deletions project/LicenseReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class LicenseReportCustomDependencyResolution(ivyConfiguration: IvyConfiguration
log.warn(":::::::::::::::::::::::::::::::::::::::::::::::::::")
log.warn(":: LicenseReport Unresolved Dependencies ::")
log.warn(":::::::::::::::::::::::::::::::::::::::::::::::::::")
resolveException
.failed
resolveException.failed
.map(_.toString())
.distinct
.sorted
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.7
sbt.version=1.9.9
5 changes: 4 additions & 1 deletion project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Using unreleased plugin from 'main' which accepts DependencyResolution interface for building license report.
lazy val sbtLicenseReportPlugin = ProjectRef(uri("https://github.com/sbt/sbt-license-report.git#9675cedb19c794de1119cbcf46a255fc8dcd5d4e"), "sbt-license-report")
lazy val sbtLicenseReportPlugin = ProjectRef(
uri("https://github.com/sbt/sbt-license-report.git#9675cedb19c794de1119cbcf46a255fc8dcd5d4e"),
"sbt-license-report"
)

lazy val root = (project in file(".")).dependsOn(sbtLicenseReportPlugin)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import cats.effect.kernel.Resource
import cats.effect.std.Dispatcher
import com.zaxxer.hikari.HikariConfig
import doobie.hikari.HikariTransactor
import doobie.util.log.LogHandler
import doobie.util.ExecutionContexts
import doobie.util.transactor.Transactor
import zio.*
Expand All @@ -17,6 +18,7 @@ object TransactorLayer {
ZIO.service[DbConfig].flatMap { config =>
// Here we use `Dispatcher.apply`
// but at the agent level it is `Dispatcher.parallel` due to evicted version
// Dispatcher.parallel[Task].allocated.map { case (dispatcher, _) =>
Dispatcher[Task].allocated.map { case (dispatcher, _) =>
given Dispatcher[Task] = dispatcher
TransactorLayer.hikari[Task](config)
Expand All @@ -32,6 +34,7 @@ object TransactorLayer {

// Here we use `Dispatcher.apply`
// but at the agent level it is `Dispatcher.parallel` due to evicted version
// Dispatcher.parallel[ContextAwareTask].allocated.map { case (dispatcher, _) =>
Dispatcher[ContextAwareTask].allocated.map { case (dispatcher, _) =>
given Dispatcher[ContextAwareTask] = dispatcher
TransactorLayer.hikari[ContextAwareTask](config)
Expand All @@ -41,6 +44,7 @@ object TransactorLayer {
}

def hikari[A[_]: Async: Dispatcher](config: DbConfig)(using tag: Tag[Transactor[A]]): TaskLayer[Transactor[A]] = {

val transactorLayerZio = ZIO
.attempt {
// https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
Expand All @@ -58,6 +62,7 @@ object TransactorLayer {
// transaction EC. Everything will be closed and shut down cleanly after use.
ec <- ExecutionContexts.fixedThreadPool[A](config.awaitConnectionThreads) // our connect EC
xa <- HikariTransactor.fromHikariConfig[A](hikariConfig, ec)
// xa <- HikariTransactor.fromHikariConfig[A](hikariConfig, Some(LogHandler.jdkLogHandler))
} yield xa

pool.toManaged.toLayer[Transactor[A]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
version: "3.8"

services:

keycloak:
image: quay.io/keycloak/keycloak:23.0.7
ports:
Expand Down

0 comments on commit a9a2c6f

Please sign in to comment.