Copilot commented on code in PR #10188:
URL: https://github.com/apache/gravitino/pull/10188#discussion_r2883350603


##########
trino-connector/trino-connector-473-478/build.gradle.kts:
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.diffplug.gradle.spotless.SpotlessExtension
+import net.ltgt.gradle.errorprone.errorprone
+import org.gradle.internal.hash.ChecksumService
+import org.gradle.kotlin.dsl.support.serviceOf
+
+plugins {
+  `java-library`
+  `maven-publish`
+}
+
+// This module supports Trino versions 473-478
+val minTrinoVersion = 473
+val maxTrinoVersion = 478
+val otelSemconvVersion = "1.32.0"
+
+val trinoVersion = providers.gradleProperty("trinoVersion")
+  .map { it.trim().toInt() }
+  .orElse(maxTrinoVersion)
+  .get()
+
+// Validate version range
+check(trinoVersion in minTrinoVersion..maxTrinoVersion) {
+  "Module ${project.path} supports Trino versions 
$minTrinoVersion-$maxTrinoVersion, " +
+    "but trinoVersion=$trinoVersion was specified. " +
+    "Please set '-PtrinoVersion=$minTrinoVersion' (or any version in the 
supported range)."
+}
+
+java {
+  toolchain.languageVersion.set(JavaLanguageVersion.of(24))
+}
+
+dependencies {
+  implementation(project(":catalogs:catalog-common"))
+  implementation(project(":clients:client-java-runtime", configuration = 
"shadow"))
+  implementation(libs.airlift.json)
+  implementation(libs.bundles.log4j)
+  implementation(libs.commons.collections4)
+  implementation(libs.commons.lang3)
+  implementation("io.trino:trino-jdbc:$trinoVersion")
+  
runtimeOnly("io.opentelemetry.semconv:opentelemetry-semconv:$otelSemconvVersion")
+  compileOnly(libs.airlift.resolver)
+  compileOnly("io.trino:trino-spi:$trinoVersion") {
+    exclude("org.apache.logging.log4j")
+  }
+  testImplementation(libs.awaitility)
+  testImplementation(libs.mockito.core)
+  testImplementation(libs.mysql.driver)
+  testImplementation("io.trino:trino-memory:$trinoVersion") {
+    exclude("org.antlr")
+    exclude("org.apache.logging.log4j")
+  }
+  testImplementation("io.trino:trino-testing:$trinoVersion") {
+    exclude("org.apache.logging.log4j")
+    exclude("org.junit.jupiter")
+    exclude("org.junit.platform")
+  }
+  testImplementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
+  testImplementation("org.junit.jupiter:junit-jupiter-api")
+  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

Review Comment:
   This module hard-codes a JUnit BOM/version (5.11.4) and explicitly excludes 
JUnit artifacts from trino-testing, while other Trino connector modules rely on 
the repo’s shared JUnit dependency coordinates (e.g., 
libs.junit.jupiter.engine) and don’t pin a separate BOM. This increases the 
risk of running different JUnit platform versions across modules and makes 
dependency management harder. Consider aligning with the existing pattern (use 
the version catalog / shared JUnit deps) unless there’s a Trino-478-specific 
reason that requires pinning; if there is, please document why the 
exclusion+pinning is necessary.
   ```suggestion
     }
     testImplementation(libs.junit.jupiter.api)
     testRuntimeOnly(libs.junit.jupiter.engine)
   ```



##########
trino-connector/trino-connector-473-478/src/test/java/org/apache/gravitino/trino/connector/TestGravitinoConnector478.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.trino.connector;
+
+import static io.trino.testing.TestingSession.testSessionBuilder;
+
+import io.trino.Session;
+import io.trino.testing.DistributedQueryRunner;
+import org.apache.gravitino.client.GravitinoAdminClient;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Nested;
+
+public class TestGravitinoConnector478 {
+  @Nested
+  class SingleMetalake extends TestGravitinoConnector {
+    @Override
+    protected GravitinoPlugin createGravitinoPlugin(GravitinoAdminClient 
client) {
+      return new GravitinoPlugin478(client);
+    }

Review Comment:
   Test class naming is inconsistent with other Trino version-segment modules: 
existing modules use the minimum supported version in the test class name 
(e.g., TestGravitinoConnector469 for 469–472). Consider renaming this test (and 
corresponding plugin/factory references) to use 473 to match the module’s 
version range and existing naming pattern.



-- 
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]

Reply via email to