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

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 023833fe1f0 KAFKA-18778 Fix the inconsistent lastest supported version 
in StorageTool.scala and FutureCommand (#19157)
023833fe1f0 is described below

commit 023833fe1f067779e55931f28eacc9cb5c54c776
Author: Ken Huang <s7133...@gmail.com>
AuthorDate: Wed Jun 25 01:59:52 2025 +0800

    KAFKA-18778 Fix the inconsistent lastest supported version in 
StorageTool.scala and FutureCommand (#19157)
    
    To maintain code consistency, `MetadataVersion#fromVersionString` uses
    `latestTesting()` as the latest version. Therefore, in the tools, we
    also need to maintain consistency by updating the outer logging to use
    `latestTesting()`.
    
    See the discussion:
    https://github.com/apache/kafka/pull/18845#discussion_r1950706791
    
    Reviewers: Chia-Ping Tsai <chia7...@gmail.com>
---
 core/src/main/scala/kafka/tools/StorageTool.scala                  | 2 +-
 core/src/test/scala/unit/kafka/tools/StorageToolTest.scala         | 4 ++--
 tools/src/main/java/org/apache/kafka/tools/FeatureCommand.java     | 2 +-
 tools/src/test/java/org/apache/kafka/tools/FeatureCommandTest.java | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/src/main/scala/kafka/tools/StorageTool.scala 
b/core/src/main/scala/kafka/tools/StorageTool.scala
index c7b4f28e336..65307e0d766 100644
--- a/core/src/main/scala/kafka/tools/StorageTool.scala
+++ b/core/src/main/scala/kafka/tools/StorageTool.scala
@@ -184,7 +184,7 @@ object StorageTool extends Logging {
     } catch {
       case e: IllegalArgumentException =>
         throw new TerseFailure(s"Unknown release version '$releaseVersion'. 
Supported versions are: " +
-          s"${MetadataVersion.MINIMUM_VERSION.version} to 
${MetadataVersion.LATEST_PRODUCTION.version}")
+          s"${MetadataVersion.MINIMUM_VERSION.version} to 
${MetadataVersion.latestTesting().version()}")
     }
   }
 
diff --git a/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala 
b/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
index 28b132243e7..91e8d9fd33e 100644
--- a/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
+++ b/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
@@ -590,7 +590,7 @@ Found problem:
 
     assertEquals("Unknown release version '2.9-IV2'." +
       " Supported versions are: " + MetadataVersion.MINIMUM_VERSION.version +
-      " to " + MetadataVersion.LATEST_PRODUCTION.version, exception.getMessage
+      " to " + MetadataVersion.latestTesting().version, exception.getMessage
     )
 
     val exception2 = assertThrows(classOf[TerseFailure], () => {
@@ -599,7 +599,7 @@ Found problem:
 
     assertEquals("Unknown release version 'invalid'." +
       " Supported versions are: " + MetadataVersion.MINIMUM_VERSION.version +
-      " to " + MetadataVersion.LATEST_PRODUCTION.version, exception2.getMessage
+      " to " + MetadataVersion.latestTesting().version, exception2.getMessage
     )
   }
 
diff --git a/tools/src/main/java/org/apache/kafka/tools/FeatureCommand.java 
b/tools/src/main/java/org/apache/kafka/tools/FeatureCommand.java
index b3427b6a909..ca0ce8c4ac0 100644
--- a/tools/src/main/java/org/apache/kafka/tools/FeatureCommand.java
+++ b/tools/src/main/java/org/apache/kafka/tools/FeatureCommand.java
@@ -374,7 +374,7 @@ public class FeatureCommand {
         } catch (IllegalArgumentException e) {
             throw new TerseException("Unknown release version '" + 
releaseVersion + "'." +
                 " Supported versions are: " + MetadataVersion.MINIMUM_VERSION +
-                " to " + MetadataVersion.LATEST_PRODUCTION);
+                " to " + MetadataVersion.latestTesting().version());
         }
     }
 
diff --git a/tools/src/test/java/org/apache/kafka/tools/FeatureCommandTest.java 
b/tools/src/test/java/org/apache/kafka/tools/FeatureCommandTest.java
index 23794fde622..176a77b99db 100644
--- a/tools/src/test/java/org/apache/kafka/tools/FeatureCommandTest.java
+++ b/tools/src/test/java/org/apache/kafka/tools/FeatureCommandTest.java
@@ -458,7 +458,7 @@ public class FeatureCommandTest {
 
         assertEquals("Unknown release version '2.9-IV2'." +
             " Supported versions are: " + MetadataVersion.MINIMUM_VERSION +
-            " to " + MetadataVersion.LATEST_PRODUCTION, 
exception1.getMessage());
+            " to " + MetadataVersion.latestTesting().version(), 
exception1.getMessage());
 
         namespace.put("release_version", "invalid");
 
@@ -468,7 +468,7 @@ public class FeatureCommandTest {
 
         assertEquals("Unknown release version 'invalid'." +
             " Supported versions are: " + MetadataVersion.MINIMUM_VERSION +
-            " to " + MetadataVersion.LATEST_PRODUCTION, 
exception2.getMessage());
+            " to " + MetadataVersion.latestTesting().version(), 
exception2.getMessage());
     }
 
     @Test

Reply via email to