You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "srdo (via GitHub)" <gi...@apache.org> on 2025/08/02 12:06:36 UTC

[PR] MINOR: Run CI with Java 24 [kafka]

srdo opened a new pull request, #20295:
URL: https://github.com/apache/kafka/pull/20295

   This commit updates CI to test against Java 24 instead of Java 23 which is EOL.
   
   Due to Spotbugs not having released version 4.9.4 yet, we can't run Spotbugs on Java 24. Instead, we are choosing to run Spotbugs, and the rest of the compile and validate build step, on Java 17 for now.
   
   Once 4.9.4 has released, we will switch to using Java 24 for this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2251698418


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+    // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable it until we can upgrade to that version.
+    project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")

Review Comment:
   Yes, but the secondary reason I added those flags is that running those tasks in that step is wasteful.
   
   `build.yml` runs the Spotbugs check here, running it with the JDK that I set to 17 with this PR.
   
   https://github.com/apache/kafka/blob/904ee87b8505813534937f20cec33f31d431564b/.github/workflows/build.yml#L143
   
   It is then a bit of a waste of time to run it again when the same script invokes `action.yml` here 
   
   https://github.com/apache/kafka/blob/904ee87b8505813534937f20cec33f31d431564b/.github/workflows/build.yml#L220
   
   so Spotbugs ends up running again alongside all the tests.
   
   I don't really see a benefit to running Spotbugs in both places?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2253131387


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {

Review Comment:
   open https://issues.apache.org/jira/browse/KAFKA-19580 to trace the spotbug upgrade.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2253545834


##########
docs/documentation/compatibility.html:
##########
@@ -30,7 +30,7 @@ <h2 class="anchor-heading">JDK Compatibility Across Kafka Versions</h2>
                 <th>Kafka Version</th>
                 <th>Java 11</th>
                 <th>Java 17</th>
-                <th>Java 23</th>
+                <th>Java 24</th>

Review Comment:
   Sure, done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2250949063


##########
.github/actions/run-gradle/action.yml:
##########
@@ -97,6 +97,8 @@ runs:
         -Pkafka.cluster.test.repeat=$TEST_REPEAT \
         -Pkafka.test.verbose=$TEST_VERBOSE \
         -PcommitId=xxxxxxxxxxxxxxxx \
+        -x spotbugsMain \

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2251698418


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+    // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable it until we can upgrade to that version.
+    project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")

Review Comment:
   Yes, but the secondary reason I added those flags is that running those tasks in that step is wasteful.
   
   `build.yml` runs the Spotbugs check here, running it with the JDK that I set to 17 with this PR.
   
   https://github.com/apache/kafka/blob/904ee87b8505813534937f20cec33f31d431564b/.github/workflows/build.yml#L143
   
   It is then a bit of a waste of time to run it again when the same script invokes `action.yml` here 
   
   https://github.com/apache/kafka/blob/904ee87b8505813534937f20cec33f31d431564b/.github/workflows/build.yml#L220
   
   I don't really see a benefit to running Spotbugs in both places?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2251929489


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+    // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable it until we can upgrade to that version.
+    project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")

Review Comment:
   Sure, added a comment to `action.yml` that should explain this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "srdo (via GitHub)" <gi...@apache.org>.
srdo commented on PR #20295:
URL: https://github.com/apache/kafka/pull/20295#issuecomment-3146551515

   The failures in the build scan steps are because (if I understand the Github docs at https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_run correctly) the ci-complete workflow executes based on the state of master, not the state of this branch. 
   
   This means that until this is merged, the old version of ci-complete will be used.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2251889407


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+    // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable it until we can upgrade to that version.
+    project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")

Review Comment:
   > I don't really see a benefit to running Spotbugs in both places?
   
   you are right. Could you please also add some comments? Our CI is a bit complex, so it would be helpful for readers to understand the context through you clear comments :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2251556852


##########
build.gradle:
##########
@@ -72,6 +72,12 @@ ext {
       "--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
     )
 
+  if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+    // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable it until we can upgrade to that version.
+    project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")

Review Comment:
   With this change, we should be able to remove `-x spotbugsMain` from the CI, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2250799163


##########
.github/actions/run-gradle/action.yml:
##########
@@ -97,6 +97,8 @@ runs:
         -Pkafka.cluster.test.repeat=$TEST_REPEAT \
         -Pkafka.test.verbose=$TEST_VERBOSE \
         -PcommitId=xxxxxxxxxxxxxxxx \
+        -x spotbugsMain \

Review Comment:
   Building Kafka locally with JDK 24 still results in a SpotBugs error. Could you please update the `build.gradle` file to skip SpotBugs check based on the JDK version?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #20295:
URL: https://github.com/apache/kafka/pull/20295


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Run CI with Java 24 [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20295:
URL: https://github.com/apache/kafka/pull/20295#discussion_r2253137334


##########
docs/documentation/compatibility.html:
##########
@@ -30,7 +30,7 @@ <h2 class="anchor-heading">JDK Compatibility Across Kafka Versions</h2>
                 <th>Kafka Version</th>
                 <th>Java 11</th>
                 <th>Java 17</th>
-                <th>Java 23</th>
+                <th>Java 24</th>

Review Comment:
   could you please revert this change? we don't run java 24 for 4.1 and 4.0 branch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org