Skip to content

Commit 04add20

Browse files
committed
fix typos and some other issues
1 parent 1cf1d07 commit 04add20

8 files changed

Lines changed: 10 additions & 21 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ max_line_length = 120
1010
tab_width = 4
1111
ij_continuation_indent_size = 8
1212

13-
[*.yml]
13+
[{*.yml,*.yaml}]
1414
indent_size = 2
1515

1616
[*.md]

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ subprojects {
7070
options.errorprone {
7171
check("NullAway", CheckSeverity.ERROR)
7272
option("NullAway:AnnotatedPackages", "it.aboutbits.postgresql")
73+
option("NullAway:JSpecifyMode", "true")
7374
}
7475
}
7576

operator/build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import net.ltgt.gradle.errorprone.CheckSeverity
2-
import net.ltgt.gradle.errorprone.errorprone
3-
41
plugins {
52
id("io.quarkus")
63
}
@@ -67,16 +64,6 @@ dependencies {
6764
testImplementation(libs.datafaker)
6865
}
6966

70-
tasks.withType<JavaCompile> {
71-
options.encoding = "UTF-8"
72-
options.compilerArgs.add("-parameters")
73-
74-
options.errorprone {
75-
check("NullAway", CheckSeverity.ERROR)
76-
option("NullAway:AnnotatedPackages", "it.aboutbits.postgresql")
77-
}
78-
}
79-
8067
tasks.quarkusDev {
8168
// Java 24+ issue. Remove after this has been fixed.
8269
// https://github.com/quarkusio/quarkus/issues/47769#issuecomment-3148789105

operator/src/main/java/it/aboutbits/postgresql/crd/grant/GrantReconciler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private UpdateControl<Grant> reconcileInTransaction(
277277
}
278278

279279
// If we are not in the "ALL" mode, e.g. objects is an empty List, do explicit grants
280-
// We need to exclude objectType's DATABASE and SCHEMA as the CRD doesn't alllow to specify objects there
280+
// We need to exclude objectType's DATABASE and SCHEMA as the CRD doesn't allow to specify objects there
281281
if (!isAllMode
282282
|| objectType == GrantObjectType.DATABASE
283283
|| objectType == GrantObjectType.SCHEMA

operator/src/main/java/it/aboutbits/postgresql/crd/grant/GrantService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class GrantService {
4040
// language=SQL
4141
private static final String NAMESPACE_OID_SQL = "{0}::regnamespace";
4242

43-
/// Determines all existing privileges for the specified `role`, when applicable `schema`, and the given `objectTyoe`.
43+
/// Determines all existing privileges for the specified `role`, when applicable `schema`, and the given `objectType`.
4444
///
4545
/// @param tx The DSLContext for database operations.
4646
/// @param spec The GrantSpec containing the specification details.

operator/src/main/java/it/aboutbits/postgresql/crd/grant/GrantSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public class GrantSpec {
109109
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_VALUES)
110110
@ValidationRule(
111111
value = "self.size() > 0",
112-
message = "The Grant privileges must not be empty. The operator currently does not support revoking all privileges from existing roles (e.g. public user) by specifying an empty array."
112+
message = "The Grant privileges must not be empty. The Operator currently does not support revoking all privileges from existing roles (e.g. public user) by specifying an empty array."
113113
)
114114
private List<GrantPrivilege> privileges = new ArrayList<>();
115115
}

operator/src/test/java/it/aboutbits/postgresql/_support/testdata/persisted/creator/GrantCreate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected Grant create(int index) {
132132
spec.setSchema(getSchema());
133133
}
134134

135-
if ((withObjectType != GrantObjectType.DATABASE && withObjectType == GrantObjectType.SCHEMA)
135+
if ((withObjectType != GrantObjectType.DATABASE && withObjectType != GrantObjectType.SCHEMA)
136136
|| withObjects != null
137137
) {
138138
spec.setObjects(withObjects);

operator/src/test/java/it/aboutbits/postgresql/crd/grant/GrantReconcilerTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ void failWhenRoleIsBlankOrEmptyString(
132132
.hasMessageContaining("The Grant role must not be empty.");
133133
}
134134

135+
@ParameterizedTest
135136
@BlankSource
136137
@DisplayName("Should fail when the schema is a blank or empty String (CEL rule)")
137138
void failWhenSchemaIsBlankOrEmptyString(
@@ -151,7 +152,7 @@ void failWhenSchemaIsBlankOrEmptyString(
151152
}
152153

153154
@Test
154-
@DisplayName("Should fail when the privileges are a empty List (CEL rule)")
155+
@DisplayName("Should fail when the privileges are an empty List (CEL rule)")
155156
void failWhenPrivilegesAreAnEmptyList(
156157
) {
157158
// then
@@ -297,7 +298,7 @@ void failWhenDatabaseHasObjects() {
297298
}
298299

299300
@Test
300-
@DisplayName("Should fail when objectType is DATABASE but objects has items (CEL rule)")
301+
@DisplayName("Should fail when objectType is SCHEMA but objects has items (CEL rule)")
301302
void failWhenSchemaHasObjects() {
302303
// then
303304
assertThatThrownBy(() ->
@@ -603,7 +604,7 @@ void grantOnAllTables() {
603604
Set.of(SELECT)
604605
);
605606
assertThatPrivileges(
606-
clusterConnectionMain,
607+
clusterConnectionDb,
607608
grant,
608609
tableName2,
609610
Set.of(SELECT)

0 commit comments

Comments
 (0)