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

CORE-69: Minor and patch updates - commons-codec to 1.17.2 - azure-identity to 1.15.0 - billing-profile-manager-client to 0.1.598-SNAPSHOT - sentry-logback to 7.20.0 - workspace-manager-client to 0.254.1170-SNAPSHOT - google-cloud-nio to 0.127.29 - jersey-jnh-connector to 3.1.10 - scalafmt-core to 3.8.4 #3164

Merged
merged 11 commits into from
Jan 14, 2025
Merged
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ f5916aefb603a97498617785baa46bf5cf9e3164

# Scala Steward: Reformat with scalafmt 3.8.3
4ff2c5aaf0cd1acfbf510d0ffc9391849c16e9e3

# Scala Steward: Reformat with scalafmt 3.8.4
1381b307683c6b0a9db4e2fe94a5819b520d7253
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:

- uses: sbt/setup-sbt@v1
- uses: actions/checkout@v4
with:
fetch-depth: 2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: sbt/setup-sbt@v1

- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.8.3
version = 3.8.4
align = none
align.openParenCallSite = true
align.openParenDefnSite = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class WorkspaceApiSpec
"workspaceName" -> Map("namespace" -> projectName, "name" -> destWorkspaceName)
)

"to import method configs from another workspace" in {
"to import method configs from another workspace" in
withTemporaryBillingProject(billingAccountId) { projectName =>
withWorkspace(projectName,
prependUUID("reader-import-config-dest-workspace"),
Expand Down Expand Up @@ -358,9 +358,8 @@ class WorkspaceApiSpec
}(ownerAuthToken)
}(ownerAuthToken)
}(owner.makeAuthToken(billingScopes))
}

"to import method configs from the method repo" in {
"to import method configs from the method repo" in
withTemporaryBillingProject(billingAccountId) { projectName =>
withWorkspace(projectName,
prependUUID("reader-import-config-dest-workspace"),
Expand Down Expand Up @@ -394,7 +393,6 @@ class WorkspaceApiSpec
}(ownerAuthToken)
}(ownerAuthToken)
}(owner.makeAuthToken(billingScopes))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class BillingProjectDeletion(
for {
_ <- billingRepository.deleteBillingProject(projectName)
_ <- samDAO
.deleteResource(SamResourceTypeNames.billingProject, projectName.value, ctx) recoverWith { // Moving this to the end so that the rawls record is cleared even if there are issues clearing the Sam resource (theoretical workaround for https://broadworkbench.atlassian.net/browse/CA-1206)
.deleteResource(SamResourceTypeNames.billingProject,
projectName.value,
ctx
) recoverWith { // Moving this to the end so that the rawls record is cleared even if there are issues clearing the Sam resource (theoretical workaround for https://broadworkbench.atlassian.net/browse/CA-1206)
case t: Throwable =>
logger.warn(
s"Unexpected failure deleting billing project (while deleting billing project in Sam) for billing project `${projectName.value}`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ class HttpGoogleServicesDAO(val clientSecrets: GoogleClientSecrets,
firecloudHasAccess <- testTerraBillingAccountAccess(billingAccount)
userHasAccess <- cred.traverse(c => testBillingAccountAccess(billingAccount, c))
} yield
// Return false if the user does not have a Google token
firecloudHasAccess && userHasAccess.getOrElse(false)
// Return false if the user does not have a Google token
firecloudHasAccess && userHasAccess.getOrElse(false)
}

protected def testBillingAccountAccess(billingAccount: RawlsBillingAccountName, credential: Credential)(implicit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ class ShardedHttpExecutionServiceCluster(readMembers: Set[ClusterMember],
userInfo: UserInfo
): Unit = {
// execute but don't wait for completion
val labelFutureToIgnore = Future.traverse(parseSubWorkflowIdsFromMetadata(parentWorkflowMetadata)) {
subWorkflowId =>
retryUntilSuccessOrTimeout(failureLogMessage =
s"error patching label on workflow [$subWorkflowId], submission [$submissionId]"
)(2 seconds, 10 seconds) { () =>
getMember(executionServiceId).dao.patchLabels(subWorkflowId, userInfo, Map(SUBMISSION_ID_KEY -> submissionId))
}
val labelFutureToIgnore = Future.traverse(parseSubWorkflowIdsFromMetadata(parentWorkflowMetadata)) { subWorkflowId =>
retryUntilSuccessOrTimeout(failureLogMessage =
s"error patching label on workflow [$subWorkflowId], submission [$submissionId]"
)(2 seconds, 10 seconds) { () =>
getMember(executionServiceId).dao.patchLabels(subWorkflowId, userInfo, Map(SUBMISSION_ID_KEY -> submissionId))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,9 +1168,8 @@ trait EntityComponent {
// perform actual deletion (not hiding) of all entities in a workspace

def deleteFromDb(workspaceContext: Workspace): WriteAction[Int] =
EntityDependenciesDeletionQuery.deleteAction(workspaceContext) andThen {
EntityDependenciesDeletionQuery.deleteAction(workspaceContext) andThen
filter(_.workspaceId === workspaceContext.workspaceIdAsUUID).delete
}

def countReferringEntitiesForType(workspaceContext: Workspace, entityType: String): ReadAction[Int] =
EntityAndAttributesRawSqlQuery.countReferencesToType(workspaceContext, entityType).map(_.sum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,14 @@ trait RawlsBillingProjectComponent {
// - to keep an audit log of billing account changes
_ <- DBIO.sequence(billingProjects.map { project =>
// ignore all currently-outstanding changes for this project
BillingAccountChanges.ignoreAllOutstanding(project.projectName) andThen {
BillingAccountChanges.ignoreAllOutstanding(project.projectName) andThen
// insert the most recent change for this project
BillingAccountChanges.create(
project.projectName,
project.billingAccount,
billingAccount,
userSubjectId
)
}
})
} yield count
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,15 +675,14 @@ trait SubmissionComponent {
deleteSubmissionAttributes("WORKFLOW", "workflow_id"),
deleteFromTable("WORKFLOW_MESSAGE", "WORKFLOW", "workflow_id"),
deleteFromTable("SUBMISSION_VALIDATION", "WORKFLOW", "workflow_id")
) andThen {
) andThen
DBIO.sequence(Seq("WORKFLOW") map { workflow_table =>
// delete workflows
sqlu"""delete w from #$workflow_table w
inner join SUBMISSION s on w.submission_id=s.id
where s.workspace_id=$workspaceId
"""
})
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ trait WorkspaceFeatureFlagComponent {
def listFlagsForWorkspace(workspaceId: UUID,
flags: List[WorkspaceFeatureFlag]
): ReadAction[Seq[WorkspaceFeatureFlag]] =
filter(flag => flag.workspaceId === workspaceId && flag.flagName.inSetBind(flags.map(_.name))).result.map {
recs =>
recs.map(rec => WorkspaceFeatureFlag(rec.flagName))
filter(flag => flag.workspaceId === workspaceId && flag.flagName.inSetBind(flags.map(_.name))).result.map { recs =>
recs.map(rec => WorkspaceFeatureFlag(rec.flagName))
}

def deleteAllForWorkspace(workspaceId: UUID): ReadWriteAction[Int] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class DataRepoEntityProvider(snapshotModel: SnapshotModel,
// execute the query against BQ
queryResults <- runBigQuery(queryConfigBuilder, petKey, GoogleProject(googleProject.value))
} yield
// translate the BQ results into a single Rawls Entity
queryResultsToEntity(queryResults, entityType, pk)
// translate the BQ results into a single Rawls Entity
queryResultsToEntity(queryResults, entityType, pk)
resultIO.unsafeToFuture()
}

Expand Down Expand Up @@ -210,8 +210,8 @@ class DataRepoEntityProvider(snapshotModel: SnapshotModel,
// execute the query against BQ
queryResults <- runBigQuery(queryConfigBuilder, petKey, GoogleProject(googleProject.value))
} yield
// translate the BQ results into a Rawls query result
queryResultsToEntities(queryResults, entityType, pk)
// translate the BQ results into a Rawls query result
queryResultsToEntities(queryResults, entityType, pk)
resultIO.unsafeToFuture()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class OutputExpressionValidationVisitor
aggregate <- aggregateT
nextResult <- nextResultT
} yield
// return whichever of aggregate and nextResult is bound
if (aggregate(AttributeNull) == UnboundOutputExpression) nextResult
else aggregate
// return whichever of aggregate and nextResult is bound
if (aggregate(AttributeNull) == UnboundOutputExpression) nextResult
else aggregate

override def visitRelation(ctx: RelationContext): Try[Attribute => OutputExpression] =
Failure(new RawlsException("Entity references not permitted in the middle of output expressions"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,18 @@ class MethodConfigurationService(
getV2WorkspaceContextAndPermissions(methodRepoQuery.source.workspaceName, SamWorkspaceActions.read) flatMap {
workspaceContext =>
dataSource.inTransaction { dataAccess =>
withMethodConfig(workspaceContext,
methodRepoQuery.source.namespace,
methodRepoQuery.source.name,
dataAccess
) { methodConfig =>
DBIO.from(
methodRepoDAO.postMethodConfig(
methodRepoQuery.methodRepoNamespace,
methodRepoQuery.methodRepoName,
methodConfig.copy(namespace = methodRepoQuery.methodRepoNamespace,
name = methodRepoQuery.methodRepoName
),
ctx.userInfo
withMethodConfig(workspaceContext, methodRepoQuery.source.namespace, methodRepoQuery.source.name, dataAccess) {
methodConfig =>
DBIO.from(
methodRepoDAO.postMethodConfig(
methodRepoQuery.methodRepoNamespace,
methodRepoQuery.methodRepoName,
methodConfig.copy(namespace = methodRepoQuery.methodRepoNamespace,
name = methodRepoQuery.methodRepoName
),
ctx.userInfo
)
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ trait RawlsApiService

def apiRoutes =
options(complete(OK)) ~
withExecutionContext(ExecutionContext.global) { // Serve real work off the global EC to free up the dispatcher to run more routes, including status
withExecutionContext(
ExecutionContext.global
) { // Serve real work off the global EC to free up the dispatcher to run more routes, including status
traceRequests(baseApiRoutes)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ class WorkspaceService(
getV2WorkspaceContextAndPermissions(workspaceName, SamWorkspaceActions.read, Option(options.attrSpecs))
workspaceResponse <- getWorkspaceDetails(workspace, options, userProject)
} yield
// post-process JSON to remove calculated-but-undesired keys
deepFilterJsObject(workspaceResponse.toJson.asJsObject, options.options)
// post-process JSON to remove calculated-but-undesired keys
deepFilterJsObject(workspaceResponse.toJson.asJsObject, options.options)
)
}

Expand All @@ -259,8 +259,8 @@ class WorkspaceService(
getV2WorkspaceContextAndPermissionsById(workspaceId, SamWorkspaceActions.read, Option(options.attrSpecs))
workspaceResponse <- getWorkspaceDetails(workspace, options, userProject)
} yield
// post-process JSON to remove calculated-but-undesired keys
deepFilterJsObject(workspaceResponse.toJson.asJsObject, options.options)
// post-process JSON to remove calculated-but-undesired keys
deepFilterJsObject(workspaceResponse.toJson.asJsObject, options.options)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class HttpExecutionServiceDAOSpec
}
}

it should "get the version" in {
it should "get the version" in
withStatsD {
val result = test.version.futureValue
result.cromwell shouldBe "25"
Expand All @@ -191,6 +191,5 @@ class HttpExecutionServiceDAOSpec
Option(Subsystems.Cromwell)
))
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ class HttpSamDAOSpec
1 minute
)
assertResult(SamDAO.NotUser) {
Await.result(dao.getUserIdInfo(
"[email protected]",
RawlsRequestContext(UserInfo(RawlsUserEmail(""), OAuth2BearerToken(""), 0, RawlsUserSubjectId("")))
),
Duration.Inf
Await.result(
dao.getUserIdInfo(
"[email protected]",
RawlsRequestContext(UserInfo(RawlsUserEmail(""), OAuth2BearerToken(""), 0, RawlsUserSubjectId("")))
),
Duration.Inf
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class SubmissionCostServiceSpec extends AnyFlatSpec with RawlsTestUtils {
`SubmissionCostService#executeWorkflowCostQuery` passes other values to `startParameterizedQuery`, so
an exception will be thrown if a call is made to BigQuery in this case.
*/
it should "bypass BigQuery with no workflow IDs" in {
it should "bypass BigQuery with no workflow IDs" in
assertResult(Map.empty) {
Await.result(
submissionCostService.getSubmissionCosts("submission-id",
Expand All @@ -179,5 +179,4 @@ class SubmissionCostServiceSpec extends AnyFlatSpec with RawlsTestUtils {
1 minute
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1915,9 +1915,8 @@ class AttributeComponentSpec
attributeTestData.combinations(2).flatMap(x => List(x, x.reverse)).foreach {
case List(AttributeTestData(description1, attribute1), AttributeTestData(description2, attribute2)) =>
it should s"reflect ${attributeTestFunction.description} changes in " +
s"a new attribute when $description1 changes to $description2" in {
attributeTestFunction.run(attribute1, attribute2)
}
s"a new attribute when $description1 changes to $description2" in
attributeTestFunction.run(attribute1, attribute2)
case x =>
throw new Exception(s"${x} is unexpected")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class AttributeShardingSpec
)

uuidCases foreach { case (uuidString, expectedShardId) =>
it should s"calculate shardId for UUID('$uuidString') correctly" in {
it should s"calculate shardId for UUID('$uuidString') correctly" in
assertResult(expectedShardId)(determineShard(UUID.fromString(uuidString)))
}
}

}
Loading
Loading