Skip to content

Commit

Permalink
[CORE-69]: Bump com.diffplug.spotless:spotless-plugin-gradle from 6.2…
Browse files Browse the repository at this point in the history
…5.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](diffplug/spotless@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] <[email protected]>

* spotless

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Douglas Voet <[email protected]>
  • Loading branch information
dependabot[bot] and dvoet authored Jan 13, 2025
1 parent ca4ea0b commit 3257df6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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());
}

Expand Down Expand Up @@ -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) {
Expand All @@ -159,7 +168,9 @@ public void restoreLoginPrivileges(String roleName) {
jdbcTemplate.update(
"""
ALTER ROLE "%s" LOGIN
""".formatted(roleName), Map.of());
"""
.formatted(roleName),
Map.of());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
""";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void addFlightLaunchStepsForResource(
break;
case CONTROLLED:
switch (resourceCloneInputs.getResource().getResourceType()) {
// GCP
// GCP
case CONTROLLED_GCP_GCS_BUCKET -> {
addStep(
new LaunchCloneGcsBucketResourceFlightStep(
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3257df6

Please sign in to comment.