Skip to content

[#10195] improvement(catalogs):Change some dependencies to compileOnly in catalog modules#10199

Open
yuqi1129 wants to merge 7 commits intoapache:mainfrom
yuqi1129:issue_10195
Open

[#10195] improvement(catalogs):Change some dependencies to compileOnly in catalog modules#10199
yuqi1129 wants to merge 7 commits intoapache:mainfrom
yuqi1129:issue_10195

Conversation

@yuqi1129
Copy link
Contributor

@yuqi1129 yuqi1129 commented Mar 4, 2026

What changes were proposed in this pull request?

This pull request refactors dependency configurations across several catalog modules to reduce unnecessary runtime dependencies. The main change is switching from implementation to compileOnly for :api, :common, and :core dependencies, ensuring these are only available at compile time and not included in the final runtime artifact. To maintain test coverage, these dependencies are now explicitly added to the testImplementation scope. This helps minimize the transitive dependencies included at runtime, leading to lighter builds and fewer potential conflicts.

Why are the changes needed?

To shrink the release package size.

Fix: #10195

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

Test locally can CI.

@yuqi1129 yuqi1129 changed the title [#10195] improvement(catalogs): Make some dependencies to compileOnly in catalog modules [#10195] improvement(catalogs):Change some dependencies to compileOnly in catalog modules Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Code Coverage Report

Overall Project 65.2% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.73% 🔴
api 46.15% 🟢
authorization-common 85.96% 🟢
aws 1.1% 🔴
azure 2.6% 🔴
catalog-common 10.0% 🔴
catalog-fileset 80.02% 🟢
catalog-hive 80.98% 🟢
catalog-jdbc-clickhouse 77.71% 🟢
catalog-jdbc-common 36.84% 🔴
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 57.71% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 81.22% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.07% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 87.25% 🟢
catalog-lakehouse-paimon 77.71% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.73% 🟢
common 49.23% 🟢
core 81.21% 🟢
filesystem-hadoop3 76.97% 🟢
flink 38.86% 🔴
flink-runtime 0.0% 🔴
gcp 14.2% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 45.82% 🟢
iceberg-common 50.21% 🟢
iceberg-rest-server 66.24% 🟢
integration-test-common 0.0% 🔴
jobs 62.55% 🟢
lance-common 23.78% 🔴
lance-rest-server 57.84% 🟢
lineage 53.02% 🟢
optimizer 82.61% 🟢
server 85.74% 🟢
server-common 68.6% 🟢
spark 35.09% 🔴
spark-common 39.88% 🔴
trino-connector 31.62% 🔴

@yuqi1129 yuqi1129 added the upload log Always upload container log label Mar 4, 2026
@yuqi1129 yuqi1129 marked this pull request as ready for review March 5, 2026 02:36
Copilot AI review requested due to automatic review settings March 5, 2026 02:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces the Gravitino distribution size by changing several catalog modules to depend on :api, :common, and :core as compileOnly (instead of implementation), avoiding bundling those jars into each catalog’s packaged libs/ directory while still making them available to tests via testImplementation.

Changes:

  • Switch :api, :common, :core dependencies from implementation to compileOnly across multiple catalog and contrib-catalog modules.
  • Add explicit testImplementation(project(":api"/":common"/":core")) where needed to keep test classpaths intact.
  • Minor formatting/cleanup in GitHub workflow YAML and a small test expectation change in OceanBase IT.

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
catalogs/hive-metastore-common/build.gradle.kts Move core shared deps to compileOnly; add them back for tests.
catalogs/hadoop-common/build.gradle.kts Make :api/:common compile-time only; restore for tests.
catalogs/catalog-model/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-lakehouse-paimon/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-lakehouse-iceberg/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-lakehouse-hudi/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-lakehouse-generic/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-kafka/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-jdbc-starrocks/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-jdbc-postgresql/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-jdbc-mysql/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-jdbc-doris/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-jdbc-common/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-hive/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-fileset/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs/catalog-common/build.gradle.kts Make :common compile-time only; restore for tests.
catalogs-contrib/catalog-jdbc-oceanbase/src/test/java/org/apache/gravitino/catalog/oceanbase/integration/test/CatalogOceanBaseIT.java Broadened asserted exception type in one integration test.
catalogs-contrib/catalog-jdbc-oceanbase/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs-contrib/catalog-jdbc-hologres/build.gradle.kts Make shared deps compileOnly; add to test scope.
catalogs-contrib/catalog-jdbc-clickhouse/build.gradle.kts Make shared deps compileOnly; add to test scope.
.github/workflows/frontend-integration-test.yml Remove trailing whitespace in path filter.
.github/workflows/backend-integration-test-action.yml Remove trailing whitespace in Gradle command line.

Comment on lines 304 to 308
// create failed check.
NameIdentifier table = NameIdentifier.of(testSchemaName, "test_table");
Assertions.assertThrows(
NoSuchSchemaException.class,
NotFoundException.class,
() ->
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asserted exception was widened from NoSuchSchemaException to its base NotFoundException, but this PR is otherwise only changing dependency scopes. Since NoSuchSchemaException already extends NotFoundException, this change makes the test less specific and may mask regressions; unless the underlying behavior truly changed, keep asserting NoSuchSchemaException (or add a brief rationale in the PR/commit if the broader type is required).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upload log Always upload container log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] Make dependencies like gravitino-api as compileOnly in catalogs module

2 participants