From 3257df6a1c44f8666619757d2ed85d1014386af3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:01:41 -0500 Subject: [PATCH] [CORE-69]: Bump com.diffplug.spotless:spotless-plugin-gradle from 6.25.0 to 7.0.1 (#1821) * [CORE-69]: Bump com.diffplug.spotless:spotless-plugin-gradle Bumps [com.diffplug.spotless:spotless-plugin-gradle](https://github.com/diffplug/spotless) from 6.25.0 to 7.0.1. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/gradle/6.25.0...gradle/7.0.1) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-plugin-gradle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * spotless --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Douglas Voet --- .../database/DatabaseDao.java | 23 ++++++++++++++----- buildSrc/build.gradle | 2 +- .../app/controller/ResourceApiController.java | 6 ++--- .../workspace/common/utils/GcpUtils.java | 10 ++++---- .../bio/terra/workspace/db/WorkspaceDao.java | 6 +++-- .../workspace/CloneAllResourcesFlight.java | 22 +++++++++--------- .../workspace/common/mocks/MockGcpApi.java | 6 ++--- 7 files changed, 44 insertions(+), 31 deletions(-) diff --git a/azureDatabaseUtils/src/main/java/bio/terra/workspace/azureDatabaseUtils/database/DatabaseDao.java b/azureDatabaseUtils/src/main/java/bio/terra/workspace/azureDatabaseUtils/database/DatabaseDao.java index f5e2568126..3c0202a845 100644 --- a/azureDatabaseUtils/src/main/java/bio/terra/workspace/azureDatabaseUtils/database/DatabaseDao.java +++ b/azureDatabaseUtils/src/main/java/bio/terra/workspace/azureDatabaseUtils/database/DatabaseDao.java @@ -74,7 +74,9 @@ public boolean createRole(String roleName) { jdbcTemplate.update( """ CREATE ROLE "%s" - """.formatted(roleName), Map.of()); + """ + .formatted(roleName), + Map.of()); return true; } catch (BadSqlGrammarException e) { // ignore if the role already exists @@ -97,7 +99,9 @@ public boolean deleteRole(String roleName) { jdbcTemplate.update( """ DROP ROLE "%s" - """.formatted(roleName), Map.of()); + """ + .formatted(roleName), + Map.of()); return true; } catch (BadSqlGrammarException e) { // ignore if the role already deleted @@ -114,14 +118,17 @@ public void grantRole(String roleName, String targetRoleName) { jdbcTemplate.update( """ GRANT "%s" TO "%s" - """.formatted(targetRoleName, roleName), Map.of()); + """ + .formatted(targetRoleName, roleName), + Map.of()); } public void reassignOwner(String roleName, String targetRoleName) { jdbcTemplate.update( """ REASSIGN OWNED BY "%s" TO "%s" - """.formatted(roleName, targetRoleName), + """ + .formatted(roleName, targetRoleName), Map.of()); } @@ -150,7 +157,9 @@ public void revokeLoginPrivileges(String roleName) { jdbcTemplate.update( """ ALTER ROLE "%s" NOLOGIN - """.formatted(roleName), Map.of()); + """ + .formatted(roleName), + Map.of()); } public void restoreLoginPrivileges(String roleName) { @@ -159,7 +168,9 @@ public void restoreLoginPrivileges(String roleName) { jdbcTemplate.update( """ ALTER ROLE "%s" LOGIN - """.formatted(roleName), Map.of()); + """ + .formatted(roleName), + Map.of()); } /** diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index a74ed25624..a67a44a411 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -12,7 +12,7 @@ dependencies { implementation 'org.apache.commons:commons-compress:1.27.1' implementation 'io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.1.7' implementation 'org.springframework.boot:spring-boot-gradle-plugin:3.4.1' - implementation group: 'com.diffplug.spotless', name: 'spotless-plugin-gradle', version: '6.25.0' + implementation group: 'com.diffplug.spotless', name: 'spotless-plugin-gradle', version: '7.0.1' implementation 'com.srcclr.gradle:com.srcclr.gradle.gradle.plugin:3.1.12' testImplementation group: 'org.jacoco', name: 'org.jacoco.agent', version: '0.8.12' } diff --git a/service/src/main/java/bio/terra/workspace/app/controller/ResourceApiController.java b/service/src/main/java/bio/terra/workspace/app/controller/ResourceApiController.java index 5a0120373d..99cf748771 100644 --- a/service/src/main/java/bio/terra/workspace/app/controller/ResourceApiController.java +++ b/service/src/main/java/bio/terra/workspace/app/controller/ResourceApiController.java @@ -148,10 +148,10 @@ private WsmResource validateWorkspaceOrResourceReadAccess( throw workspaceException; } } - // there's no valid case where the user will be able to access a referenced resource, - // but not the workspace itself + // there's no valid case where the user will be able to access a referenced resource, + // but not the workspace itself case REFERENCED -> throw workspaceException; - // if no access, throw original exception to avoid leaking information on resource + // if no access, throw original exception to avoid leaking information on resource default -> throw workspaceException; } } diff --git a/service/src/main/java/bio/terra/workspace/common/utils/GcpUtils.java b/service/src/main/java/bio/terra/workspace/common/utils/GcpUtils.java index 08b94baa0a..85b330ca07 100644 --- a/service/src/main/java/bio/terra/workspace/common/utils/GcpUtils.java +++ b/service/src/main/java/bio/terra/workspace/common/utils/GcpUtils.java @@ -97,16 +97,16 @@ public static void pollAndRetry( Code code = Code.values()[intCode]; String errorMessage = operation.getOperationAdapter().getError().getMessage(); switch (code) { - // 400 + // 400 case INVALID_ARGUMENT, OUT_OF_RANGE, FAILED_PRECONDITION -> throw new BadRequestException(errorMessage); - // 401 + // 401 case UNAUTHENTICATED -> throw new UnauthorizedException(errorMessage); - // 403 - This includes the "CPU quota limit exceeded" error for AI notebooks. + // 403 - This includes the "CPU quota limit exceeded" error for AI notebooks. case PERMISSION_DENIED -> throw new ForbiddenException(errorMessage); - // 409 + // 409 case ALREADY_EXISTS, ABORTED -> throw new ConflictException(errorMessage); - // 429 + // 429 case RESOURCE_EXHAUSTED -> throw new BadRequestException(errorMessage); default -> throw new RetryException( diff --git a/service/src/main/java/bio/terra/workspace/db/WorkspaceDao.java b/service/src/main/java/bio/terra/workspace/db/WorkspaceDao.java index 0b2549b1c5..d255ba1f50 100644 --- a/service/src/main/java/bio/terra/workspace/db/WorkspaceDao.java +++ b/service/src/main/java/bio/terra/workspace/db/WorkspaceDao.java @@ -152,12 +152,14 @@ WHERE W.workspace_id IN (:workspace_ids) """; private static final String WORKSPACE_CONTEXT_BY_WORKSPACE_ID_QUERY = - WORKSPACE_CONTEXT_SELECT + """ + WORKSPACE_CONTEXT_SELECT + + """ WHERE W.workspace_id = :workspace_id """; private static final String WORKSPACE_CONTEXT_BY_USER_FACING_ID_QUERY = - WORKSPACE_CONTEXT_SELECT + """ + WORKSPACE_CONTEXT_SELECT + + """ WHERE user_facing_id = :user_facing_id """; diff --git a/service/src/main/java/bio/terra/workspace/service/resource/controlled/flight/clone/workspace/CloneAllResourcesFlight.java b/service/src/main/java/bio/terra/workspace/service/resource/controlled/flight/clone/workspace/CloneAllResourcesFlight.java index 3dfdfa882d..7770baffd5 100644 --- a/service/src/main/java/bio/terra/workspace/service/resource/controlled/flight/clone/workspace/CloneAllResourcesFlight.java +++ b/service/src/main/java/bio/terra/workspace/service/resource/controlled/flight/clone/workspace/CloneAllResourcesFlight.java @@ -61,7 +61,7 @@ private void addFlightLaunchStepsForResource( break; case CONTROLLED: switch (resourceCloneInputs.getResource().getResourceType()) { - // GCP + // GCP case CONTROLLED_GCP_GCS_BUCKET -> { addStep( new LaunchCloneGcsBucketResourceFlightStep( @@ -88,11 +88,11 @@ private void addFlightLaunchStepsForResource( resourceCloneInputs.getFlightId()), RetryRules.cloudLongRunning()); } - // CONTROLLED_GCP_AI_NOTEBOOK_INSTANCE: not supported - // CONTROLLED_GCP_GCE_INSTANCE: not supported - // CONTROLLED_GCP_DATAPROC_CLUSTER: not supported + // CONTROLLED_GCP_AI_NOTEBOOK_INSTANCE: not supported + // CONTROLLED_GCP_GCE_INSTANCE: not supported + // CONTROLLED_GCP_DATAPROC_CLUSTER: not supported - // Azure + // Azure case CONTROLLED_AZURE_STORAGE_CONTAINER -> { addStep( new LaunchCloneControlledAzureStorageContainerResourceFlightStep( @@ -133,14 +133,14 @@ private void addFlightLaunchStepsForResource( RetryRules.shortDatabase()); } - // CONTROLLED_AZURE_DISK, CONTROLLED_AZURE_VM, CONTROLLED_AZURE_BATCH_POOL: not - // supported / implemented + // CONTROLLED_AZURE_DISK, CONTROLLED_AZURE_VM, CONTROLLED_AZURE_BATCH_POOL: not + // supported / implemented - // AWS - // TODO(BENCH-694): support clone CONTROLLED_AWS_S3_STORAGE_FOLDER - // CONTROLLED_AWS_SAGEMAKER_NOTEBOOK: not supported + // AWS + // TODO(BENCH-694): support clone CONTROLLED_AWS_S3_STORAGE_FOLDER + // CONTROLLED_AWS_SAGEMAKER_NOTEBOOK: not supported - // Flexible + // Flexible case CONTROLLED_FLEXIBLE_RESOURCE -> { addStep( new LaunchCloneControlledFlexibleResourceFlightStep( diff --git a/service/src/test/java/bio/terra/workspace/common/mocks/MockGcpApi.java b/service/src/test/java/bio/terra/workspace/common/mocks/MockGcpApi.java index 491e00225a..3915d306a4 100644 --- a/service/src/test/java/bio/terra/workspace/common/mocks/MockGcpApi.java +++ b/service/src/test/java/bio/terra/workspace/common/mocks/MockGcpApi.java @@ -266,9 +266,9 @@ public ApiCloneControlledGcpGcsBucketResult cloneControlledGcsBucketAsyncAndExpe failureSteps.put( SetNoOpBucketCloneResponseStep.class.getName(), StepStatus.STEP_RESULT_FAILURE_FATAL); } - // Avoid undoing creation of a bucket we have copied data into by failing the flight - // earlier - // as the deletion can often take > 1h on the GCP side. + // Avoid undoing creation of a bucket we have copied data into by failing the flight + // earlier + // as the deletion can often take > 1h on the GCP side. case RESOURCE, DEFINITION -> { failureSteps.put( CopyGcsBucketDefinitionStep.class.getName(), StepStatus.STEP_RESULT_FAILURE_FATAL);