Copilot commented on code in PR #332:
URL: 
https://github.com/apache/pekko-connectors-kafka/pull/332#discussion_r2290162512


##########
testkit/src/main/java/org/apache/pekko/kafka/testkit/internal/KafkaContainerCluster.java:
##########
@@ -111,31 +111,42 @@ public KafkaContainerCluster(
     this.network = Network.newNetwork();
     this.schemaRegistryImage = schemaRegistryImage;
 
-    this.zookeeper =
-        new GenericContainer(zooKeeperImage)
-            .withNetwork(network)
-            .withNetworkAliases("zookeeper")
-            .withEnv(
-                "ZOOKEEPER_CLIENT_PORT",
-                String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT));
+    if 
(!PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION.startsWith("8."))
 {

Review Comment:
   The hardcoded version check "8." is fragile and will need updates for future 
versions. Consider using a more robust version parsing approach or 
configuration-based approach to determine ZooKeeper requirements.
   ```suggestion
       if 
(getMajorVersion(PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION)
 < 8) {
   ```



##########
tests/src/test/scala/org/apache/pekko/kafka/scaladsl/RetentionPeriodSpec.scala:
##########
@@ -31,7 +31,8 @@ import scala.concurrent.duration._
 
 class RetentionPeriodSpec extends SpecBase with 
TestcontainersKafkaPerClassLike {
   // 
https://docs.confluent.io/current/installation/versions-interoperability.html
-  private final val confluentPlatformVersion = "7.9.2"
+  private final val confluentPlatformVersion =
+    System.getProperty("CONFLUENT_PLATFORM_VERSION", "7.9.2");

Review Comment:
   Remove the trailing semicolon as it's not needed in Scala.
   ```suggestion
       System.getProperty("CONFLUENT_PLATFORM_VERSION", "7.9.2")
   ```



##########
testkit/src/main/java/org/apache/pekko/kafka/testkit/internal/KafkaContainerCluster.java:
##########
@@ -111,31 +111,42 @@ public KafkaContainerCluster(
     this.network = Network.newNetwork();
     this.schemaRegistryImage = schemaRegistryImage;
 
-    this.zookeeper =
-        new GenericContainer(zooKeeperImage)
-            .withNetwork(network)
-            .withNetworkAliases("zookeeper")
-            .withEnv(
-                "ZOOKEEPER_CLIENT_PORT",
-                String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT));
+    if 
(!PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION.startsWith("8."))
 {
+      this.zookeeper =
+          Optional.of(
+              new GenericContainer(zooKeeperImage)
+                  .withNetwork(network)
+                  .withNetworkAliases("zookeeper")
+                  .withEnv(
+                      "ZOOKEEPER_CLIENT_PORT",
+                      
String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT)));

Review Comment:
   [nitpick] The indentation is inconsistent with the rest of the method. This 
line should align with the previous withEnv call.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to