diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..d29bd126 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,4 @@ +# Scala Steward: Reformat with scalafmt 3.8.6 +dafb4253a1caafadc35472efab12e9d6e23671a9 +# bpholt: run prePR after cherry-picking a bunch of otherwise failing update PRs +c47bdbdcabdb6bdeb67e75f777f35a32265cd7b5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a304ccb2..36174d9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: timeout-minutes: 60 steps: - name: Checkout current branch (full) - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -60,7 +60,7 @@ jobs: - name: Setup Java (corretto@11) id: setup-java-corretto-11 if: matrix.java == 'corretto@11' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 11 @@ -73,7 +73,7 @@ jobs: - name: Setup Java (corretto@17) id: setup-java-corretto-17 if: matrix.java == 'corretto@17' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 17 @@ -141,7 +141,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -151,7 +151,7 @@ jobs: - name: Setup Java (corretto@11) id: setup-java-corretto-11 if: matrix.java == 'corretto@11' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 11 @@ -164,7 +164,7 @@ jobs: - name: Setup Java (corretto@17) id: setup-java-corretto-17 if: matrix.java == 'corretto@17' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 17 @@ -258,7 +258,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -268,7 +268,7 @@ jobs: - name: Setup Java (corretto@11) id: setup-java-corretto-11 if: matrix.java == 'corretto@11' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 11 @@ -281,7 +281,7 @@ jobs: - name: Setup Java (corretto@17) id: setup-java-corretto-17 if: matrix.java == 'corretto@17' - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: corretto java-version: 17 diff --git a/.scalafmt.conf b/.scalafmt.conf index fd94731d..ebfd9826 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.3 +version = 3.8.6 runner.dialect = Scala213Source3 fileOverride { diff --git a/build.sbt b/build.sbt index 813e58c0..0243805a 100644 --- a/build.sbt +++ b/build.sbt @@ -46,18 +46,18 @@ ThisBuild / githubWorkflowBuildPreamble += ) val Scala212 = "2.12.20" -val Scala213 = "2.13.16" -val Scala3 = "3.3.4" +val Scala213 = "2.13.17" +val Scala3 = "3.3.6" ThisBuild / crossScalaVersions := Seq(Scala212, Scala3, Scala213) -val catsEffectVersion = "3.5.4" -val circeVersion = "0.14.10" -val fs2Version = "3.11.0" -val http4sVersion = "0.23.28" -val natchezVersion = "0.3.6" -val munitVersion = "0.7.29" -val munitCEVersion = "1.0.7" -val scalacheckEffectVersion = "1.0.4" +val catsEffectVersion = "3.5.7" +val circeVersion = "0.14.15" +val fs2Version = "3.12.2" +val http4sVersion = "0.23.32" +val natchezVersion = "0.3.8" +val munitVersion = "1.2.0" +val munitCEVersion = "2.1.0" +val scalacheckEffectVersion = "2.1.0-RC1" lazy val commonSettings = Seq( crossScalaVersions := Seq(Scala3, Scala213) @@ -92,10 +92,10 @@ lazy val lambda = crossProject(JSPlatform, JVMPlatform) "org.tpolecat" %%% "natchez-core" % natchezVersion, "io.circe" %%% "circe-scodec" % circeVersion, "io.circe" %%% "circe-jawn" % circeVersion, - "com.comcast" %%% "ip4s-core" % "3.6.0", - "org.scodec" %%% "scodec-bits" % "1.2.1", + "com.comcast" %%% "ip4s-core" % "3.7.0", + "org.scodec" %%% "scodec-bits" % "1.2.4", "org.scalameta" %%% "munit-scalacheck" % munitVersion % Test, - "org.typelevel" %%% "munit-cats-effect-3" % munitCEVersion % Test, + "org.typelevel" %%% "munit-cats-effect" % munitCEVersion % Test, "io.circe" %%% "circe-literal" % circeVersion % Test ), mimaBinaryIssueFilters ++= Seq( @@ -113,7 +113,7 @@ lazy val lambda = crossProject(JSPlatform, JVMPlatform) .jvmSettings( Test / fork := true, libraryDependencies ++= Seq( - "com.amazonaws" % "aws-lambda-java-core" % "1.2.3", + "com.amazonaws" % "aws-lambda-java-core" % "1.4.0", "co.fs2" %%% "fs2-io" % fs2Version ) ) @@ -165,10 +165,10 @@ lazy val lambdaCloudFormationCustomResource = crossProject(JSPlatform, JVMPlatfo "org.http4s" %%% "http4s-circe" % http4sVersion, "org.http4s" %%% "http4s-dsl" % http4sVersion % Test, "org.scalameta" %%% "munit-scalacheck" % munitVersion % Test, - "org.typelevel" %%% "munit-cats-effect-3" % munitCEVersion % Test, + "org.typelevel" %%% "munit-cats-effect" % munitCEVersion % Test, "org.typelevel" %%% "scalacheck-effect" % scalacheckEffectVersion % Test, "org.typelevel" %%% "scalacheck-effect-munit" % scalacheckEffectVersion % Test, - "com.eed3si9n.expecty" %%% "expecty" % "0.16.0" % Test, + "com.eed3si9n.expecty" %%% "expecty" % "0.17.0" % Test, "io.circe" %%% "circe-testing" % circeVersion % Test ) ) @@ -182,7 +182,7 @@ lazy val examples = crossProject(JSPlatform, JVMPlatform) "org.http4s" %%% "http4s-dsl" % http4sVersion, "org.http4s" %%% "http4s-ember-client" % http4sVersion, "org.tpolecat" %%% "natchez-xray" % natchezVersion, - "org.tpolecat" %%% "natchez-http4s" % "0.6.0", + "org.tpolecat" %%% "natchez-http4s" % "0.6.1", "org.tpolecat" %%% "skunk-core" % "0.6.4" ) ) @@ -195,7 +195,7 @@ lazy val examples = crossProject(JSPlatform, JVMPlatform) ) .jvmSettings( libraryDependencies ++= Seq( - "com.google.cloud.functions.invoker" % "java-function-invoker" % "1.3.1" + "com.google.cloud.functions.invoker" % "java-function-invoker" % "1.3.3" ) ) .enablePlugins(NoPublishPlugin) @@ -248,7 +248,7 @@ lazy val googleCloudHttp4s = crossProject(JSPlatform, JVMPlatform) "org.scodec" %%% "scodec-bits" % "1.2.0", "org.http4s" %%% "http4s-server" % http4sVersion, "org.scalameta" %%% "munit-scalacheck" % munitVersion % Test, - "org.typelevel" %%% "munit-cats-effect-3" % munitCEVersion % Test + "org.typelevel" %%% "munit-cats-effect" % munitCEVersion % Test ), tlVersionIntroduced := List("2.13", "3").map(_ -> "0.3.1").toMap ) @@ -261,7 +261,7 @@ lazy val googleCloudHttp4s = crossProject(JSPlatform, JVMPlatform) .jvmSettings( Test / fork := true, libraryDependencies ++= Seq( - "com.google.cloud.functions" % "functions-framework-api" % "1.1.0" % Provided, + "com.google.cloud.functions" % "functions-framework-api" % "1.1.4" % Provided, "co.fs2" %%% "fs2-io" % fs2Version ) ) diff --git a/lambda/js/src/main/scala/feral/lambda/ContextPlatform.scala b/lambda/js/src/main/scala/feral/lambda/ContextPlatform.scala index ddb1176a..8ebd55f0 100644 --- a/lambda/js/src/main/scala/feral/lambda/ContextPlatform.scala +++ b/lambda/js/src/main/scala/feral/lambda/ContextPlatform.scala @@ -36,32 +36,29 @@ private[lambda] trait ContextCompanionPlatform { context.identity.toOption.map { identity => CognitoIdentity(identity.cognitoIdentityId, identity.cognitoIdentityPoolId) }, - context - .clientContext - .toOption - .map { clientContext => - ClientContext( - ClientContextClient( - clientContext.client.installationId, - clientContext.client.appTitle, - clientContext.client.appVersionName, - clientContext.client.appVersionCode, - clientContext.client.appPackageName - ), - ClientContextEnv( - clientContext.env.platformVersion, - clientContext.env.platform, - clientContext.env.make, - clientContext.env.model, - clientContext.env.locale - ), - clientContext - .custom - .toOption - .flatMap(decodeJs[JsonObject](_).toOption) - .getOrElse(JsonObject.empty) - ) - }, + context.clientContext.toOption.map { clientContext => + ClientContext( + ClientContextClient( + clientContext.client.installationId, + clientContext.client.appTitle, + clientContext.client.appVersionName, + clientContext.client.appVersionCode, + clientContext.client.appPackageName + ), + ClientContextEnv( + clientContext.env.platformVersion, + clientContext.env.platform, + clientContext.env.make, + clientContext.env.model, + clientContext.env.locale + ), + clientContext + .custom + .toOption + .flatMap(decodeJs[JsonObject](_).toOption) + .getOrElse(JsonObject.empty) + ) + }, Sync[F].delay(context.getRemainingTimeInMillis().millis) ) } diff --git a/lambda/shared/src/test/scala/feral/lambda/events/KafkaEventSuite.scala b/lambda/shared/src/test/scala/feral/lambda/events/KafkaEventSuite.scala index 49fec011..4a954e4f 100644 --- a/lambda/shared/src/test/scala/feral/lambda/events/KafkaEventSuite.scala +++ b/lambda/shared/src/test/scala/feral/lambda/events/KafkaEventSuite.scala @@ -87,17 +87,18 @@ class KafkaEventSuite extends FunSuite { def selfManagedKafkaResult: KafkaEvent = KafkaEvent( records = Map( - TopicPartition("mytopic", 0) -> List(KafkaRecord( - topic = "mytopic", - partition = 0, - offset = 15, - timestamp = Instant.ofEpochMilli(1545084650987L), - timestampType = CreateTime, - headers = - List(("headerKey", ByteVector(104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101))), - key = ByteVector.fromBase64("abcDEFghiJKLmnoPQRstuVWXyz1234==").get, - value = ByteVector.fromBase64("SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==").get - ))), + TopicPartition("mytopic", 0) -> List( + KafkaRecord( + topic = "mytopic", + partition = 0, + offset = 15, + timestamp = Instant.ofEpochMilli(1545084650987L), + timestampType = CreateTime, + headers = + List(("headerKey", ByteVector(104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101))), + key = ByteVector.fromBase64("abcDEFghiJKLmnoPQRstuVWXyz1234==").get, + value = ByteVector.fromBase64("SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==").get + ))), bootstrapServers = List( SocketAddress .fromString("b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092") @@ -149,17 +150,18 @@ class KafkaEventSuite extends FunSuite { def MSKResult: MskEvent = MskEvent( records = Map( - TopicPartition("mytopic", 0) -> List(KafkaRecord( - topic = "mytopic", - partition = 0, - offset = 15, - timestamp = Instant.ofEpochMilli(1545084650987L), - timestampType = CreateTime, - headers = - List(("headerKey", ByteVector(104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101))), - key = ByteVector.fromBase64("abcDEFghiJKLmnoPQRstuVWXyz1234==").get, - value = ByteVector.fromBase64("SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==").get - ))), + TopicPartition("mytopic", 0) -> List( + KafkaRecord( + topic = "mytopic", + partition = 0, + offset = 15, + timestamp = Instant.ofEpochMilli(1545084650987L), + timestampType = CreateTime, + headers = + List(("headerKey", ByteVector(104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101))), + key = ByteVector.fromBase64("abcDEFghiJKLmnoPQRstuVWXyz1234==").get, + value = ByteVector.fromBase64("SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==").get + ))), eventSourceArn = "arn:aws:kafka:us-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", bootstrapServers = List( diff --git a/lambda/shared/src/test/scala/feral/lambda/events/S3EventSuite.scala b/lambda/shared/src/test/scala/feral/lambda/events/S3EventSuite.scala index cb9836a3..0bafb8b0 100644 --- a/lambda/shared/src/test/scala/feral/lambda/events/S3EventSuite.scala +++ b/lambda/shared/src/test/scala/feral/lambda/events/S3EventSuite.scala @@ -70,37 +70,39 @@ class S3EventSuite extends FunSuite { } """ - def result = S3Event(records = List( - S3EventRecord( - eventVersion = "2.1", - eventSource = "aws:s3", - awsRegion = "us-west-2", - eventTime = Instant.ofEpochSecond(0), - eventName = "ObjectCreated:Put", - userIdentity = S3UserIdentity("AIDAJDPLRKLG7UEXAMPLE"), - requestParameters = S3RequestParameters(ip"127.0.0.1"), - responseElements = S3ResponseElements( - "C3D13FE58DE4C810", - "FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" - ), - s3 = S3( - s3SchemaVersion = "1.0", - configurationId = "testConfigRule": String, - bucket = S3Bucket( - name = "mybucket", - ownerIdentity = S3UserIdentity("A3NL1KOZZKExample"), - arn = "arn:aws:s3:::mybucket" - ), - `object` = S3Object( - key = "HappyFace.jpg", - size = 1024L, - eTag = "d41d8cd98f00b204e9800998ecf8427e", - versionId = Option("096fKKXTRTtl3on89fVO.nfljtsv6qko"), - sequencer = "0055AED6DCD90281E5" + def result = + S3Event(records = + List( + S3EventRecord( + eventVersion = "2.1", + eventSource = "aws:s3", + awsRegion = "us-west-2", + eventTime = Instant.ofEpochSecond(0), + eventName = "ObjectCreated:Put", + userIdentity = S3UserIdentity("AIDAJDPLRKLG7UEXAMPLE"), + requestParameters = S3RequestParameters(ip"127.0.0.1"), + responseElements = S3ResponseElements( + "C3D13FE58DE4C810", + "FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" + ), + s3 = S3( + s3SchemaVersion = "1.0", + configurationId = "testConfigRule": String, + bucket = S3Bucket( + name = "mybucket", + ownerIdentity = S3UserIdentity("A3NL1KOZZKExample"), + arn = "arn:aws:s3:::mybucket" + ), + `object` = S3Object( + key = "HappyFace.jpg", + size = 1024L, + eTag = "d41d8cd98f00b204e9800998ecf8427e", + versionId = Option("096fKKXTRTtl3on89fVO.nfljtsv6qko"), + sequencer = "0055AED6DCD90281E5" + ) + ), + glacierEventData = None ) - ), - glacierEventData = None - ) - )) + )) } diff --git a/project/build.properties b/project/build.properties index bbb0b608..01a16ed1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.11.2 +sbt.version=1.11.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 5af78405..435be5ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ -val sbtlTlV = "0.8.0" +val sbtlTlV = "0.8.2" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtlTlV) addSbtPlugin("org.typelevel" % "sbt-typelevel-scalafix" % sbtlTlV) -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.20.1") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1") diff --git a/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/build.sbt b/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/build.sbt index 4fa9141f..7311c33e 100644 --- a/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/build.sbt +++ b/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/build.sbt @@ -1,2 +1,2 @@ -scalaVersion := "2.13.16" +scalaVersion := "2.13.17" enablePlugins(LambdaJSPlugin) diff --git a/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/project/build.properties b/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/project/build.properties index bbb0b608..01a16ed1 100644 --- a/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/project/build.properties +++ b/sbt-lambda/src/sbt-test/lambda-js-plugin/iolambda-simple/project/build.properties @@ -1 +1 @@ -sbt.version=1.11.2 +sbt.version=1.11.7