Skip to content

Commit f795209

Browse files
EricWittmannjsenko
authored andcommitted
Remove spotless - it has been a net productivity loss overall
1 parent 67eb40b commit f795209

31 files changed

+3
-182
lines changed

.github/workflows/release-images.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
- name: Build Registry
102102
run: |
103103
cd registry
104-
./mvnw clean package -am --no-transfer-progress -Pprod -DskipTests=true -DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 -Dspotless.check.skip=true
104+
./mvnw clean package -am --no-transfer-progress -Pprod -DskipTests=true -DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5
105105
106106
- name: Build Registry UI
107107
working-directory: registry/ui

.github/workflows/release-maven-artifacts.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
retry_wait_seconds: 120
7979
command: |
8080
cd registry
81-
mvn deploy --batch-mode -Pprod -Prelease -DskipTests -Dspotless.check.skip=true --settings /home/runner/.m2/settings.xml
81+
mvn deploy --batch-mode -Pprod -Prelease -DskipTests --settings /home/runner/.m2/settings.xml
8282
8383
- name: Slack Notification (Always)
8484
if: always()

.github/workflows/release-sboms.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Maven Install
6363
run: |
6464
cd registry
65-
mvn install -Pprod -DskipTests -Dspotless.check.skip=true
65+
mvn install -Pprod -DskipTests
6666
6767
- name: Generate Maven SBOMs
6868
run: |

operator/controller/src/main/java/io/apicurio/registry/operator/ApicurioRegistry3Reconciler.java

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static io.apicurio.registry.operator.resource.ActivationConditions.*;
2424
import static io.apicurio.registry.operator.resource.ResourceKey.*;
2525

26-
// spotless:off
2726
@ControllerConfiguration(
2827
dependents = {
2928
// ===== Registry App
@@ -77,7 +76,6 @@
7776
)
7877
}
7978
)
80-
// spotless:on
8179
// TODO: When renaming, do not forget to update application.properties (until we have a test for this).
8280
public class ApicurioRegistry3Reconciler implements Reconciler<ApicurioRegistry3>,
8381
ErrorStatusHandler<ApicurioRegistry3>, Cleaner<ApicurioRegistry3> {

operator/controller/src/main/java/io/apicurio/registry/operator/Configuration.java

-10
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,31 @@ private Configuration() {
1111
}
1212

1313
public static String getAppImage() {
14-
// spotless:off
1514
return config.getOptionalValue("registry.app.image", String.class)
1615
.or(() -> config.getOptionalValue("related.image.registry.app.image", String.class))
1716
.orElseThrow(() -> new OperatorException("Required configuration option 'registry.app.image' is not set."));
18-
// spotless:on
1917
}
2018

2119
public static String getUIImage() {
22-
// spotless:off
2320
return config.getOptionalValue("registry.ui.image", String.class)
2421
.or(() -> config.getOptionalValue("related.image.registry.ui.image", String.class))
2522
.orElseThrow(() -> new OperatorException("Required configuration option 'registry.ui.image' is not set."));
26-
// spotless:on
2723
}
2824

2925
public static String getStudioUIImage() {
30-
// spotless:off
3126
return config.getOptionalValue("studio.ui.image", String.class)
3227
.or(() -> config.getOptionalValue("related.image.studio.ui.image", String.class))
3328
.orElseThrow(() -> new OperatorException("Required configuration option 'studio.ui.image' is not set."));
34-
// spotless:on
3529
}
3630

3731
public static String getRegistryVersion() {
38-
// spotless:off
3932
return config.getOptionalValue("registry.version", String.class)
4033
.orElseThrow(() -> new OperatorException("Required configuration option 'registry.version' is not set."));
41-
// spotless:on
4234
}
4335

4436
public static String getDefaultBaseHost() {
45-
// spotless:off
4637
return config.getOptionalValue("apicurio.operator.default-base-host", String.class)
4738
.map(v -> "." + v)
4839
.orElse("");
49-
// spotless:on
5040
}
5141
}

operator/controller/src/main/java/io/apicurio/registry/operator/feat/KafkaSqlTLS.java

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class KafkaSqlTLS {
2525
public static boolean configureKafkaSQLTLS(ApicurioRegistry3 primary, Deployment deployment,
2626
String containerName, Map<String, EnvVar> env) {
2727

28-
// spotless:off
2928
var keystore = new SecretKeyRefTool(getKafkaSqlTLSSpec(primary)
3029
.map(KafkaSqlTLSSpec::getKeystoreSecretRef)
3130
.orElse(null), "user.p12");
@@ -41,7 +40,6 @@ public static boolean configureKafkaSQLTLS(ApicurioRegistry3 primary, Deployment
4140
var truststorePassword = new SecretKeyRefTool(getKafkaSqlTLSSpec(primary)
4241
.map(KafkaSqlTLSSpec::getTruststorePasswordSecretRef)
4342
.orElse(null), "ca.password");
44-
// spotless:on
4543

4644
if (truststore.isValid() && truststorePassword.isValid() && keystore.isValid()
4745
&& keystorePassword.isValid()) {
@@ -68,13 +66,11 @@ public static boolean configureKafkaSQLTLS(ApicurioRegistry3 primary, Deployment
6866
}
6967

7068
private static Optional<KafkaSqlTLSSpec> getKafkaSqlTLSSpec(ApicurioRegistry3 primary) {
71-
// spotless:off
7269
return ofNullable(primary)
7370
.map(ApicurioRegistry3::getSpec)
7471
.map(ApicurioRegistry3Spec::getApp)
7572
.map(AppSpec::getStorage)
7673
.map(StorageSpec::getKafkasql)
7774
.map(KafkaSqlSpec::getTls);
78-
// spotless:on
7975
}
8076
}

operator/controller/src/main/java/io/apicurio/registry/operator/resource/LabelDiscriminators.java

-18
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ public static class AppDeploymentDiscriminator extends LabelDiscriminator<Deploy
2222
public static final ResourceDiscriminator<Deployment, ApicurioRegistry3> INSTANCE = new AppDeploymentDiscriminator();
2323

2424
public AppDeploymentDiscriminator() {
25-
// spotless:off
2625
super(Map.of(
2726
"app.kubernetes.io/name", "apicurio-registry",
2827
"app.kubernetes.io/component", COMPONENT_APP
2928
));
30-
// spotless:on
3129
}
3230
}
3331

@@ -36,12 +34,10 @@ public static class AppServiceDiscriminator extends LabelDiscriminator<Service>
3634
public static final ResourceDiscriminator<Service, ApicurioRegistry3> INSTANCE = new AppServiceDiscriminator();
3735

3836
public AppServiceDiscriminator() {
39-
// spotless:off
4037
super(Map.of(
4138
"app.kubernetes.io/name", "apicurio-registry",
4239
"app.kubernetes.io/component", COMPONENT_APP
4340
));
44-
// spotless:on
4541
}
4642
}
4743

@@ -50,12 +46,10 @@ public static class AppIngressDiscriminator extends LabelDiscriminator<Ingress>
5046
public static final ResourceDiscriminator<Ingress, ApicurioRegistry3> INSTANCE = new AppIngressDiscriminator();
5147

5248
public AppIngressDiscriminator() {
53-
// spotless:off
5449
super(Map.of(
5550
"app.kubernetes.io/name", "apicurio-registry",
5651
"app.kubernetes.io/component", COMPONENT_APP
5752
));
58-
// spotless:on
5953
}
6054
}
6155

@@ -66,12 +60,10 @@ public static class UIDeploymentDiscriminator extends LabelDiscriminator<Deploym
6660
public static final ResourceDiscriminator<Deployment, ApicurioRegistry3> INSTANCE = new UIDeploymentDiscriminator();
6761

6862
public UIDeploymentDiscriminator() {
69-
// spotless:off
7063
super(Map.of(
7164
"app.kubernetes.io/name", "apicurio-registry",
7265
"app.kubernetes.io/component", COMPONENT_UI
7366
));
74-
// spotless:on
7567
}
7668
}
7769

@@ -80,12 +72,10 @@ public static class UIServiceDiscriminator extends LabelDiscriminator<Service> {
8072
public static ResourceDiscriminator<Service, ApicurioRegistry3> INSTANCE = new UIServiceDiscriminator();
8173

8274
public UIServiceDiscriminator() {
83-
// spotless:off
8475
super(Map.of(
8576
"app.kubernetes.io/name", "apicurio-registry",
8677
"app.kubernetes.io/component", COMPONENT_UI
8778
));
88-
// spotless:on
8979
}
9080
}
9181

@@ -94,12 +84,10 @@ public static class UIIngressDiscriminator extends LabelDiscriminator<Ingress> {
9484
public static ResourceDiscriminator<Ingress, ApicurioRegistry3> INSTANCE = new UIIngressDiscriminator();
9585

9686
public UIIngressDiscriminator() {
97-
// spotless:off
9887
super(Map.of(
9988
"app.kubernetes.io/name", "apicurio-registry",
10089
"app.kubernetes.io/component", COMPONENT_UI
10190
));
102-
// spotless:on
10391
}
10492
}
10593

@@ -110,12 +98,10 @@ public static class StudioUIDeploymentDiscriminator extends LabelDiscriminator<D
11098
public static final ResourceDiscriminator<Deployment, ApicurioRegistry3> INSTANCE = new StudioUIDeploymentDiscriminator();
11199

112100
public StudioUIDeploymentDiscriminator() {
113-
// spotless:off
114101
super(Map.of(
115102
"app.kubernetes.io/name", "apicurio-registry",
116103
"app.kubernetes.io/component", COMPONENT_STUDIO_UI
117104
));
118-
// spotless:on
119105
}
120106
}
121107

@@ -124,12 +110,10 @@ public static class StudioUIServiceDiscriminator extends LabelDiscriminator<Serv
124110
public static ResourceDiscriminator<Service, ApicurioRegistry3> INSTANCE = new StudioUIServiceDiscriminator();
125111

126112
public StudioUIServiceDiscriminator() {
127-
// spotless:off
128113
super(Map.of(
129114
"app.kubernetes.io/name", "apicurio-registry",
130115
"app.kubernetes.io/component", COMPONENT_STUDIO_UI
131116
));
132-
// spotless:on
133117
}
134118
}
135119

@@ -138,12 +122,10 @@ public static class StudioUIIngressDiscriminator extends LabelDiscriminator<Ingr
138122
public static ResourceDiscriminator<Ingress, ApicurioRegistry3> INSTANCE = new StudioUIIngressDiscriminator();
139123

140124
public StudioUIIngressDiscriminator() {
141-
// spotless:off
142125
super(Map.of(
143126
"app.kubernetes.io/name", "apicurio-registry",
144127
"app.kubernetes.io/component", COMPONENT_STUDIO_UI
145128
));
146-
// spotless:on
147129
}
148130
}
149131
}

operator/controller/src/main/java/io/apicurio/registry/operator/resource/ResourceFactory.java

-12
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public Deployment getDefaultAppDeployment(ApicurioRegistry3 primary) {
4646
.map(AppSpec::getPodTemplateSpec).orElse(null)); // TODO:
4747
// Replicas
4848
mergeDeploymentPodTemplateSpec(
49-
// spotless:off
5049
r.getSpec().getTemplate(),
5150
REGISTRY_APP_CONTAINER_NAME,
5251
Configuration.getAppImage(),
@@ -55,7 +54,6 @@ public Deployment getDefaultAppDeployment(ApicurioRegistry3 primary) {
5554
new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/health/live").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build(),
5655
Map.of("cpu", new Quantity("500m"), "memory", new Quantity("512Mi")),
5756
Map.of("cpu", new Quantity("1"), "memory", new Quantity("1Gi"))
58-
// spotless:on
5957
);
6058
addDefaultLabels(r.getMetadata().getLabels(), primary, COMPONENT_APP);
6159
addSelectorLabels(r.getSpec().getSelector().getMatchLabels(), primary, COMPONENT_APP);
@@ -71,7 +69,6 @@ public Deployment getDefaultUIDeployment(ApicurioRegistry3 primary) {
7169
.map(UiSpec::getPodTemplateSpec).orElse(null)); // TODO:
7270
// Replicas
7371
mergeDeploymentPodTemplateSpec(
74-
// spotless:off
7572
r.getSpec().getTemplate(),
7673
REGISTRY_UI_CONTAINER_NAME,
7774
Configuration.getUIImage(),
@@ -80,7 +77,6 @@ public Deployment getDefaultUIDeployment(ApicurioRegistry3 primary) {
8077
new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/config.js").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build(),
8178
Map.of("cpu", new Quantity("100m"), "memory", new Quantity("256Mi")),
8279
Map.of("cpu", new Quantity("200m"), "memory", new Quantity("512Mi"))
83-
// spotless:on
8480
);
8581
addDefaultLabels(r.getMetadata().getLabels(), primary, COMPONENT_UI);
8682
addSelectorLabels(r.getSpec().getSelector().getMatchLabels(), primary, COMPONENT_UI);
@@ -96,7 +92,6 @@ public Deployment getDefaultStudioUIDeployment(ApicurioRegistry3 primary) {
9692
.map(StudioUiSpec::getPodTemplateSpec).orElse(null)); // TODO:
9793
// Replicas
9894
mergeDeploymentPodTemplateSpec(
99-
// spotless:off
10095
r.getSpec().getTemplate(),
10196
STUDIO_UI_CONTAINER_NAME,
10297
Configuration.getStudioUIImage(),
@@ -105,7 +100,6 @@ public Deployment getDefaultStudioUIDeployment(ApicurioRegistry3 primary) {
105100
new ProbeBuilder().withHttpGet(new HTTPGetActionBuilder().withPath("/config.js").withPort(new IntOrString(8080)).withScheme("HTTP").build()).build(),
106101
Map.of("cpu", new Quantity("100m"), "memory", new Quantity("256Mi")),
107102
Map.of("cpu", new Quantity("200m"), "memory", new Quantity("512Mi"))
108-
// spotless:on
109103
);
110104
addDefaultLabels(r.getMetadata().getLabels(), primary, COMPONENT_STUDIO_UI);
111105
addSelectorLabels(r.getSpec().getSelector().getMatchLabels(), primary, COMPONENT_STUDIO_UI);
@@ -135,7 +129,6 @@ private static Deployment initDefaultDeployment(ApicurioRegistry3 primary, Strin
135129
* Merge default values for a Deployment into the target PTS (from spec).
136130
*/
137131
private static void mergeDeploymentPodTemplateSpec(
138-
// spotless:off
139132
PodTemplateSpec target,
140133
String containerName,
141134
String image,
@@ -144,7 +137,6 @@ private static void mergeDeploymentPodTemplateSpec(
144137
Probe livenessProbe,
145138
Map<String, Quantity> requests,
146139
Map<String, Quantity> limits
147-
// spotless:on
148140
) {
149141
if (target.getMetadata() == null) {
150142
target.setMetadata(new ObjectMeta());
@@ -241,7 +233,6 @@ private <T extends HasMetadata> T getDefaultResource(ApicurioRegistry3 primary,
241233
}
242234

243235
private void addDefaultLabels(Map<String, String> labels, ApicurioRegistry3 primary, String component) {
244-
// spotless:off
245236
labels.putAll(Map.of(
246237
"app", primary.getMetadata().getName(),
247238
"app.kubernetes.io/name", "apicurio-registry",
@@ -251,19 +242,16 @@ private void addDefaultLabels(Map<String, String> labels, ApicurioRegistry3 prim
251242
"app.kubernetes.io/part-of", "apicurio-registry",
252243
"app.kubernetes.io/managed-by", "apicurio-registry-operator"
253244
));
254-
// spotless:on
255245
}
256246

257247
private void addSelectorLabels(Map<String, String> labels, ApicurioRegistry3 primary, String component) {
258-
// spotless:off
259248
labels.putAll(Map.of(
260249
"app", primary.getMetadata().getName(),
261250
"app.kubernetes.io/name", "apicurio-registry",
262251
"app.kubernetes.io/component", component,
263252
"app.kubernetes.io/instance", primary.getMetadata().getName(),
264253
"app.kubernetes.io/part-of", "apicurio-registry"
265254
));
266-
// spotless:on
267255
}
268256

269257
public static <T> T deserialize(String path, Class<T> klass) {

operator/controller/src/main/java/io/apicurio/registry/operator/resource/ResourceKey.java

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
@ToString(onlyExplicitlyIncluded = true)
2323
public class ResourceKey<R> {
2424

25-
// spotless:off
2625
public static final String REGISTRY_ID = "ApicurioRegistry3Reconciler";
2726

2827
public static final String APP_DEPLOYMENT_ID = "AppDeploymentResource";
@@ -93,7 +92,6 @@ public class ResourceKey<R> {
9392
StudioUIIngressDiscriminator.INSTANCE, ResourceFactory.INSTANCE::getDefaultStudioUIIngress
9493
);
9594

96-
// spotless:on
9795

9896
@EqualsAndHashCode.Include
9997
@ToString.Include

operator/controller/src/main/java/io/apicurio/registry/operator/resource/app/AppDeploymentResource.java

-5
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@
3535
import static java.util.Objects.requireNonNull;
3636
import static java.util.Optional.ofNullable;
3737

38-
// spotless:off
3938
@KubernetesDependent(
4039
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
4140
resourceDiscriminator = AppDeploymentDiscriminator.class
4241
)
43-
// spotless:on
4442
public class AppDeploymentResource extends CRUDKubernetesDependentResource<Deployment, ApicurioRegistry3> {
4543

4644
private static final Logger log = LoggerFactory.getLogger(AppDeploymentResource.class);
@@ -58,7 +56,6 @@ protected Deployment desired(ApicurioRegistry3 primary, Context<ApicurioRegistry
5856
ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getApp).map(AppSpec::getEnv)
5957
.ifPresent(env -> env.forEach(e -> envVars.put(e.getName(), e)));
6058

61-
// spotless:off
6259
addEnvVar(envVars, new EnvVarBuilder().withName(EnvironmentVariables.QUARKUS_PROFILE).withValue("prod").build());
6360
addEnvVar(envVars, new EnvVarBuilder().withName(EnvironmentVariables.QUARKUS_HTTP_ACCESS_LOG_ENABLED).withValue("true").build());
6461

@@ -86,8 +83,6 @@ protected Deployment desired(ApicurioRegistry3 primary, Context<ApicurioRegistry
8683
.withValue("true").build());
8784
});
8885

89-
// spotless:on
90-
9186
// Configure the storage (Postgresql or KafkaSql).
9287
ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getApp).map(AppSpec::getStorage)
9388
.map(StorageSpec::getType).ifPresent(storageType -> {

operator/controller/src/main/java/io/apicurio/registry/operator/resource/app/AppIngressResource.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
import static io.apicurio.registry.operator.utils.IngressUtils.withIngressRule;
1717
import static io.apicurio.registry.operator.utils.Mapper.toYAML;
1818

19-
// spotless:off
2019
@KubernetesDependent(
2120
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
2221
resourceDiscriminator = AppIngressDiscriminator.class
2322
)
24-
// spotless:on
2523
public class AppIngressResource extends CRUDKubernetesDependentResource<Ingress, ApicurioRegistry3> {
2624

2725
private static final Logger log = LoggerFactory.getLogger(AppIngressResource.class);

operator/controller/src/main/java/io/apicurio/registry/operator/resource/app/AppServiceResource.java

-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
import static io.apicurio.registry.operator.resource.ResourceKey.APP_SERVICE_KEY;
1414
import static io.apicurio.registry.operator.utils.Mapper.toYAML;
1515

16-
// spotless:off
1716
@KubernetesDependent(
1817
labelSelector = "app.kubernetes.io/name=apicurio-registry,app.kubernetes.io/component=" + COMPONENT_APP,
1918
resourceDiscriminator = AppServiceDiscriminator.class
2019
)
21-
// spotless:on
2220
public class AppServiceResource extends CRUDKubernetesDependentResource<Service, ApicurioRegistry3> {
2321

2422
private static final Logger log = LoggerFactory.getLogger(AppServiceResource.class);

0 commit comments

Comments
 (0)