Skip to content

Commit 2cddf18

Browse files
authored
CORE-69: update Scala, sbt versions and associated plugins (#1566)
* update Scala, sbt versions and associated plugins
1 parent 3aa228a commit 2cddf18

32 files changed

+106
-100
lines changed

.github/workflows/verify_consumer_pacts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ jobs:
319319
-e JANITOR_CLIENT_CREDENTIAL_FILE_PATH="" \
320320
-e JANITOR_TRACK_RESOURCE_PROJECT_ID="" \
321321
-e JANITOR_TRACK_RESOURCE_TOPIC_ID="" \
322-
sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 \
323-
sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec"
322+
sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 \
323+
bash -c "git config --global --add safe.directory /working/sam && sbt \"set scalafmtOnCompile := false\" \"project pact4s\" \"testOnly *SamProviderSpec\""
324324
325325
can-i-deploy: # The can-i-deploy job will run as a result of a Sam PR. It reports the pact verification statuses on all deployed environments.
326326
runs-on: ubuntu-latest

automation/Dockerfile-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10
1+
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15
22

33
COPY src /app/src
44
COPY test.sh /app

automation/project/Settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Settings {
4141
val commonSettings =
4242
commonBuildSettings ++ testSettings ++ List(
4343
organization := "org.broadinstitute.dsde.firecloud",
44-
scalaVersion := "2.13.10",
44+
scalaVersion := "2.13.15",
4545
resolvers ++= commonResolvers,
4646
scalacOptions ++= commonCompilerSettings
4747
)

automation/project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.6.2
1+
sbt.version=1.10.2

codegen_java/project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.6.2
1+
sbt.version=1.10.2

codegen_java/templates/libraries/okhttp-gson/build.sbt.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lazy val root = (project in file(".")).
77
Seq(organization := "org.broadinstitute.dsde.workbench",
88
name := "sam-client",
99
version := createVersion("{{artifactVersion}}"),
10-
scalaVersion := "2.13.10",
10+
scalaVersion := "2.13.15",
1111
scalacOptions ++= Seq("-feature"),
1212
javacOptions in compile ++= Seq("-Xlint:deprecation"),
1313
publishArtifact in (Compile, packageDoc) := false,

docker/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ function make_jar()
9696
GIT_MODEL_HASH=$(git log -n 1 --pretty=format:%h)
9797

9898
# make jar. cache sbt dependencies.
99-
docker run --rm --link postgres:postgres -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 /working/docker/init_schema.sh /working
99+
docker run --rm --link postgres:postgres -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 /working/docker/init_schema.sh /working
100100
sleep 40
101-
docker run --rm --link postgres:postgres -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 /working/docker/install.sh /working
101+
docker run --rm --link postgres:postgres -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 /working/docker/install.sh /working
102102
EXIT_CODE=$?
103103
set -e # Turn error detection back on for the rest of the script
104104

docker/build_jar.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88
# Get the last commit hash of the model directory and set it as an environment variable
99
GIT_MODEL_HASH=$(git log -n 1 --pretty=format:%h)
1010

11-
docker run --rm -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 /working/docker/clean_install.sh /working
11+
docker run --rm -e GIT_MODEL_HASH=$GIT_MODEL_HASH -v $PWD:/working -v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 /working/docker/clean_install.sh /working
1212
EXIT_CODE=$?
1313

1414
if [ $EXIT_CODE != 0 ]; then

project/Merging.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ object Merging {
1616
case PathList("META-INF", "kotlin-stdlib-common.kotlin_module") => MergeStrategy.first
1717
case PathList("META-INF", "okio.kotlin_module") => MergeStrategy.first
1818
case PathList("META-INF", "versions", "9", "OSGI-INF", "MANIFEST.MF") => MergeStrategy.first
19+
case PathList("META-INF", "license", "LICENSE.mvn-wrapper.txt") => MergeStrategy.first
1920
case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.first
2021
case "module-info.class" =>
2122
MergeStrategy.discard

project/Settings.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object Settings {
3737
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
3838
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
3939
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
40-
"-Wconf:cat=deprecation:ws,any:e", // Fail the compilation if there are any warnings, except for deprecation warnings.
40+
"-Wconf:any:e,cat=deprecation:ws", // Fail the compilation if there are any warnings, except for deprecation warnings.
4141
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
4242
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
4343
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
@@ -68,7 +68,7 @@ object Settings {
6868
lazy val commonSettings =
6969
commonBuildSettings ++ commonAssemblySettings ++ commonTestSettings ++ List(
7070
organization := "org.broadinstitute.dsde.workbench",
71-
scalaVersion := "2.13.10",
71+
scalaVersion := "2.13.15",
7272
resolvers := proxyResolvers ++: resolvers.value ++: commonResolvers,
7373
scalacOptions ++= commonCompilerSettings,
7474
Compile / compile := (Compile / compile).dependsOn(Compile / scalafmtAll).value,

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.6.2
1+
sbt.version=1.10.2

project/plugins.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0")
22

3-
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
3+
addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0")
44

5-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6")
5+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1")
66

7-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
7+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
88

9-
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0")
9+
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0")
1010

1111
addDependencyTreePlugin

src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ trait SamRequestContextDirectives {
5656
def withSamRequestContext: Directive1[SamRequestContext] =
5757
for {
5858
clientIP <- extractClientIP
59-
otelContext <- traceRequest
59+
otelContext <- traceRequest()
6060
} yield SamRequestContext(Option(otelContext), clientIP.toOption)
6161

6262
/** Adds the route and parameters to telemetry. The route is consistent across all requests to the same endpoint. For example, if the route is

src/main/scala/org/broadinstitute/dsde/workbench/sam/audit/SamAuditModel.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ object SamAuditModelJsonSupport {
5151
}
5252
}
5353

54-
implicit val AuditInfoFormat = jsonFormat2(AuditInfo)
54+
implicit val AuditInfoFormat: RootJsonFormat[AuditInfo] = jsonFormat2(AuditInfo)
5555

56-
implicit val ResourceChangeFormat = jsonFormat1(ResourceChange)
57-
implicit val ResourceEventTypeFormat = new RootJsonFormat[ResourceEventType] {
56+
implicit val ResourceChangeFormat: RootJsonFormat[ResourceChange] = jsonFormat1(ResourceChange)
57+
implicit val ResourceEventTypeFormat: RootJsonFormat[ResourceEventType] = new RootJsonFormat[ResourceEventType] {
5858
def read(obj: JsValue): ResourceEventType = obj match {
5959
case JsString("ResourceCreated") => ResourceCreated
6060
case JsString("ResourceParentUpdated") => ResourceParentUpdated
@@ -66,9 +66,9 @@ object SamAuditModelJsonSupport {
6666
def write(obj: ResourceEventType): JsValue = JsString(obj.toString)
6767
}
6868

69-
implicit val ResourceEventFormat = jsonFormat3(ResourceEvent)
69+
implicit val ResourceEventFormat: RootJsonFormat[ResourceEvent] = jsonFormat3(ResourceEvent)
7070

71-
implicit val WorkbenchSubjectFormat = new RootJsonFormat[WorkbenchSubject] {
71+
implicit val WorkbenchSubjectFormat: RootJsonFormat[WorkbenchSubject] = new RootJsonFormat[WorkbenchSubject] {
7272
val MEMBER_TYPE_FIELD = "memberType"
7373
val USER_TYPE = "user"
7474
val GROUP_TYPE = "group"
@@ -105,8 +105,8 @@ object SamAuditModelJsonSupport {
105105
}
106106
}
107107

108-
implicit val AccessChangeFormat = jsonFormat5(AccessChange)
109-
implicit val AccessChangeEventTypeFormat = new RootJsonFormat[AccessChangeEventType] {
108+
implicit val AccessChangeFormat: RootJsonFormat[AccessChange] = jsonFormat5(AccessChange)
109+
implicit val AccessChangeEventTypeFormat: RootJsonFormat[AccessChangeEventType] = new RootJsonFormat[AccessChangeEventType] {
110110
def read(obj: JsValue): AccessChangeEventType = obj match {
111111
case JsString("AccessAdded") => AccessAdded
112112
case JsString("AccessRemoved") => AccessRemoved
@@ -116,5 +116,5 @@ object SamAuditModelJsonSupport {
116116
def write(obj: AccessChangeEventType): JsValue = JsString(obj.toString)
117117
}
118118

119-
implicit val PolicyEventFormat = jsonFormat3(AccessChangeEvent)
119+
implicit val PolicyEventFormat: RootJsonFormat[AccessChangeEvent] = jsonFormat3(AccessChangeEvent)
120120
}

src/main/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureModel.scala

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@ import org.broadinstitute.dsde.workbench.model._
55
import org.broadinstitute.dsde.workbench.sam.model.{FullyQualifiedResourceId, ResourceAction, ResourceId}
66
import spray.json.DefaultJsonProtocol._
77
import org.broadinstitute.dsde.workbench.sam.model.api.SamJsonSupport._
8+
import spray.json.RootJsonFormat
89

910
object AzureJsonSupport {
10-
implicit val tenantIdFormat = ValueObjectFormat(TenantId.apply)
11+
implicit val tenantIdFormat: ValueObjectFormat[TenantId] = ValueObjectFormat(TenantId.apply)
1112

12-
implicit val subscriptionIdFormat = ValueObjectFormat(SubscriptionId.apply)
13+
implicit val subscriptionIdFormat: ValueObjectFormat[SubscriptionId] = ValueObjectFormat(SubscriptionId.apply)
1314

14-
implicit val managedResourceGroupNameFormat = ValueObjectFormat(ManagedResourceGroupName.apply)
15+
implicit val managedResourceGroupNameFormat: ValueObjectFormat[ManagedResourceGroupName] = ValueObjectFormat(ManagedResourceGroupName.apply)
1516

16-
implicit val getPetManagedIdentityRequestFormat = jsonFormat3(GetOrCreatePetManagedIdentityRequest.apply)
17+
implicit val getPetManagedIdentityRequestFormat: RootJsonFormat[GetOrCreatePetManagedIdentityRequest] = jsonFormat3(
18+
GetOrCreatePetManagedIdentityRequest.apply
19+
)
1720

18-
implicit val managedIdentityObjectIdFormat = ValueObjectFormat(ManagedIdentityObjectId.apply)
21+
implicit val managedIdentityObjectIdFormat: ValueObjectFormat[ManagedIdentityObjectId] = ValueObjectFormat(ManagedIdentityObjectId.apply)
1922

20-
implicit val managedIdentityDisplayNameFormat = ValueObjectFormat(ManagedIdentityDisplayName.apply)
23+
implicit val managedIdentityDisplayNameFormat: ValueObjectFormat[ManagedIdentityDisplayName] = ValueObjectFormat(ManagedIdentityDisplayName.apply)
2124

22-
implicit val petManagedIdentityIdFormat = jsonFormat4(PetManagedIdentityId.apply)
25+
implicit val petManagedIdentityIdFormat: RootJsonFormat[PetManagedIdentityId] = jsonFormat4(PetManagedIdentityId.apply)
2326

24-
implicit val petManagedIdentityFormat = jsonFormat3(PetManagedIdentity.apply)
27+
implicit val petManagedIdentityFormat: RootJsonFormat[PetManagedIdentity] = jsonFormat3(PetManagedIdentity.apply)
2528

26-
implicit val managedResourceGroupCoordinatesFormat = jsonFormat3(ManagedResourceGroupCoordinates.apply)
29+
implicit val managedResourceGroupCoordinatesFormat: RootJsonFormat[ManagedResourceGroupCoordinates] = jsonFormat3(ManagedResourceGroupCoordinates.apply)
2730

28-
implicit val billingProfileIdFormat = ValueObjectFormat(BillingProfileId.apply)
31+
implicit val billingProfileIdFormat: ValueObjectFormat[BillingProfileId] = ValueObjectFormat(BillingProfileId.apply)
2932

30-
implicit val actionManagedIdentityIdFormat = jsonFormat3(ActionManagedIdentityId.apply)
33+
implicit val actionManagedIdentityIdFormat: RootJsonFormat[ActionManagedIdentityId] = jsonFormat3(ActionManagedIdentityId.apply)
3134

32-
implicit val actionManagedIdentityFormat = jsonFormat4(ActionManagedIdentity.apply)
35+
implicit val actionManagedIdentityFormat: RootJsonFormat[ActionManagedIdentity] = jsonFormat4(ActionManagedIdentity.apply)
3336
}
3437

3538
final case class TenantId(value: String) extends ValueObject

src/main/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleModel.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package org.broadinstitute.dsde.workbench.sam.google
22

33
import cats.effect.IO
44
import org.broadinstitute.dsde.workbench.model.{ErrorReport, ErrorReportSource, WorkbenchEmail, WorkbenchIdentityJsonSupport}
5-
import spray.json.DefaultJsonProtocol
5+
import spray.json.{DefaultJsonProtocol, RootJsonFormat}
66

77
object SamGoogleModelJsonSupport {
88
import DefaultJsonProtocol._
99
import org.broadinstitute.dsde.workbench.model.ErrorReportJsonSupport._
1010
import WorkbenchIdentityJsonSupport._
1111

12-
implicit val SyncReportItemFormat = jsonFormat4(SyncReportItem.apply)
13-
implicit val SyncedPolicyFormat = jsonFormat2(SyncedPolicy.apply)
14-
implicit val SyncReportFormat = jsonFormat1(SyncReport.apply)
12+
implicit val SyncReportItemFormat: RootJsonFormat[SyncReportItem] = jsonFormat4(SyncReportItem.apply)
13+
implicit val SyncedPolicyFormat: RootJsonFormat[SyncedPolicy] = jsonFormat2(SyncedPolicy.apply)
14+
implicit val SyncReportFormat: RootJsonFormat[SyncReport] = jsonFormat1(SyncReport.apply)
1515

1616
}
1717

src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/ManagedGroupModel.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import monocle.macros.Lenses
44
import org.broadinstitute.dsde.workbench.model.{ValueObject, ValueObjectFormat, WorkbenchEmail, WorkbenchGroupName}
55
import org.broadinstitute.dsde.workbench.sam.model.{FullyQualifiedResourceId, ResourceId, ResourceRoleName}
66
import org.broadinstitute.dsde.workbench.sam.service.ManagedGroupService.MangedGroupRoleName
7-
import spray.json.DefaultJsonProtocol
7+
import spray.json.{DefaultJsonProtocol, RootJsonFormat}
88

99
@Lenses final case class ManagedGroupAndRole(groupName: WorkbenchGroupName, role: MangedGroupRoleName)
1010
@Lenses final case class ManagedGroupMembershipEntry(groupName: ResourceId, role: ResourceRoleName, groupEmail: WorkbenchEmail)
@@ -21,9 +21,9 @@ object ManagedGroupModelJsonSupport {
2121
import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._
2222
import SamJsonSupport.{FullyQualifiedResourceIdFormat, ResourceIdFormat, ResourceRoleNameFormat}
2323

24-
implicit val ManagedGroupMembershipEntryFormat = jsonFormat3(ManagedGroupMembershipEntry.apply)
24+
implicit val ManagedGroupMembershipEntryFormat: RootJsonFormat[ManagedGroupMembershipEntry] = jsonFormat3(ManagedGroupMembershipEntry.apply)
2525

26-
implicit val ManagedGroupAccessInstructionsFormat = ValueObjectFormat(ManagedGroupAccessInstructions.apply)
26+
implicit val ManagedGroupAccessInstructionsFormat: ValueObjectFormat[ManagedGroupAccessInstructions] = ValueObjectFormat(ManagedGroupAccessInstructions.apply)
2727

28-
implicit val ManagedGroupSupportSummaryFormat = jsonFormat4(ManagedGroupSupportSummary.apply)
28+
implicit val ManagedGroupSupportSummaryFormat: RootJsonFormat[ManagedGroupSupportSummary] = jsonFormat4(ManagedGroupSupportSummary.apply)
2929
}

0 commit comments

Comments
 (0)