Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scala-library from 2.13.10 to 2.13.12 #2540

Merged
merged 9 commits into from
Dec 13, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ object Boot extends IOApp with LazyLogging {
val gcsConfig = conf.getConfig("gcs")

// we need an ActorSystem to host our application in
implicit val system = ActorSystem("rawls")
implicit val materializer = ActorMaterializer()
implicit val system: ActorSystem = ActorSystem("rawls")
implicit val materializer: ActorMaterializer = ActorMaterializer()

val slickDataSource = DataSource(DatabaseConfig.forConfig[JdbcProfile]("slick", conf))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.broadinstitute.dsde.rawls.model.{
RawlsBillingAccountName,
RawlsRequestContext
}
import spray.json.DefaultJsonProtocol
import spray.json.{DefaultJsonProtocol, RootJsonFormat}

import java.util.{Date, UUID}
import scala.annotation.tailrec
Expand All @@ -26,7 +26,9 @@ import scala.util.{Failure, Success, Try}
case class BpmAzureReportErrorMessage(message: String, statusCode: Int)

object BpmAzureReportErrorMessageJsonProtocol extends DefaultJsonProtocol {
implicit val bpmAzureReportErrorMessageFormat = jsonFormat2(BpmAzureReportErrorMessage.apply)
implicit val bpmAzureReportErrorMessageFormat: RootJsonFormat[BpmAzureReportErrorMessage] = jsonFormat2(
BpmAzureReportErrorMessage.apply
)
}

import spray.json._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BillingProjectOrchestrator(ctx: RawlsRequestContext,
extends StringValidationUtils
with UserUtils
with LazyLogging {
implicit val errorReportSource = ErrorReportSource("rawls")
implicit val errorReportSource: ErrorReportSource = ErrorReportSource("rawls")

/**
* Creates a "v2" billing project, using either Azure managed app coordinates or a Google Billing Account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.apache.commons.io.IOUtils
import org.broadinstitute.dsde.rawls.model.GoogleProjectId
import org.broadinstitute.dsde.workbench.google2.GoogleBigQueryService
import org.broadinstitute.dsde.workbench.model.google.GoogleProject
import org.typelevel.log4cats.SelfAwareStructuredLogger
import org.typelevel.log4cats.slf4j.Slf4jLogger

import java.io.ByteArrayInputStream
Expand All @@ -23,8 +24,8 @@ import scala.concurrent.ExecutionContext
*/
class GoogleBigQueryServiceFactory(pathToCredentialJson: String)(implicit executionContext: ExecutionContext) {

implicit lazy val logger = Slf4jLogger.getLogger[IO]
implicit lazy val timer = Temporal[IO]
implicit lazy val logger: SelfAwareStructuredLogger[IO] = Slf4jLogger.getLogger[IO]
implicit lazy val timer: Temporal[IO] = Temporal[IO]

def getServiceForPet(petKey: String,
projectId: GoogleProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.broadinstitute.dsde.rawls.RawlsExceptionWithErrorReport
import org.broadinstitute.dsde.rawls.dataaccess.BondJsonSupport._
import org.broadinstitute.dsde.rawls.model.UserInfo
import org.broadinstitute.dsde.rawls.util.{HttpClientUtilsStandard, Retry}
import spray.json.RootJsonFormat

import scala.concurrent.{ExecutionContext, Future}

Expand All @@ -21,10 +22,12 @@ case class Providers(providers: List[String])
object BondJsonSupport {
import spray.json.DefaultJsonProtocol._

implicit val BondServiceAccountEmailFormat = jsonFormat1(BondServiceAccountEmail)
implicit val BondResponseDataFormat = jsonFormat1(BondResponseData)
implicit val BondServiceAccountEmailFormat: RootJsonFormat[BondServiceAccountEmail] = jsonFormat1(
BondServiceAccountEmail
)
implicit val BondResponseDataFormat: RootJsonFormat[BondResponseData] = jsonFormat1(BondResponseData)

implicit val providersFormat = jsonFormat1(Providers)
implicit val providersFormat: RootJsonFormat[Providers] = jsonFormat1(Providers)

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.broadinstitute.dsde.rawls.dataaccess

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.{Http, HttpExt}
import akka.http.scaladsl.client.RequestBuilding._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.marshalling.Marshal
Expand All @@ -16,7 +16,7 @@ import org.broadinstitute.dsde.rawls.metrics.{Expansion, InstrumentedRetry, Rawl
import org.broadinstitute.dsde.rawls.model.ExecutionJsonSupport._
import org.broadinstitute.dsde.rawls.model.StatusJsonSupport._
import org.broadinstitute.dsde.rawls.model._
import org.broadinstitute.dsde.rawls.util.{FutureSupport, HttpClientUtilsGzipInstrumented}
import org.broadinstitute.dsde.rawls.util.{FutureSupport, HttpClientUtils, HttpClientUtilsGzipInstrumented}
import spray.json.DefaultJsonProtocol._
import spray.json._

Expand All @@ -38,11 +38,11 @@ class HttpExecutionServiceDAO(executionServiceURL: String, override val workbenc
with LazyLogging
with RawlsInstrumented {

implicit private lazy val baseMetricBuilder =
implicit private lazy val baseMetricBuilder: ExpandedMetricBuilder =
ExpandedMetricBuilder.expand(SubsystemMetricKey, Subsystems.Cromwell)

override val http = Http(system)
override val httpClientUtils = HttpClientUtilsGzipInstrumented()
override val http: HttpExt = Http(system)
override val httpClientUtils: HttpClientUtils = HttpClientUtilsGzipInstrumented()

// Strip out workflow IDs from metrics by providing a redactedUriExpansion
override protected val UriExpansion: Expansion[Uri] = RawlsExpansion.redactedUriExpansion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import org.broadinstitute.dsde.workbench.google2.util.RetryPredicates
import org.broadinstitute.dsde.workbench.model.google.{GcsBucketName, GoogleProject, GoogleResourceTypes, IamPermission}
import org.broadinstitute.dsde.workbench.model.{TraceId, WorkbenchEmail}
import org.joda.time.DateTime
import org.typelevel.log4cats.SelfAwareStructuredLogger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import spray.json._

Expand Down Expand Up @@ -101,7 +102,7 @@ class HttpGoogleServicesDAO(val clientSecrets: GoogleClientSecrets,
with GoogleUtilities {
val http = Http(system)
val httpClientUtils = HttpClientUtilsStandard()
implicit val log4CatsLogger = Slf4jLogger.getLogger[IO]
implicit val log4CatsLogger: SelfAwareStructuredLogger[IO] = Slf4jLogger.getLogger[IO]

val groupMemberRole =
"MEMBER" // the Google Group role corresponding to a member (note that this is distinct from the GCS roles defined in WorkspaceAccessLevel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import org.broadinstitute.dsde.rawls.RawlsExceptionWithErrorReport
import org.broadinstitute.dsde.rawls.model.ImportStatuses.ImportStatus
import org.broadinstitute.dsde.rawls.model.{ImportStatuses, UserInfo, WorkspaceName}
import org.broadinstitute.dsde.rawls.util.{HttpClientUtilsStandard, Retry}
import spray.json.RootJsonFormat

import java.util.UUID
import scala.concurrent.{ExecutionContext, Future}

object ImportServiceJsonSupport {
import spray.json.DefaultJsonProtocol._

implicit val importServiceResponseFormat = jsonFormat2(ImportServiceResponse)
implicit val importServiceResponseFormat: RootJsonFormat[ImportServiceResponse] = jsonFormat2(ImportServiceResponse)
}

class HttpImportServiceDAO(url: String)(implicit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait DriverComponent extends StringValidationUtils {
val batchSize: Int // used for writes to group inserts/updates; must be explicitly utilized via custom business logic
val fetchSize: Int // used during Slick streaming to set the size of pages; must be explicitly set via withStatementParameters
implicit val executionContext: ExecutionContext
implicit override val errorReportSource = ErrorReportSource("rawls")
implicit override val errorReportSource: ErrorReportSource = ErrorReportSource("rawls")

// needed by MySQL but not actually used; we will always overwrite
val defaultTimeStamp = Timestamp.valueOf("2001-01-01 01:01:01.0")
Expand Down Expand Up @@ -108,8 +108,9 @@ trait RawSqlQuery {

import driver.api._

implicit val GetUUIDResult = GetResult(r => uuidColumnType.fromBytes(r.nextBytes()))
implicit val GetUUIDOptionResult = GetResult(r => Option(uuidColumnType.fromBytes(r.nextBytes())))
implicit val GetUUIDResult: GetResult[UUID] = GetResult(r => uuidColumnType.fromBytes(r.nextBytes()))
implicit val GetUUIDOptionResult: GetResult[Option[UUID]] =
GetResult(r => Option(uuidColumnType.fromBytes(r.nextBytes())))
implicit object SetUUIDParameter extends SetParameter[UUID] {
def apply(v: UUID, pp: PositionedParameters) { pp.setBytes(uuidColumnType.toBytes(v)) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ trait EntityComponent {
// noinspection SqlDialectInspection,DuplicatedCode
private object EntityRecordRawSqlQuery extends RawSqlQuery {
val driver: JdbcProfile = EntityComponent.this.driver
implicit val getEntityRecord = GetResult(r => EntityRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<))
implicit val getEntityRecord: GetResult[EntityRecord] =
GetResult(r => EntityRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<))

def action(workspaceId: UUID, entities: Set[AttributeEntityReference]): ReadAction[Seq[EntityRecord]] =
if (entities.isEmpty) {
Expand Down Expand Up @@ -317,7 +318,7 @@ trait EntityComponent {
val driver: JdbcProfile = EntityComponent.this.driver

// tells slick how to convert a result row from a raw sql query to an instance of EntityAndAttributesResult
implicit val getEntityAndAttributesResult = GetResult { r =>
implicit val getEntityAndAttributesResult: GetResult[EntityAndAttributesResult] = GetResult { r =>
// note that the number and order of all the r.<< match precisely with the select clause of baseEntityAndAttributeSql
val entityRec = EntityRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import org.broadinstitute.dsde.rawls.monitor.migration.MigrationUtils
import org.broadinstitute.dsde.rawls.monitor.migration.MigrationUtils.Implicits.InsertExtensionMethod
import org.broadinstitute.dsde.rawls.monitor.migration.MigrationUtils.Outcome
import org.broadinstitute.dsde.workbench.model.google.{BigQueryDatasetName, BigQueryTableName, GoogleProject}
import slick.ast.BaseTypedType
import slick.jdbc.JdbcType

import java.sql.Timestamp
import java.time.Instant
Expand Down Expand Up @@ -189,15 +191,18 @@ trait RawlsBillingProjectComponent {

// these 2 implicits are lazy because there is a timing problem initializing MappedColumnType, if they are not lazy
// we get null pointer exceptions
implicit lazy val googleApiTypeColumnType = MappedColumnType.base[GoogleApiType, String](
apiType => apiType.toString,
stringValue => GoogleApiTypes.withName(stringValue)
)

implicit lazy val googleOperationNameColumnType = MappedColumnType.base[GoogleOperationName, String](
operationName => operationName.toString,
stringValue => GoogleOperationNames.withName(stringValue)
)
implicit lazy val googleApiTypeColumnType: JdbcType[GoogleApiType] with BaseTypedType[GoogleApiType] =
MappedColumnType.base[GoogleApiType, String](
apiType => apiType.toString,
stringValue => GoogleApiTypes.withName(stringValue)
)

implicit lazy val googleOperationNameColumnType
: JdbcType[GoogleOperationName] with BaseTypedType[GoogleOperationName] =
MappedColumnType.base[GoogleOperationName, String](
operationName => operationName.toString,
stringValue => GoogleOperationNames.withName(stringValue)
)

class RawlsBillingProjectOperationTable(tag: Tag)
extends Table[RawlsBillingProjectOperationRecord](tag, "BILLING_PROJECT_OPERATION") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ trait SubmissionComponent {
externalEntity: Option[AttributeEntityReference]
)

implicit val getWorkflowMessagesListResult = GetResult { r =>
implicit val getWorkflowMessagesListResult: GetResult[WorkflowMessagesListResult] = GetResult { r =>
val workflowRec = WorkflowRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<)
val rootEntityTypeOption: Option[String] = r.<<

Expand Down Expand Up @@ -602,7 +602,7 @@ trait SubmissionComponent {
submissionAttributeRec: Option[SubmissionAttributeRecord]
)

implicit val getWorkflowInputResolutionListResult = GetResult { r =>
implicit val getWorkflowInputResolutionListResult: GetResult[WorkflowInputResolutionListResult] = GetResult { r =>
val workflowRec = WorkflowRecord(r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<, r.<<)
val (submissionValidation, attribute) = r.nextLongOption() match {
case Some(submissionValidationId) =>
Expand Down Expand Up @@ -685,7 +685,7 @@ trait SubmissionComponent {
object GatherStatusesForWorkspaceSubmissionsQuery extends RawSqlQuery {
val driver: JdbcProfile = SubmissionComponent.this.driver

implicit val getSubmissionWorkflowStatusResponse = GetResult { r =>
implicit val getSubmissionWorkflowStatusResponse: GetResult[SubmissionWorkflowStatusResponse] = GetResult { r =>
SubmissionWorkflowStatusResponse(r.<<, r.<<, r.<<, r.<<)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object RawlsExpansion {
* This takes an upper type bound {{{A <: RawlsEnumeration}}} so it can work with any
* subtype of RawlsEnumeration.
*/
implicit def RawlsEnumerationExpansion[A <: RawlsEnumeration[_]] = new Expansion[A] {}
implicit def RawlsEnumerationExpansion[A <: RawlsEnumeration[_]]: Expansion[A] = new Expansion[A] {}

/**
* Creates an expansion for Uri which redacts pieces of the Uri matched by the provided PathMatcher.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MethodRepoJsonSupport extends JsonSupport {
}
}

implicit val AgoraEntityFormat = jsonFormat10(AgoraEntity)
implicit val AgoraEntityFormat: RootJsonFormat[AgoraEntity] = jsonFormat10(AgoraEntity)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.broadinstitute.dsde.rawls.model
import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._
import org.broadinstitute.dsde.workbench.model._
import spray.json.DefaultJsonProtocol._
import spray.json.RootJsonFormat

/*
Resource type names
Expand Down Expand Up @@ -169,22 +170,37 @@ case class SamUserResource(resourceId: String,
case class SamUserStatusResponse(userSubjectId: String, userEmail: String, enabled: Boolean)

object SamModelJsonSupport extends JsonSupport {
implicit val SamFullyQualifiesResourceIdFormat = jsonFormat2(SamFullyQualifiedResourceId)
implicit val SamResourcePolicyNameFormat = ValueObjectFormat(SamResourcePolicyName)
implicit val SamResourceActionFormat = ValueObjectFormat(SamResourceAction)
implicit val SamResourceRoleFormat = ValueObjectFormat(SamResourceRole)

implicit val SamPolicyFormat = jsonFormat3(SamPolicy)
implicit val SamPolicyWithNameAndEmailFormat = jsonFormat3(SamPolicyWithNameAndEmail)
implicit val SamResourceWithPoliciesFormat = jsonFormat5(SamResourceWithPolicies)
implicit val SamResourceIdWithPolicyNameFormat = jsonFormat5(SamResourceIdWithPolicyName)
implicit val SamPolicySyncStatusFormat = jsonFormat2(SamPolicySyncStatus)

implicit val SamCreateResourceAccessPolicyIdResponseFormat = jsonFormat2(SamCreateResourceAccessPolicyIdResponse)
implicit val samCreateResourcePolicyResponseFormat = jsonFormat2(SamCreateResourcePolicyResponse)
implicit val SamCreateResourceResponseFormat = jsonFormat4(SamCreateResourceResponse)

implicit val SamRolesAndActionsFormat = jsonFormat2(SamRolesAndActions)
implicit val SamUserResourceFormat = jsonFormat6(SamUserResource)
implicit val SamUserStatusResponseFormat = jsonFormat3(SamUserStatusResponse)
implicit val SamFullyQualifiesResourceIdFormat: RootJsonFormat[SamFullyQualifiedResourceId] = jsonFormat2(
SamFullyQualifiedResourceId
)
implicit val SamResourcePolicyNameFormat: ValueObjectFormat[SamResourcePolicyName] = ValueObjectFormat(
SamResourcePolicyName
)
implicit val SamResourceActionFormat: ValueObjectFormat[SamResourceAction] = ValueObjectFormat(SamResourceAction)
implicit val SamResourceRoleFormat: ValueObjectFormat[SamResourceRole] = ValueObjectFormat(SamResourceRole)

implicit val SamPolicyFormat: RootJsonFormat[SamPolicy] = jsonFormat3(SamPolicy)
implicit val SamPolicyWithNameAndEmailFormat: RootJsonFormat[SamPolicyWithNameAndEmail] = jsonFormat3(
SamPolicyWithNameAndEmail
)
implicit val SamResourceWithPoliciesFormat: RootJsonFormat[SamResourceWithPolicies] = jsonFormat5(
SamResourceWithPolicies
)
implicit val SamResourceIdWithPolicyNameFormat: RootJsonFormat[SamResourceIdWithPolicyName] = jsonFormat5(
SamResourceIdWithPolicyName
)
implicit val SamPolicySyncStatusFormat: RootJsonFormat[SamPolicySyncStatus] = jsonFormat2(SamPolicySyncStatus)

implicit val SamCreateResourceAccessPolicyIdResponseFormat: RootJsonFormat[SamCreateResourceAccessPolicyIdResponse] =
jsonFormat2(SamCreateResourceAccessPolicyIdResponse)
implicit val samCreateResourcePolicyResponseFormat: RootJsonFormat[SamCreateResourcePolicyResponse] = jsonFormat2(
SamCreateResourcePolicyResponse
)
implicit val SamCreateResourceResponseFormat: RootJsonFormat[SamCreateResourceResponse] = jsonFormat4(
SamCreateResourceResponse
)

implicit val SamRolesAndActionsFormat: RootJsonFormat[SamRolesAndActions] = jsonFormat2(SamRolesAndActions)
implicit val SamUserResourceFormat: RootJsonFormat[SamUserResource] = jsonFormat6(SamUserResource)
implicit val SamUserStatusResponseFormat: RootJsonFormat[SamUserStatusResponse] = jsonFormat3(SamUserStatusResponse)
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ class SpendReportingJsonSupport extends JsonSupport {
}
}

implicit val SpendReportingAggregationKeyParameterFormat = jsonFormat2(SpendReportingAggregationKeyWithSub)
implicit val SpendReportingAggregationKeyParameterFormat: RootJsonFormat[SpendReportingAggregationKeyWithSub] =
jsonFormat2(SpendReportingAggregationKeyWithSub)

implicit val BillingProjectSpendConfigurationFormat = jsonFormat2(BillingProjectSpendConfiguration)
implicit val BillingProjectSpendConfigurationFormat: RootJsonFormat[BillingProjectSpendConfiguration] = jsonFormat2(
BillingProjectSpendConfiguration
)

implicit val SpendReportingAggregationFormat: JsonFormat[SpendReportingAggregation] = lazyFormat(
jsonFormat2(SpendReportingAggregation.apply)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.broadinstitute.dsde.rawls.model

import spray.json.RootJsonFormat

/**
* Created by dvoet on 10/27/15.
*/
Expand All @@ -10,8 +12,8 @@ case class UserList(userList: Seq[String])
class UserJsonSupport extends JsonSupport {
import spray.json.DefaultJsonProtocol._

implicit val UserIdInfoFormat = jsonFormat3(UserIdInfo)
implicit val UserListFormat = jsonFormat1(UserList)
implicit val UserIdInfoFormat: RootJsonFormat[UserIdInfo] = jsonFormat3(UserIdInfo)
implicit val UserListFormat: RootJsonFormat[UserList] = jsonFormat1(UserList)
}

object UserJsonSupport extends UserJsonSupport
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package org.broadinstitute.dsde.rawls

package object model {
implicit val errorReportSource = ErrorReportSource("rawls")
implicit val errorReportSource: ErrorReportSource = ErrorReportSource("rawls")
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ object AvroUpsertMonitorSupervisor {
)

import spray.json.DefaultJsonProtocol._
implicit val updateImportStatusFormat = jsonFormat5(UpdateImportStatus)
implicit val updateImportStatusFormat: RootJsonFormat[UpdateImportStatus] = jsonFormat5(UpdateImportStatus)
}

case class UpdateImportStatus(importId: String,
Expand Down Expand Up @@ -227,7 +227,7 @@ class AvroUpsertMonitorActor(val pollInterval: FiniteDuration,
jobId: String,
startTime: String
)
implicit val avroMetadataJsonFormat = jsonFormat6(AvroMetadataJson)
implicit val avroMetadataJsonFormat: RootJsonFormat[AvroMetadataJson] = jsonFormat6(AvroMetadataJson)

self ! StartMonitorPass

Expand Down
Loading
Loading