From 1edc40efd09e12485dbf68d9862210b26d349037 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Mon, 3 Jun 2024 22:21:27 +0800 Subject: [PATCH 01/11] update spotless version --- README.md | 4 +++- build.gradle | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab7dcd7685bde..892362705036e 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ The checkstyle warnings will be found in `reports/checkstyle/reports/main.html` subproject build directories. They are also printed to the console. The build will fail if Checkstyle fails. #### Spotless #### -The import order is a part of static check. please call `spotlessApply` to optimize the imports of Java codes before filing pull request : +The import order is a part of static check. please call `spotlessApply` (require JDK 11+) to optimize the imports of Java codes before filing pull request : ./gradlew spotlessApply @@ -311,3 +311,5 @@ Apache Kafka is interested in building the community; we would welcome any thoug To contribute follow the instructions here: * https://kafka.apache.org/contributing.html + + Make sure you pass it before you submit. checkstyle and spotless (require JDK 11+) diff --git a/build.gradle b/build.gradle index a2a6531d29a62..63718e3999791 100644 --- a/build.gradle +++ b/build.gradle @@ -47,9 +47,10 @@ plugins { // Updating the shadow plugin version to 8.1.1 causes issue with signing and publishing the shadowed // artifacts - see https://github.com/johnrengelman/shadow/issues/901 id 'com.github.johnrengelman.shadow' version '8.1.0' apply false - // the minimum required JRE of 6.14.0+ is 11 + // the spotless before 6.14.0 support JDK8, after 6.23.3 support JDK21 // refer:https://github.com/diffplug/spotless/tree/main/plugin-gradle#requirements - id 'com.diffplug.spotless' version "6.13.0" apply false + // https://github.com/diffplug/spotless/pull/1920 + id 'com.diffplug.spotless' version "6.25.0" apply false } ext { @@ -799,7 +800,7 @@ subprojects { skipConfigurations = [ "zinc" ] } - if (project.name in spotlessApplyModules) { + if (JavaVersion.current().isJava11Compatible() && (project.name in spotlessApplyModules)) { apply plugin: 'com.diffplug.spotless' spotless { java { From 911fa3fe914f0fa1eec80c5c162eb4a591e91f1a Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 10:54:18 +0800 Subject: [PATCH 02/11] update include to exclude --- build.gradle | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 63718e3999791..6bc216fd2a517 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,7 @@ plugins { // artifacts - see https://github.com/johnrengelman/shadow/issues/901 id 'com.github.johnrengelman.shadow' version '8.1.0' apply false // the spotless before 6.14.0 support JDK8, after 6.23.3 support JDK21 + // we have to give in support JDK 8 // refer:https://github.com/diffplug/spotless/tree/main/plugin-gradle#requirements // https://github.com/diffplug/spotless/pull/1920 id 'com.diffplug.spotless' version "6.25.0" apply false @@ -201,7 +202,60 @@ def determineCommitId() { } } -def spotlessApplyModules = [''] +def excludedSpotlessModules = ['clients','connect', + 'api', + 'basic-auth-extension', + 'file', + 'json', + 'mirror', + 'mirror-client', + 'runtime', + 'test-plugins', + 'transforms', + 'core', + 'examples', + 'generator', + 'group-coordinator', + 'jmh-benchmarks', + 'log4j-appender', + 'metadata', + 'raft', + 'server', + 'server-common', + 'shell', + 'storage', + 'storage-api', // in settings.gradle rename + 'streams', + 'examples', + 'streams-scala', + 'test-utils', + 'upgrade-system-tests-0100', + 'upgrade-system-tests-0101', + 'upgrade-system-tests-0102', + 'upgrade-system-tests-0110', + 'upgrade-system-tests-10', + 'upgrade-system-tests-11', + 'upgrade-system-tests-20', + 'upgrade-system-tests-21', + 'upgrade-system-tests-22', + 'upgrade-system-tests-23', + 'upgrade-system-tests-24', + 'upgrade-system-tests-25', + 'upgrade-system-tests-26', + 'upgrade-system-tests-27', + 'upgrade-system-tests-28', + 'upgrade-system-tests-30', + 'upgrade-system-tests-31', + 'upgrade-system-tests-32', + 'upgrade-system-tests-33', + 'upgrade-system-tests-34', + 'upgrade-system-tests-35', + 'upgrade-system-tests-36', + 'upgrade-system-tests-37', + 'tools', + 'tools-api', + 'transaction-coordinator', + 'trogdor'] apply from: file('wrapper.gradle') @@ -800,7 +854,7 @@ subprojects { skipConfigurations = [ "zinc" ] } - if (JavaVersion.current().isJava11Compatible() && (project.name in spotlessApplyModules)) { + if(JavaVersion.current().isJava11Compatible() && project.name !in excludedSpotlessModules) { apply plugin: 'com.diffplug.spotless' spotless { java { From fa9f002a4c6a159f143eb67c720d1279116d3b1f Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 13:12:05 +0800 Subject: [PATCH 03/11] update name to path --- build.gradle | 112 +++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/build.gradle b/build.gradle index 6bc216fd2a517..20935cee0391c 100644 --- a/build.gradle +++ b/build.gradle @@ -202,60 +202,60 @@ def determineCommitId() { } } -def excludedSpotlessModules = ['clients','connect', - 'api', - 'basic-auth-extension', - 'file', - 'json', - 'mirror', - 'mirror-client', - 'runtime', - 'test-plugins', - 'transforms', - 'core', - 'examples', - 'generator', - 'group-coordinator', - 'jmh-benchmarks', - 'log4j-appender', - 'metadata', - 'raft', - 'server', - 'server-common', - 'shell', - 'storage', - 'storage-api', // in settings.gradle rename - 'streams', - 'examples', - 'streams-scala', - 'test-utils', - 'upgrade-system-tests-0100', - 'upgrade-system-tests-0101', - 'upgrade-system-tests-0102', - 'upgrade-system-tests-0110', - 'upgrade-system-tests-10', - 'upgrade-system-tests-11', - 'upgrade-system-tests-20', - 'upgrade-system-tests-21', - 'upgrade-system-tests-22', - 'upgrade-system-tests-23', - 'upgrade-system-tests-24', - 'upgrade-system-tests-25', - 'upgrade-system-tests-26', - 'upgrade-system-tests-27', - 'upgrade-system-tests-28', - 'upgrade-system-tests-30', - 'upgrade-system-tests-31', - 'upgrade-system-tests-32', - 'upgrade-system-tests-33', - 'upgrade-system-tests-34', - 'upgrade-system-tests-35', - 'upgrade-system-tests-36', - 'upgrade-system-tests-37', - 'tools', - 'tools-api', - 'transaction-coordinator', - 'trogdor'] +def excludedSpotlessModules = [':clients', + ':connect:api', + ':connect:basic-auth-extension', + ':connect:file', + ':connect:json', + ':connect:mirror', + ':connect:mirror-client', + ':connect:runtime', + ':connect:test-plugins', + ':connect:transforms', + ':core', + ':examples', + ':generator', + ':group-coordinator', + ':jmh-benchmarks', + ':log4j-appender', + ':metadata', + ':raft', + ':server', + ':server-common', + ':shell', + ':storage', + ':storage:api', + ':streams', + ':streams:examples', + ':streams:streams-scala', + ':streams:test-utils', + ':streams:upgrade-system-tests-0100', + ':streams:upgrade-system-tests-0101', + ':streams:upgrade-system-tests-0102', + ':streams:upgrade-system-tests-0110', + ':streams:upgrade-system-tests-10', + ':streams:upgrade-system-tests-11', + ':streams:upgrade-system-tests-20', + ':streams:upgrade-system-tests-21', + ':streams:upgrade-system-tests-22', + ':streams:upgrade-system-tests-23', + ':streams:upgrade-system-tests-24', + ':streams:upgrade-system-tests-25', + ':streams:upgrade-system-tests-26', + ':streams:upgrade-system-tests-27', + ':streams:upgrade-system-tests-28', + ':streams:upgrade-system-tests-30', + ':streams:upgrade-system-tests-31', + ':streams:upgrade-system-tests-32', + ':streams:upgrade-system-tests-33', + ':streams:upgrade-system-tests-34', + ':streams:upgrade-system-tests-35', + ':streams:upgrade-system-tests-36', + ':streams:upgrade-system-tests-37', + ':tools', + ':tools:tools-api', + ':transaction-coordinator', + ':trogdor'] apply from: file('wrapper.gradle') @@ -853,8 +853,8 @@ subprojects { skipProjects = [ ":jmh-benchmarks", ":trogdor" ] skipConfigurations = [ "zinc" ] } - - if(JavaVersion.current().isJava11Compatible() && project.name !in excludedSpotlessModules) { + + if(JavaVersion.current().isJava11Compatible() && project.path !in excludedSpotlessModules) { apply plugin: 'com.diffplug.spotless' spotless { java { From 94530397e8a164a6a126f020d2e80b9110005155 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 13:20:13 +0800 Subject: [PATCH 04/11] update exclude module name to path --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 20935cee0391c..764bdac6d712d 100644 --- a/build.gradle +++ b/build.gradle @@ -224,7 +224,7 @@ def excludedSpotlessModules = [':clients', ':server-common', ':shell', ':storage', - ':storage:api', + ':storage:storage-api', // rename in settings.gradle ':streams', ':streams:examples', ':streams:streams-scala', From efe7050d535951408b909a3cda691f1e5ed5dc94 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 13:55:39 +0800 Subject: [PATCH 05/11] update comment --- build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 764bdac6d712d..5f7c427c67389 100644 --- a/build.gradle +++ b/build.gradle @@ -47,10 +47,8 @@ plugins { // Updating the shadow plugin version to 8.1.1 causes issue with signing and publishing the shadowed // artifacts - see https://github.com/johnrengelman/shadow/issues/901 id 'com.github.johnrengelman.shadow' version '8.1.0' apply false - // the spotless before 6.14.0 support JDK8, after 6.23.3 support JDK21 - // we have to give in support JDK 8 - // refer:https://github.com/diffplug/spotless/tree/main/plugin-gradle#requirements - // https://github.com/diffplug/spotless/pull/1920 + // Spotless 6.13.0 has issue with Java 21 (see https://github.com/diffplug/spotless/pull/1920), and Spotless 6.14.0+ requires JRE 11 + // We are going to drop JDK8 support. Hence, the spotless is upgrade to newest version and be applied only if the build env is compatible with JDK 11. id 'com.diffplug.spotless' version "6.25.0" apply false } From ca30c329c74471687ea5924801d0f4c13b1f8da2 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 14:20:52 +0800 Subject: [PATCH 06/11] Reduced version test ci --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5f7c427c67389..c2e9aaf7c6261 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ plugins { id 'com.github.johnrengelman.shadow' version '8.1.0' apply false // Spotless 6.13.0 has issue with Java 21 (see https://github.com/diffplug/spotless/pull/1920), and Spotless 6.14.0+ requires JRE 11 // We are going to drop JDK8 support. Hence, the spotless is upgrade to newest version and be applied only if the build env is compatible with JDK 11. - id 'com.diffplug.spotless' version "6.25.0" apply false + id 'com.diffplug.spotless' version "6.24.0" apply false } ext { From 854aa326fddf3f2e83d7ea738336d95f21727a8f Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 15:10:46 +0800 Subject: [PATCH 07/11] update version and add comment --- README.md | 2 +- build.gradle | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 892362705036e..ebb8ea9bcd577 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ The checkstyle warnings will be found in `reports/checkstyle/reports/main.html` subproject build directories. They are also printed to the console. The build will fail if Checkstyle fails. #### Spotless #### -The import order is a part of static check. please call `spotlessApply` (require JDK 11+) to optimize the imports of Java codes before filing pull request : +The import order is a part of static check. please call `spotlessApply` (require JDK 11+) to optimize the imports of Java codes before filing pull request, if Java env incompatible JDK11 the task will be skipped. ./gradlew spotlessApply diff --git a/build.gradle b/build.gradle index c2e9aaf7c6261..3f6656ed630b2 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,8 @@ plugins { id 'com.github.johnrengelman.shadow' version '8.1.0' apply false // Spotless 6.13.0 has issue with Java 21 (see https://github.com/diffplug/spotless/pull/1920), and Spotless 6.14.0+ requires JRE 11 // We are going to drop JDK8 support. Hence, the spotless is upgrade to newest version and be applied only if the build env is compatible with JDK 11. - id 'com.diffplug.spotless' version "6.24.0" apply false + // spotless 6.25.0 has issue in runtime with JDK8 even through we define it with `apply:false`. see https://github.com/diffplug/spotless/issues/2156 for more details + id 'com.diffplug.spotless' version "6.14.0" apply false } ext { From abc921e9ea7e33f4ca950fb2f23dd24b9ed53719 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 17:39:18 +0800 Subject: [PATCH 08/11] remove verbose word --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ebb8ea9bcd577..ebaab0d45193c 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ The checkstyle warnings will be found in `reports/checkstyle/reports/main.html` subproject build directories. They are also printed to the console. The build will fail if Checkstyle fails. #### Spotless #### -The import order is a part of static check. please call `spotlessApply` (require JDK 11+) to optimize the imports of Java codes before filing pull request, if Java env incompatible JDK11 the task will be skipped. +The import order is a part of static check. please call `spotlessApply` (require JDK 11+) to optimize the imports of Java codes before filing pull request. ./gradlew spotlessApply From a015ce607eef890d4eb1cd73f5ef2e114ec6fea4 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 17:41:19 +0800 Subject: [PATCH 09/11] move commit comment --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ebaab0d45193c..4e53395e0045a 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ If needed, you can specify the Scala version with `-PscalaVersion=2.13`. There are two code quality analysis tools that we regularly run, spotbugs and checkstyle. #### Checkstyle #### -Checkstyle enforces a consistent coding style in Kafka. +Checkstyle enforces a consistent coding style in Kafka. Make sure you pass it before you submit. You can run checkstyle using: ./gradlew checkstyleMain checkstyleTest spotlessCheck @@ -311,5 +311,3 @@ Apache Kafka is interested in building the community; we would welcome any thoug To contribute follow the instructions here: * https://kafka.apache.org/contributing.html - - Make sure you pass it before you submit. checkstyle and spotless (require JDK 11+) From b5de9227f2fdf500350fe69aa2e70db990c40e98 Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Tue, 4 Jun 2024 19:19:28 +0800 Subject: [PATCH 10/11] Update README.md remove verbose word --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e53395e0045a..8419e7cf1ad9c 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ If needed, you can specify the Scala version with `-PscalaVersion=2.13`. There are two code quality analysis tools that we regularly run, spotbugs and checkstyle. #### Checkstyle #### -Checkstyle enforces a consistent coding style in Kafka. Make sure you pass it before you submit. +Checkstyle enforces a consistent coding style in Kafka. You can run checkstyle using: ./gradlew checkstyleMain checkstyleTest spotlessCheck From 75ede30efc37d835b6da326cfada1268646deaec Mon Sep 17 00:00:00 2001 From: gongxuanzhang Date: Wed, 5 Jun 2024 09:50:54 +0800 Subject: [PATCH 11/11] add future module --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3f6656ed630b2..676ddda7cab23 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ plugins { id 'com.github.johnrengelman.shadow' version '8.1.0' apply false // Spotless 6.13.0 has issue with Java 21 (see https://github.com/diffplug/spotless/pull/1920), and Spotless 6.14.0+ requires JRE 11 // We are going to drop JDK8 support. Hence, the spotless is upgrade to newest version and be applied only if the build env is compatible with JDK 11. - // spotless 6.25.0 has issue in runtime with JDK8 even through we define it with `apply:false`. see https://github.com/diffplug/spotless/issues/2156 for more details + // spotless 6.15.0+ has issue in runtime with JDK8 even through we define it with `apply:false`. see https://github.com/diffplug/spotless/issues/2156 for more details id 'com.diffplug.spotless' version "6.14.0" apply false } @@ -214,6 +214,7 @@ def excludedSpotlessModules = [':clients', ':core', ':examples', ':generator', + ':group-coordinator:group-coordinator-api', // https://github.com/apache/kafka/pull/16198 ':group-coordinator', ':jmh-benchmarks', ':log4j-appender',