This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new cfd5063  [SPARK-53628] Upgrade `PMD/SpotBugs` and enable checking on 
Java 25
cfd5063 is described below

commit cfd5063c595c445eee3d9d94e5dc9d17590ed5d4
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Sep 17 16:29:34 2025 -0700

    [SPARK-53628] Upgrade `PMD/SpotBugs` and enable checking on Java 25
    
    ### What changes were proposed in this pull request?
    
    This PR aims to upgrade `pmd` and `spotbugs` test dependency and enable it 
on Java 25.
    
    ### Why are the changes needed?
    
    Previously, `PMD` and `SpotBugs` check are enabled only on Java 17 and 21.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No behavior change because this is a code quality check during building.
    
    ### How was this patch tested?
    
    Pass the CIs. Java 25 test pipeline will cover this.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #322 from dongjoon-hyun/SPARK-53628.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 build.gradle                                       | 30 ++++++++++------------
 config/pmd/ruleset.xml                             |  1 +
 gradle/libs.versions.toml                          |  6 ++---
 .../k8s/operator/probe/ReadinessProbeTest.java     |  1 -
 .../k8s/operator/utils/StatusRecorderTest.java     |  3 ++-
 5 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/build.gradle b/build.gradle
index 91e643f..ea482e8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -71,24 +71,22 @@ subprojects {
     showViolations = true
   }
 
-  if (JavaVersion.current() < JavaVersion.VERSION_25) {
-    apply plugin: 'pmd'
-    pmd {
-      ruleSetFiles = files("$rootDir/config/pmd/ruleset.xml")
-      toolVersion = libs.versions.pmd.get()
-      consoleOutput = true
-      ignoreFailures = false
-    }
+  apply plugin: 'pmd'
+  pmd {
+    ruleSetFiles = files("$rootDir/config/pmd/ruleset.xml")
+    toolVersion = libs.versions.pmd.get()
+    consoleOutput = true
+    ignoreFailures = false
+  }
 
-    apply plugin: 'com.github.spotbugs'
-    spotbugs {
-      toolVersion = libs.versions.spotbugs.tool.get()
-      afterEvaluate {
-        reportsDir = file("${project.reporting.baseDirectory}/findbugs")
-      }
-      excludeFilter = file("$rootDir/config/spotbugs/spotbugs_exclude.xml")
-      ignoreFailures = false
+  apply plugin: 'com.github.spotbugs'
+  spotbugs {
+    toolVersion = libs.versions.spotbugs.tool.get()
+    afterEvaluate {
+      reportsDir = file("${project.reporting.baseDirectory}/findbugs")
     }
+    excludeFilter = file("$rootDir/config/spotbugs/spotbugs_exclude.xml")
+    ignoreFailures = false
   }
 
   apply plugin: 'jacoco'
diff --git a/config/pmd/ruleset.xml b/config/pmd/ruleset.xml
index 17aa102..f071c83 100644
--- a/config/pmd/ruleset.xml
+++ b/config/pmd/ruleset.xml
@@ -41,6 +41,7 @@
     <exclude name="TooManyStaticImports" />
     <exclude name="UseExplicitTypes" />
     <exclude name="UseUnderscoresInNumericLiterals" />
+    <exclude name="TypeParameterNamingConventions" />
   </rule>
   <rule ref="category/java/design.xml">
     <exclude name="AbstractClassWithoutAnyMethod" />
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 914274a..0df194e 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -30,9 +30,9 @@ mockito = "5.18.0"
 
 # Build Analysis
 checkstyle = "10.23.1"
-pmd = "7.13.0"
-spotbugs-tool = "4.9.3"
-spotbugs-plugin = "6.1.13"
+pmd = "7.17.0"
+spotbugs-tool = "4.9.6"
+spotbugs-plugin = "6.4.2"
 spotless-plugin = "6.25.0"
 
 # Packaging
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/probe/ReadinessProbeTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/probe/ReadinessProbeTest.java
index 4579afe..469df57 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/probe/ReadinessProbeTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/probe/ReadinessProbeTest.java
@@ -37,7 +37,6 @@ import org.mockito.Mockito;
 
 import org.apache.spark.k8s.operator.utils.ProbeUtil;
 
-@SuppressWarnings("PMD.UnitTestShouldIncludeAssert")
 class ReadinessProbeTest {
   KubernetesClient client;
   HttpExchange httpExchange;
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
index aa1fcc8..56bda41 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
@@ -86,7 +86,8 @@ class StatusRecorderTest {
             any());
   }
 
-  private static @NotNull SparkApplication getSparkApplication(String 
resourceVersion) {
+  @NotNull
+  private static SparkApplication getSparkApplication(String resourceVersion) {
     var updated = TestUtils.createMockApp(DEFAULT_NS);
     updated.getMetadata().setResourceVersion(resourceVersion);
     return updated;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to