[#10195] improvement(catalogs):Change some dependencies to compileOnly in catalog modules#10199
[#10195] improvement(catalogs):Change some dependencies to compileOnly in catalog modules#10199yuqi1129 wants to merge 7 commits intoapache:mainfrom
compileOnly in catalog modules#10199Conversation
compileOnly in catalog modulescompileOnly in catalog modules
Code Coverage Report
|
There was a problem hiding this comment.
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,:coredependencies fromimplementationtocompileOnlyacross 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. |
| // create failed check. | ||
| NameIdentifier table = NameIdentifier.of(testSchemaName, "test_table"); | ||
| Assertions.assertThrows( | ||
| NoSuchSchemaException.class, | ||
| NotFoundException.class, | ||
| () -> |
There was a problem hiding this comment.
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).
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
implementationtocompileOnlyfor:api,:common, and:coredependencies, 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 thetestImplementationscope. 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.