From e2eb2c6f89b3b9ba7ade6a712ae8483ddedaf90b Mon Sep 17 00:00:00 2001 From: David An Date: Tue, 15 Oct 2024 14:12:35 -0400 Subject: [PATCH 1/7] update Scala, sbt versions and associated plugins --- .github/workflows/verify_consumer_pacts.yml | 2 +- automation/Dockerfile-tests | 2 +- automation/project/Settings.scala | 2 +- automation/project/build.properties | 2 +- codegen_java/project/build.properties | 2 +- .../templates/libraries/okhttp-gson/build.sbt.mustache | 2 +- docker/build.sh | 4 ++-- docker/build_jar.sh | 2 +- project/Settings.scala | 2 +- project/build.properties | 2 +- project/plugins.sbt | 10 +++++----- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/verify_consumer_pacts.yml b/.github/workflows/verify_consumer_pacts.yml index 29935e8f3..75729e7b5 100644 --- a/.github/workflows/verify_consumer_pacts.yml +++ b/.github/workflows/verify_consumer_pacts.yml @@ -319,7 +319,7 @@ jobs: -e JANITOR_CLIENT_CREDENTIAL_FILE_PATH="" \ -e JANITOR_TRACK_RESOURCE_PROJECT_ID="" \ -e JANITOR_TRACK_RESOURCE_TOPIC_ID="" \ - sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 \ + sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 \ sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec" 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. diff --git a/automation/Dockerfile-tests b/automation/Dockerfile-tests index 20f0bc186..d0f981415 100644 --- a/automation/Dockerfile-tests +++ b/automation/Dockerfile-tests @@ -1,4 +1,4 @@ -FROM sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 +FROM sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 COPY src /app/src COPY test.sh /app diff --git a/automation/project/Settings.scala b/automation/project/Settings.scala index 3afb9f4f0..afda80632 100644 --- a/automation/project/Settings.scala +++ b/automation/project/Settings.scala @@ -41,7 +41,7 @@ object Settings { val commonSettings = commonBuildSettings ++ testSettings ++ List( organization := "org.broadinstitute.dsde.firecloud", - scalaVersion := "2.13.10", + scalaVersion := "2.13.15", resolvers ++= commonResolvers, scalacOptions ++= commonCompilerSettings ) diff --git a/automation/project/build.properties b/automation/project/build.properties index 4ff6415f2..3829f19f7 100644 --- a/automation/project/build.properties +++ b/automation/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 \ No newline at end of file +sbt.version=1.10.2 \ No newline at end of file diff --git a/codegen_java/project/build.properties b/codegen_java/project/build.properties index c8fcab543..0b699c305 100644 --- a/codegen_java/project/build.properties +++ b/codegen_java/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.10.2 diff --git a/codegen_java/templates/libraries/okhttp-gson/build.sbt.mustache b/codegen_java/templates/libraries/okhttp-gson/build.sbt.mustache index 48963657c..3e87b2404 100644 --- a/codegen_java/templates/libraries/okhttp-gson/build.sbt.mustache +++ b/codegen_java/templates/libraries/okhttp-gson/build.sbt.mustache @@ -7,7 +7,7 @@ lazy val root = (project in file(".")). Seq(organization := "org.broadinstitute.dsde.workbench", name := "sam-client", version := createVersion("{{artifactVersion}}"), - scalaVersion := "2.13.10", + scalaVersion := "2.13.15", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), publishArtifact in (Compile, packageDoc) := false, diff --git a/docker/build.sh b/docker/build.sh index 050aa0c2a..2ec1aab77 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -96,9 +96,9 @@ function make_jar() GIT_MODEL_HASH=$(git log -n 1 --pretty=format:%h) # make jar. cache sbt dependencies. - 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 + 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 sleep 40 - 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 + 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 EXIT_CODE=$? set -e # Turn error detection back on for the rest of the script diff --git a/docker/build_jar.sh b/docker/build_jar.sh index 7c2a8106d..9258e77eb 100755 --- a/docker/build_jar.sh +++ b/docker/build_jar.sh @@ -8,7 +8,7 @@ set -e # Get the last commit hash of the model directory and set it as an environment variable GIT_MODEL_HASH=$(git log -n 1 --pretty=format:%h) -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 +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 EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then diff --git a/project/Settings.scala b/project/Settings.scala index 99a6a13e6..a12985243 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -68,7 +68,7 @@ object Settings { lazy val commonSettings = commonBuildSettings ++ commonAssemblySettings ++ commonTestSettings ++ List( organization := "org.broadinstitute.dsde.workbench", - scalaVersion := "2.13.10", + scalaVersion := "2.13.15", resolvers := proxyResolvers ++: resolvers.value ++: commonResolvers, scalacOptions ++= commonCompilerSettings, Compile / compile := (Compile / compile).dependsOn(Compile / scalafmtAll).value, diff --git a/project/build.properties b/project/build.properties index c8fcab543..0b699c305 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.10.2 diff --git a/project/plugins.sbt b/project/plugins.sbt index 0600f0458..8224092da 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,11 +1,11 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0") -addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0") addDependencyTreePlugin From a0cf79fec1ade1e85cfe969b66ea3558425c39f5 Mon Sep 17 00:00:00 2001 From: David An Date: Tue, 15 Oct 2024 16:24:01 -0400 Subject: [PATCH 2/7] reverse scalacOptions -Wconf values due to breaking change in Scala 2.13.15 --- project/Settings.scala | 2 +- .../dsde/workbench/sam/api/SamRequestContextDirectives.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Settings.scala b/project/Settings.scala index a12985243..dc4995e85 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -37,7 +37,7 @@ object Settings { "-language:existentials", // Existential types (besides wildcard types) can be written and inferred "-unchecked", // Enable additional warnings where generated code depends on assumptions. "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. - "-Wconf:cat=deprecation:ws,any:e", // Fail the compilation if there are any warnings, except for deprecation warnings. + "-Wconf:any:e,cat=deprecation:ws", // Fail the compilation if there are any warnings, except for deprecation warnings. "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver. "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error. "-Xlint:delayedinit-select", // Selecting member of DelayedInit. diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala index 664bee483..d9dbf5f24 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala @@ -56,7 +56,7 @@ trait SamRequestContextDirectives { def withSamRequestContext: Directive1[SamRequestContext] = for { clientIP <- extractClientIP - otelContext <- traceRequest + otelContext <- traceRequest() } yield SamRequestContext(Option(otelContext), clientIP.toOption) /** Adds the route and parameters to telemetry. The route is consistent across all requests to the same endpoint. For example, if the route is From db93b61da87ea456660c3952f2776d4bc2ca9135 Mon Sep 17 00:00:00 2001 From: David An Date: Tue, 15 Oct 2024 16:24:34 -0400 Subject: [PATCH 3/7] Implicit definition should have explicit type --- .../workbench/sam/audit/SamAuditModel.scala | 16 ++--- .../dsde/workbench/sam/azure/AzureModel.scala | 27 +++---- .../workbench/sam/google/GoogleModel.scala | 8 +-- .../sam/model/api/ManagedGroupModel.scala | 8 +-- .../sam/model/api/SamJsonSupport.scala | 72 +++++++++---------- .../dsde/workbench/sam/package.scala | 2 +- .../workbench/sam/service/StatusService.scala | 2 +- 7 files changed, 69 insertions(+), 66 deletions(-) diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/audit/SamAuditModel.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/audit/SamAuditModel.scala index 44d20f2be..4ba280542 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/audit/SamAuditModel.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/audit/SamAuditModel.scala @@ -51,10 +51,10 @@ object SamAuditModelJsonSupport { } } - implicit val AuditInfoFormat = jsonFormat2(AuditInfo) + implicit val AuditInfoFormat: RootJsonFormat[AuditInfo] = jsonFormat2(AuditInfo) - implicit val ResourceChangeFormat = jsonFormat1(ResourceChange) - implicit val ResourceEventTypeFormat = new RootJsonFormat[ResourceEventType] { + implicit val ResourceChangeFormat: RootJsonFormat[ResourceChange] = jsonFormat1(ResourceChange) + implicit val ResourceEventTypeFormat: RootJsonFormat[ResourceEventType] = new RootJsonFormat[ResourceEventType] { def read(obj: JsValue): ResourceEventType = obj match { case JsString("ResourceCreated") => ResourceCreated case JsString("ResourceParentUpdated") => ResourceParentUpdated @@ -66,9 +66,9 @@ object SamAuditModelJsonSupport { def write(obj: ResourceEventType): JsValue = JsString(obj.toString) } - implicit val ResourceEventFormat = jsonFormat3(ResourceEvent) + implicit val ResourceEventFormat: RootJsonFormat[ResourceEvent] = jsonFormat3(ResourceEvent) - implicit val WorkbenchSubjectFormat = new RootJsonFormat[WorkbenchSubject] { + implicit val WorkbenchSubjectFormat: RootJsonFormat[WorkbenchSubject] = new RootJsonFormat[WorkbenchSubject] { val MEMBER_TYPE_FIELD = "memberType" val USER_TYPE = "user" val GROUP_TYPE = "group" @@ -105,8 +105,8 @@ object SamAuditModelJsonSupport { } } - implicit val AccessChangeFormat = jsonFormat5(AccessChange) - implicit val AccessChangeEventTypeFormat = new RootJsonFormat[AccessChangeEventType] { + implicit val AccessChangeFormat: RootJsonFormat[AccessChange] = jsonFormat5(AccessChange) + implicit val AccessChangeEventTypeFormat: RootJsonFormat[AccessChangeEventType] = new RootJsonFormat[AccessChangeEventType] { def read(obj: JsValue): AccessChangeEventType = obj match { case JsString("AccessAdded") => AccessAdded case JsString("AccessRemoved") => AccessRemoved @@ -116,5 +116,5 @@ object SamAuditModelJsonSupport { def write(obj: AccessChangeEventType): JsValue = JsString(obj.toString) } - implicit val PolicyEventFormat = jsonFormat3(AccessChangeEvent) + implicit val PolicyEventFormat: RootJsonFormat[AccessChangeEvent] = jsonFormat3(AccessChangeEvent) } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureModel.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureModel.scala index c7bc5b2d6..319215b25 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureModel.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureModel.scala @@ -5,31 +5,34 @@ import org.broadinstitute.dsde.workbench.model._ import org.broadinstitute.dsde.workbench.sam.model.{FullyQualifiedResourceId, ResourceAction, ResourceId} import spray.json.DefaultJsonProtocol._ import org.broadinstitute.dsde.workbench.sam.model.api.SamJsonSupport._ +import spray.json.RootJsonFormat object AzureJsonSupport { - implicit val tenantIdFormat = ValueObjectFormat(TenantId.apply) + implicit val tenantIdFormat: ValueObjectFormat[TenantId] = ValueObjectFormat(TenantId.apply) - implicit val subscriptionIdFormat = ValueObjectFormat(SubscriptionId.apply) + implicit val subscriptionIdFormat: ValueObjectFormat[SubscriptionId] = ValueObjectFormat(SubscriptionId.apply) - implicit val managedResourceGroupNameFormat = ValueObjectFormat(ManagedResourceGroupName.apply) + implicit val managedResourceGroupNameFormat: ValueObjectFormat[ManagedResourceGroupName] = ValueObjectFormat(ManagedResourceGroupName.apply) - implicit val getPetManagedIdentityRequestFormat = jsonFormat3(GetOrCreatePetManagedIdentityRequest.apply) + implicit val getPetManagedIdentityRequestFormat: RootJsonFormat[GetOrCreatePetManagedIdentityRequest] = jsonFormat3( + GetOrCreatePetManagedIdentityRequest.apply + ) - implicit val managedIdentityObjectIdFormat = ValueObjectFormat(ManagedIdentityObjectId.apply) + implicit val managedIdentityObjectIdFormat: ValueObjectFormat[ManagedIdentityObjectId] = ValueObjectFormat(ManagedIdentityObjectId.apply) - implicit val managedIdentityDisplayNameFormat = ValueObjectFormat(ManagedIdentityDisplayName.apply) + implicit val managedIdentityDisplayNameFormat: ValueObjectFormat[ManagedIdentityDisplayName] = ValueObjectFormat(ManagedIdentityDisplayName.apply) - implicit val petManagedIdentityIdFormat = jsonFormat4(PetManagedIdentityId.apply) + implicit val petManagedIdentityIdFormat: RootJsonFormat[PetManagedIdentityId] = jsonFormat4(PetManagedIdentityId.apply) - implicit val petManagedIdentityFormat = jsonFormat3(PetManagedIdentity.apply) + implicit val petManagedIdentityFormat: RootJsonFormat[PetManagedIdentity] = jsonFormat3(PetManagedIdentity.apply) - implicit val managedResourceGroupCoordinatesFormat = jsonFormat3(ManagedResourceGroupCoordinates.apply) + implicit val managedResourceGroupCoordinatesFormat: RootJsonFormat[ManagedResourceGroupCoordinates] = jsonFormat3(ManagedResourceGroupCoordinates.apply) - implicit val billingProfileIdFormat = ValueObjectFormat(BillingProfileId.apply) + implicit val billingProfileIdFormat: ValueObjectFormat[BillingProfileId] = ValueObjectFormat(BillingProfileId.apply) - implicit val actionManagedIdentityIdFormat = jsonFormat3(ActionManagedIdentityId.apply) + implicit val actionManagedIdentityIdFormat: RootJsonFormat[ActionManagedIdentityId] = jsonFormat3(ActionManagedIdentityId.apply) - implicit val actionManagedIdentityFormat = jsonFormat4(ActionManagedIdentity.apply) + implicit val actionManagedIdentityFormat: RootJsonFormat[ActionManagedIdentity] = jsonFormat4(ActionManagedIdentity.apply) } final case class TenantId(value: String) extends ValueObject diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleModel.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleModel.scala index 922872fb0..8ea4b183f 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleModel.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleModel.scala @@ -2,16 +2,16 @@ package org.broadinstitute.dsde.workbench.sam.google import cats.effect.IO import org.broadinstitute.dsde.workbench.model.{ErrorReport, ErrorReportSource, WorkbenchEmail, WorkbenchIdentityJsonSupport} -import spray.json.DefaultJsonProtocol +import spray.json.{DefaultJsonProtocol, RootJsonFormat} object SamGoogleModelJsonSupport { import DefaultJsonProtocol._ import org.broadinstitute.dsde.workbench.model.ErrorReportJsonSupport._ import WorkbenchIdentityJsonSupport._ - implicit val SyncReportItemFormat = jsonFormat4(SyncReportItem.apply) - implicit val SyncedPolicyFormat = jsonFormat2(SyncedPolicy.apply) - implicit val SyncReportFormat = jsonFormat1(SyncReport.apply) + implicit val SyncReportItemFormat: RootJsonFormat[SyncReportItem] = jsonFormat4(SyncReportItem.apply) + implicit val SyncedPolicyFormat: RootJsonFormat[SyncedPolicy] = jsonFormat2(SyncedPolicy.apply) + implicit val SyncReportFormat: RootJsonFormat[SyncReport] = jsonFormat1(SyncReport.apply) } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/ManagedGroupModel.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/ManagedGroupModel.scala index 995a3bef1..bd2e2ff02 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/ManagedGroupModel.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/ManagedGroupModel.scala @@ -4,7 +4,7 @@ import monocle.macros.Lenses import org.broadinstitute.dsde.workbench.model.{ValueObject, ValueObjectFormat, WorkbenchEmail, WorkbenchGroupName} import org.broadinstitute.dsde.workbench.sam.model.{FullyQualifiedResourceId, ResourceId, ResourceRoleName} import org.broadinstitute.dsde.workbench.sam.service.ManagedGroupService.MangedGroupRoleName -import spray.json.DefaultJsonProtocol +import spray.json.{DefaultJsonProtocol, RootJsonFormat} @Lenses final case class ManagedGroupAndRole(groupName: WorkbenchGroupName, role: MangedGroupRoleName) @Lenses final case class ManagedGroupMembershipEntry(groupName: ResourceId, role: ResourceRoleName, groupEmail: WorkbenchEmail) @@ -21,9 +21,9 @@ object ManagedGroupModelJsonSupport { import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._ import SamJsonSupport.{FullyQualifiedResourceIdFormat, ResourceIdFormat, ResourceRoleNameFormat} - implicit val ManagedGroupMembershipEntryFormat = jsonFormat3(ManagedGroupMembershipEntry.apply) + implicit val ManagedGroupMembershipEntryFormat: RootJsonFormat[ManagedGroupMembershipEntry] = jsonFormat3(ManagedGroupMembershipEntry.apply) - implicit val ManagedGroupAccessInstructionsFormat = ValueObjectFormat(ManagedGroupAccessInstructions.apply) + implicit val ManagedGroupAccessInstructionsFormat: ValueObjectFormat[ManagedGroupAccessInstructions] = ValueObjectFormat(ManagedGroupAccessInstructions.apply) - implicit val ManagedGroupSupportSummaryFormat = jsonFormat4(ManagedGroupSupportSummary.apply) + implicit val ManagedGroupSupportSummaryFormat: RootJsonFormat[ManagedGroupSupportSummary] = jsonFormat4(ManagedGroupSupportSummary.apply) } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/SamJsonSupport.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/SamJsonSupport.scala index f4ad708ae..a81848129 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/SamJsonSupport.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/api/SamJsonSupport.scala @@ -45,77 +45,77 @@ object SamJsonSupport { import DefaultJsonProtocol._ import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._ - implicit val ResourceActionPatternFormat = jsonFormat3(ResourceActionPattern.apply) + implicit val ResourceActionPatternFormat: RootJsonFormat[ResourceActionPattern] = jsonFormat3(ResourceActionPattern.apply) - implicit val ResourceActionFormat = ValueObjectFormat(ResourceAction.apply) + implicit val ResourceActionFormat: ValueObjectFormat[ResourceAction] = ValueObjectFormat(ResourceAction.apply) - implicit val ResourceRoleNameFormat = ValueObjectFormat(ResourceRoleName.apply) + implicit val ResourceRoleNameFormat: ValueObjectFormat[ResourceRoleName] = ValueObjectFormat(ResourceRoleName.apply) - implicit val ResourceTypeNameFormat = ValueObjectFormat(ResourceTypeName.apply) + implicit val ResourceTypeNameFormat: ValueObjectFormat[ResourceTypeName] = ValueObjectFormat(ResourceTypeName.apply) - implicit val ResourceRoleFormat = jsonFormat4(ResourceRole.apply) + implicit val ResourceRoleFormat: RootJsonFormat[ResourceRole] = jsonFormat4(ResourceRole.apply) - implicit val ResourceTypeFormat = jsonFormat6(ResourceType.apply) + implicit val ResourceTypeFormat: RootJsonFormat[ResourceType] = jsonFormat6(ResourceType.apply) - implicit val SamUserFormat = jsonFormat8(SamUser.apply) + implicit val SamUserFormat: RootJsonFormat[SamUser] = jsonFormat8(SamUser.apply) - implicit val UserStatusDetailsFormat = jsonFormat2(UserStatusDetails.apply) + implicit val UserStatusDetailsFormat: RootJsonFormat[UserStatusDetails] = jsonFormat2(UserStatusDetails.apply) - implicit val UserStatusFormat = jsonFormat2(UserStatus.apply) + implicit val UserStatusFormat: RootJsonFormat[UserStatus] = jsonFormat2(UserStatus.apply) - implicit val UserStatusInfoFormat = jsonFormat4(UserStatusInfo.apply) + implicit val UserStatusInfoFormat: RootJsonFormat[UserStatusInfo] = jsonFormat4(UserStatusInfo.apply) - implicit val UserIdInfoFormat = jsonFormat3(UserIdInfo.apply) + implicit val UserIdInfoFormat: RootJsonFormat[UserIdInfo] = jsonFormat3(UserIdInfo.apply) - implicit val TermsOfServiceAcceptanceFormat = ValueObjectFormat(TermsOfServiceAcceptance.apply) + implicit val TermsOfServiceAcceptanceFormat: ValueObjectFormat[TermsOfServiceAcceptance] = ValueObjectFormat(TermsOfServiceAcceptance.apply) - implicit val oldTermsOfServiceDetailsFormat = jsonFormat4(OldTermsOfServiceDetails.apply) + implicit val oldTermsOfServiceDetailsFormat: RootJsonFormat[OldTermsOfServiceDetails] = jsonFormat4(OldTermsOfServiceDetails.apply) - implicit val TermsOfServiceDetailsFormat = jsonFormat4(TermsOfServiceDetails.apply) + implicit val TermsOfServiceDetailsFormat: RootJsonFormat[TermsOfServiceDetails] = jsonFormat4(TermsOfServiceDetails.apply) - implicit val termsOfServiceHistoryRecordFormat = jsonFormat3(TermsOfServiceHistoryRecord.apply) + implicit val termsOfServiceHistoryRecordFormat: RootJsonFormat[TermsOfServiceHistoryRecord] = jsonFormat3(TermsOfServiceHistoryRecord.apply) - implicit val termsOfServiceHistory = jsonFormat1(TermsOfServiceHistory.apply) + implicit val termsOfServiceHistory: RootJsonFormat[TermsOfServiceHistory] = jsonFormat1(TermsOfServiceHistory.apply) - implicit val SamUserTosFormat = jsonFormat4(SamUserTos.apply) + implicit val SamUserTosFormat: RootJsonFormat[SamUserTos] = jsonFormat4(SamUserTos.apply) - implicit val termsOfAcceptanceStatusFormat = jsonFormat3(TermsOfServiceComplianceStatus.apply) + implicit val termsOfAcceptanceStatusFormat: RootJsonFormat[TermsOfServiceComplianceStatus] = jsonFormat3(TermsOfServiceComplianceStatus.apply) - implicit val UserStatusDiagnosticsFormat = jsonFormat5(UserStatusDiagnostics.apply) + implicit val UserStatusDiagnosticsFormat: RootJsonFormat[UserStatusDiagnostics] = jsonFormat5(UserStatusDiagnostics.apply) - implicit val AccessPolicyNameFormat = ValueObjectFormat(AccessPolicyName.apply) + implicit val AccessPolicyNameFormat: ValueObjectFormat[AccessPolicyName] = ValueObjectFormat(AccessPolicyName.apply) - implicit val ResourceIdFormat = ValueObjectFormat(ResourceId.apply) + implicit val ResourceIdFormat: ValueObjectFormat[ResourceId] = ValueObjectFormat(ResourceId.apply) - implicit val FullyQualifiedResourceIdFormat = jsonFormat2(FullyQualifiedResourceId.apply) + implicit val FullyQualifiedResourceIdFormat: RootJsonFormat[FullyQualifiedResourceId] = jsonFormat2(FullyQualifiedResourceId.apply) implicit val AccessPolicyDescendantPermissionsFormat: RootJsonFormat[AccessPolicyDescendantPermissions] = jsonFormat3(AccessPolicyDescendantPermissions.apply) - implicit val PolicyIdentifiersFormat = jsonFormat3(PolicyIdentifiers.apply) + implicit val PolicyIdentifiersFormat: RootJsonFormat[PolicyIdentifiers] = jsonFormat3(PolicyIdentifiers.apply) - implicit val AccessPolicyMembershipResponseFormat = jsonFormat5(AccessPolicyMembershipResponse.apply) + implicit val AccessPolicyMembershipResponseFormat: RootJsonFormat[AccessPolicyMembershipResponse] = jsonFormat5(AccessPolicyMembershipResponse.apply) - implicit val AccessPolicyResponseEntryFormat = jsonFormat3(AccessPolicyResponseEntry.apply) + implicit val AccessPolicyResponseEntryFormat: RootJsonFormat[AccessPolicyResponseEntry] = jsonFormat3(AccessPolicyResponseEntry.apply) - implicit val UserPolicyResponseFormat = jsonFormat5(UserPolicyResponse.apply) + implicit val UserPolicyResponseFormat: RootJsonFormat[UserPolicyResponse] = jsonFormat5(UserPolicyResponse.apply) - implicit val RolesAndActionsFormat = jsonFormat2(RolesAndActions.apply) + implicit val RolesAndActionsFormat: RootJsonFormat[RolesAndActions] = jsonFormat2(RolesAndActions.apply) - implicit val UserResourcesResponseFormat = jsonFormat6(UserResourcesResponse.apply) + implicit val UserResourcesResponseFormat: RootJsonFormat[UserResourcesResponse] = jsonFormat6(UserResourcesResponse.apply) - implicit val FullyQualifiedPolicyIdFormat = jsonFormat2(FullyQualifiedPolicyId.apply) + implicit val FullyQualifiedPolicyIdFormat: RootJsonFormat[FullyQualifiedPolicyId] = jsonFormat2(FullyQualifiedPolicyId.apply) - implicit val GroupSyncResponseFormat = jsonFormat2(GroupSyncResponse.apply) + implicit val GroupSyncResponseFormat: RootJsonFormat[GroupSyncResponse] = jsonFormat2(GroupSyncResponse.apply) - implicit val AccessPolicyMembershipRequestFormat = jsonFormat5(AccessPolicyMembershipRequest.apply) + implicit val AccessPolicyMembershipRequestFormat: RootJsonFormat[AccessPolicyMembershipRequest] = jsonFormat5(AccessPolicyMembershipRequest.apply) - implicit val CreateResourceRequestFormat = jsonFormat5(CreateResourceRequest.apply) + implicit val CreateResourceRequestFormat: RootJsonFormat[CreateResourceRequest] = jsonFormat5(CreateResourceRequest.apply) - implicit val CreateResourcePolicyResponseFormat = jsonFormat2(CreateResourcePolicyResponse.apply) + implicit val CreateResourcePolicyResponseFormat: RootJsonFormat[CreateResourcePolicyResponse] = jsonFormat2(CreateResourcePolicyResponse.apply) - implicit val CreateResourceResponseFormat = jsonFormat4(CreateResourceResponse.apply) + implicit val CreateResourceResponseFormat: RootJsonFormat[CreateResourceResponse] = jsonFormat4(CreateResourceResponse.apply) - implicit val SignedUrlRequestFormat = jsonFormat4(SignedUrlRequest.apply) + implicit val SignedUrlRequestFormat: RootJsonFormat[SignedUrlRequest] = jsonFormat4(SignedUrlRequest.apply) - implicit val RequesterPaysSignedUrlRequestFormat = jsonFormat3(RequesterPaysSignedUrlRequest.apply) + implicit val RequesterPaysSignedUrlRequestFormat: RootJsonFormat[RequesterPaysSignedUrlRequest] = jsonFormat3(RequesterPaysSignedUrlRequest.apply) } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/package.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/package.scala index b31a69c99..7349069dc 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/package.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/package.scala @@ -5,5 +5,5 @@ import org.broadinstitute.dsde.workbench.model.ErrorReportSource /** Created by dvoet on 5/18/17. */ package object sam { - implicit val errorReportSource = ErrorReportSource("sam") + implicit val errorReportSource: ErrorReportSource = ErrorReportSource("sam") } diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/StatusService.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/StatusService.scala index 35c3f0071..b996fc9f8 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/StatusService.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/StatusService.scala @@ -23,7 +23,7 @@ class StatusService( pollInterval: FiniteDuration = 1 minute )(implicit system: ActorSystem, executionContext: ExecutionContext) extends LazyLogging { - implicit val askTimeout = Timeout(5 seconds) + implicit val askTimeout: Timeout = Timeout(5 seconds) private val healthMonitor = system.actorOf(HealthMonitor.props(cloudExtensions.allSubSystems)(checkStatus _)) system.scheduler.scheduleAtFixedRate(initialDelay, pollInterval, healthMonitor, HealthMonitor.CheckAll) From 732a9e54334bc5afdd06f00d3c7297867744467e Mon Sep 17 00:00:00 2001 From: David An Date: Tue, 15 Oct 2024 16:49:27 -0400 Subject: [PATCH 4/7] tests: Implicit definition should have explicit type --- .../org/broadinstitute/dsde/workbench/sam/TestSupport.scala | 2 +- .../workbench/sam/api/AdminResourceTypesRoutesSpec.scala | 2 +- .../dsde/workbench/sam/api/AdminResourcesRoutesSpec.scala | 2 +- .../dsde/workbench/sam/api/ResourceRoutesV2Spec.scala | 2 +- .../dsde/workbench/sam/azure/AzureRoutesSpec.scala | 2 +- .../dsde/workbench/sam/azure/AzureServiceSpec.scala | 6 ++++-- .../CoordinatedBackoffHttpGoogleDirectoryDAOSpec.scala | 2 +- .../workbench/sam/google/GoogleExtensionRoutesSpec.scala | 2 +- .../workbench/sam/google/GoogleExtensionRoutesV1Spec.scala | 2 +- .../dsde/workbench/sam/google/GoogleExtensionSpec.scala | 2 +- .../sam/service/StatusServiceSpecs/StatusServiceSpec.scala | 4 ++-- .../dsde/workbench/sam/util/DatabaseSupportSpec.scala | 4 ++-- 12 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/TestSupport.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/TestSupport.scala index 5744681dc..dfdb9b14a 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/TestSupport.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/TestSupport.scala @@ -47,7 +47,7 @@ trait TestSupport { def runAndWait[T](f: Awaitable[T]): T = Await.result(f, Duration.Inf) def runAndWait[T](f: IO[T]): T = f.unsafeRunSync() - implicit val futureTimeout = Timeout(Span(10, Seconds)) + implicit val futureTimeout: Timeout = Timeout(Span(10, Seconds)) implicit val eqWorkbenchException: Eq[WorkbenchException] = (x: WorkbenchException, y: WorkbenchException) => x.getMessage == y.getMessage val samRequestContext = SamRequestContext() diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourceTypesRoutesSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourceTypesRoutesSpec.scala index 17e2a6fbe..9cac1676e 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourceTypesRoutesSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourceTypesRoutesSpec.scala @@ -28,7 +28,7 @@ import scala.concurrent.Future class AdminResourceTypesRoutesSpec extends AnyFlatSpec with Matchers with TestSupport with ScalatestRouteTest with AppendedClues with MockitoSugar { - implicit val errorReportSource = ErrorReportSource("sam") + implicit val errorReportSource: ErrorReportSource = ErrorReportSource("sam") val firecloudAdmin = Generator.genFirecloudUser.sample.get val broadUser = Generator.genBroadInstituteUser.sample.get diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourcesRoutesSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourcesRoutesSpec.scala index 828d73532..4f50b9c8d 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourcesRoutesSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/AdminResourcesRoutesSpec.scala @@ -17,7 +17,7 @@ import org.mockito.scalatest.MockitoSugar class AdminResourcesRoutesSpec extends AnyFlatSpec with Matchers with TestSupport with ScalatestRouteTest with AppendedClues with MockitoSugar { - implicit val errorReportSource = ErrorReportSource("sam") + implicit val errorReportSource: ErrorReportSource = ErrorReportSource("sam") val adminUser = Generator.genFirecloudUser.sample.get val broadUser = Generator.genBroadInstituteUser.sample.get diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/ResourceRoutesV2Spec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/ResourceRoutesV2Spec.scala index 7b594a888..55776e072 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/ResourceRoutesV2Spec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/api/ResourceRoutesV2Spec.scala @@ -29,7 +29,7 @@ import spray.json.{JsBoolean, JsValue} //TODO This test is flaky. It looks like the tests run too fast and cause some sort of timeout error or race condition class ResourceRoutesV2Spec extends RetryableAnyFlatSpec with Matchers with TestSupport with ScalatestRouteTest with AppendedClues with MockitoSugar { - implicit val errorReportSource = ErrorReportSource("sam") + implicit val errorReportSource: ErrorReportSource = ErrorReportSource("sam") val defaultUserInfo = TestSamRoutes.defaultUserInfo diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureRoutesSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureRoutesSpec.scala index 290c06220..6313b2046 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureRoutesSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureRoutesSpec.scala @@ -22,7 +22,7 @@ import org.mockito.scalatest.MockitoSugar import scala.concurrent.duration._ class AzureRoutesSpec extends AnyFlatSpec with Matchers with ScalatestRouteTest with TestSupport with MockitoSugar { - implicit val timeout = RouteTestTimeout(15.seconds.dilated) + implicit val timeout: RouteTestTimeout = RouteTestTimeout(15.seconds.dilated) "POST /api/azure/v1/user/petManagedIdentity" should "successfully create a pet managed identity using MRG in db" in { val samRoutes = genSamRoutes() diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureServiceSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureServiceSpec.scala index d2a3f1775..2eee5c4e7 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureServiceSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/AzureServiceSpec.scala @@ -3,6 +3,7 @@ package org.broadinstitute.dsde.workbench.sam.azure import akka.actor.ActorSystem import akka.http.scaladsl.model.StatusCodes import akka.testkit.TestKit +import cats.effect.unsafe.IORuntime import com.azure.resourcemanager.managedapplications.models.Plan import org.broadinstitute.dsde.workbench.model.{WorkbenchEmail, WorkbenchExceptionWithErrorReport} import org.broadinstitute.dsde.workbench.sam.Generator.genWorkbenchUserAzure @@ -39,6 +40,7 @@ import org.scalatest.flatspec.AnyFlatSpecLike import org.scalatest.matchers.should.Matchers import java.util.UUID +import scala.concurrent.ExecutionContextExecutor import scala.jdk.CollectionConverters._ class AzureServiceSpec(_system: ActorSystem) @@ -49,8 +51,8 @@ class AzureServiceSpec(_system: ActorSystem) with BeforeAndAfterAll with BeforeAndAfterEach with MockitoSugar { - implicit val ec = scala.concurrent.ExecutionContext.global - implicit val ioRuntime = cats.effect.unsafe.IORuntime.global + implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global + implicit val ioRuntime: IORuntime = cats.effect.unsafe.IORuntime.global def this() = this(ActorSystem("AzureServiceSpec")) diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/CoordinatedBackoffHttpGoogleDirectoryDAOSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/CoordinatedBackoffHttpGoogleDirectoryDAOSpec.scala index 586fb6ef3..c003b7e8b 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/CoordinatedBackoffHttpGoogleDirectoryDAOSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/CoordinatedBackoffHttpGoogleDirectoryDAOSpec.scala @@ -14,7 +14,7 @@ import scala.concurrent.duration.Duration import scala.concurrent.{Await, Future} class CoordinatedBackoffHttpGoogleDirectoryDAOSpec extends AnyFreeSpec with Matchers with MockitoSugar { - implicit val system = ActorSystem("CoordinatedBackoffHttpGoogleDirectoryDAOSpec") + implicit val system: ActorSystem = ActorSystem("CoordinatedBackoffHttpGoogleDirectoryDAOSpec") "CoordinatedBackoffHttpGoogleDirectoryDAO" - { "retryExponentially" - { diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesSpec.scala index e3d751527..5b6c0e790 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesSpec.scala @@ -36,7 +36,7 @@ import scala.concurrent.duration._ /** Unit tests of GoogleExtensionRoutes. Can use real Google services. Must mock everything else. */ class GoogleExtensionRoutesSpec extends GoogleExtensionRoutesSpecHelper with ScalaFutures { - implicit val timeout = RouteTestTimeout( + implicit val timeout: RouteTestTimeout = RouteTestTimeout( 5 seconds ) // after using com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper, tests seems to run a bit longer val workspaceResourceId = "workspace" diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesV1Spec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesV1Spec.scala index 4758fe6b8..7c15dd8ab 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesV1Spec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionRoutesV1Spec.scala @@ -21,7 +21,7 @@ import scala.concurrent.duration._ /** Unit tests of GoogleExtensionRoutes. Can use real Google services. Must mock everything else. */ class GoogleExtensionRoutesV1Spec extends GoogleExtensionRoutesSpecHelper with ScalaFutures { - implicit val timeout = RouteTestTimeout( + implicit val timeout: RouteTestTimeout = RouteTestTimeout( 5 seconds ) // after using com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper, tests seems to run a bit longer diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionSpec.scala index 3456f2e38..97fd81243 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/google/GoogleExtensionSpec.scala @@ -69,7 +69,7 @@ class GoogleExtensionSpec(_system: ActorSystem) lazy val superAdminsGroup = TestSupport.adminConfig.superAdminsGroup val configResourceTypes = TestSupport.configResourceTypes - override implicit val patienceConfig = PatienceConfig(5 seconds) + override implicit val patienceConfig: PatienceConfig = PatienceConfig(5 seconds) "Google group sync" should "add/remove the right emails and handle errors" in { // tests that emails only in sam get added to google // emails only in google are removed diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/StatusServiceSpecs/StatusServiceSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/StatusServiceSpecs/StatusServiceSpec.scala index f9143a11e..0035997d9 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/StatusServiceSpecs/StatusServiceSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/StatusServiceSpecs/StatusServiceSpec.scala @@ -27,8 +27,8 @@ class StatusServiceSpec with BeforeAndAfterAll with StatusServiceMatchers { implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global - implicit val system = ActorSystem("StatusServiceSpec") - implicit override val patienceConfig = PatienceConfig(timeout = 1 second) + implicit val system: ActorSystem = ActorSystem("StatusServiceSpec") + implicit override val patienceConfig: PatienceConfig = PatienceConfig(timeout = 1 second) val allUsersGroup: BasicWorkbenchGroup = BasicWorkbenchGroup(CloudExtensions.allUsersGroupName, Set(), WorkbenchEmail("all_users@fake.com")) diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/util/DatabaseSupportSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/util/DatabaseSupportSpec.scala index 6e43dfc64..9cdffd8a6 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/util/DatabaseSupportSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/util/DatabaseSupportSpec.scala @@ -12,13 +12,13 @@ import scalikejdbc.DBSession import java.util.UUID import java.util.concurrent.CyclicBarrier -import scala.concurrent.Future +import scala.concurrent.{ExecutionContextExecutor, Future} import cats.effect.Temporal import cats.effect.unsafe.implicits.global import org.broadinstitute.dsde.workbench.sam.TestSupport.{databaseEnabled, databaseEnabledClue} class DatabaseSupportSpec extends AnyFreeSpec with Matchers with BeforeAndAfterEach with TestSupport { - implicit val ec = scala.concurrent.ExecutionContext.global + implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global object DatabaseSupport extends DatabaseSupport { override protected lazy val writeDbRef: TestDbReference = TestSupport.dbRef override protected lazy val readDbRef: TestDbReference = TestSupport.dbRef From 229310edabfe27739a3941c0e37c589a3c44c23c Mon Sep 17 00:00:00 2001 From: David An Date: Wed, 16 Oct 2024 09:05:09 -0400 Subject: [PATCH 5/7] fix assembly merging --- project/Merging.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/Merging.scala b/project/Merging.scala index 809b49c0d..742661e18 100644 --- a/project/Merging.scala +++ b/project/Merging.scala @@ -16,6 +16,7 @@ object Merging { case PathList("META-INF", "kotlin-stdlib-common.kotlin_module") => MergeStrategy.first case PathList("META-INF", "okio.kotlin_module") => MergeStrategy.first case PathList("META-INF", "versions", "9", "OSGI-INF", "MANIFEST.MF") => MergeStrategy.first + case PathList("META-INF", "license", "LICENSE.mvn-wrapper.txt") => MergeStrategy.first case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.first case "module-info.class" => MergeStrategy.discard From 300d37d450ffd9515f97b42bb179c8d999321930 Mon Sep 17 00:00:00 2001 From: David An Date: Wed, 16 Oct 2024 09:46:58 -0400 Subject: [PATCH 6/7] fix safe.directory for pact --- .github/workflows/verify_consumer_pacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_consumer_pacts.yml b/.github/workflows/verify_consumer_pacts.yml index 75729e7b5..3a58ddb86 100644 --- a/.github/workflows/verify_consumer_pacts.yml +++ b/.github/workflows/verify_consumer_pacts.yml @@ -320,7 +320,7 @@ jobs: -e JANITOR_TRACK_RESOURCE_PROJECT_ID="" \ -e JANITOR_TRACK_RESOURCE_TOPIC_ID="" \ sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 \ - sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec" + bash -c "git config --global --add safe.directory /app && sbt \"set scalafmtOnCompile := false\" \"project pact4s\" \"testOnly *SamProviderSpec\"" 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. runs-on: ubuntu-latest From 489c628882b98e76668e327e6e3c9e7e1a35686d Mon Sep 17 00:00:00 2001 From: David An Date: Wed, 16 Oct 2024 09:53:09 -0400 Subject: [PATCH 7/7] whoops, wrong dir for safe.directory --- .github/workflows/verify_consumer_pacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_consumer_pacts.yml b/.github/workflows/verify_consumer_pacts.yml index 3a58ddb86..6322defc9 100644 --- a/.github/workflows/verify_consumer_pacts.yml +++ b/.github/workflows/verify_consumer_pacts.yml @@ -320,7 +320,7 @@ jobs: -e JANITOR_TRACK_RESOURCE_PROJECT_ID="" \ -e JANITOR_TRACK_RESOURCE_TOPIC_ID="" \ sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.2_2.13.15 \ - bash -c "git config --global --add safe.directory /app && sbt \"set scalafmtOnCompile := false\" \"project pact4s\" \"testOnly *SamProviderSpec\"" + bash -c "git config --global --add safe.directory /working/sam && sbt \"set scalafmtOnCompile := false\" \"project pact4s\" \"testOnly *SamProviderSpec\"" 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. runs-on: ubuntu-latest