Skip to content

Iceberg REST Phase 1 [3/3]: Tests and CI#500

Open
cbb330 wants to merge 4 commits intolinkedin:mainfrom
cbb330:chbush/iceberg-rest-3-tests
Open

Iceberg REST Phase 1 [3/3]: Tests and CI#500
cbb330 wants to merge 4 commits intolinkedin:mainfrom
cbb330:chbush/iceberg-rest-3-tests

Conversation

@cbb330
Copy link
Collaborator

@cbb330 cbb330 commented Mar 11, 2026

Summary

Part 3 of 3 for Iceberg REST Catalog support. Adds comprehensive test coverage and CI for the controller from #499.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

Tests

Round-trip integration tests (IcebergRestCatalogRoundTripTest, 21 tests):

  • Uses a real Iceberg RESTCatalog client against a Spring Boot test server
  • List tables: single namespace, correct namespace, cross-namespace isolation, empty namespace
  • Load table: schema columns, field IDs, required fields, different schemas, partition spec, unpartitioned, location, properties, sort order, snapshot, cross-namespace
  • Table exists: HEAD for existing, missing, wrong namespace
  • Error handling: load nonexistent table (NoSuchTableException), load from nonexistent namespace
  • Consistency: multiple loads return same metadata

Unit tests (IcebergRestCatalogControllerTest, 6 tests):

  • MockMvc tests for config, list, load, load not found, head exists, head not found

CI:

  • iceberg_rest_catalog_smoke.py — PyIceberg smoke test validates stock RestCatalog client against live service (table_exists, list_tables, load_table)
  • build-run-tests.yml — adds :services:tables:check to Gradle build and PyIceberg smoke test step

Review guidance

This PR's new files (623 lines across 4 files):

  • IcebergRestCatalogRoundTripTest.java (380 lines)
  • IcebergRestCatalogControllerTest.java (150 lines)
  • iceberg_rest_catalog_smoke.py (82 lines)
  • build-run-tests.yml (+11 lines)

The diff against main also includes #498 and #499's files — those are reviewed in their respective PRs.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.

All 27 tests pass locally:

IcebergRestCatalogRoundTripTest > 21 tests PASSED
IcebergRestCatalogControllerTest > 6 tests PASSED

Manually tested with PyIceberg and DuckDB against local Docker setup.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

PR Stack (merge in order)

  1. Iceberg REST Phase 1 [1/3]: OpenAPI spec and codegen infrastructure #498 — OpenAPI spec and codegen infrastructure
  2. Iceberg REST Phase 1 [2/3]: Controller, serde, and exception handling #499 — Controller, serde, and exception handling
  3. Iceberg REST Phase 1 [3/3]: Tests and CI #500 — Tests and CI ← you are here

Vendor the upstream Apache Iceberg REST OpenAPI spec (v1.10) and wire
Polaris-aligned codegen into the services/tables Gradle build:

- spec/iceberg-rest-catalog-open-api.yaml: upstream spec as source of truth
- Gradle tasks: setUpOpenApiCliForIcebergRest, validateIcebergRestOpenApiSpec,
  generateIcebergRestOpenApiServer with importMappings/typeMappings to map
  spec schemas to real Iceberg library types (no model generation)
- Post-processing for Iceberg 1.10-only types mapped to Object (compatibility
  with our 1.5.2 fork)
- compileJava depends on codegen; check depends on spec validation
- jackson-databind-nullable dependency for generated code
- Strip non-upstream comments (CODE_COPIED_TO_POLARIS, version marker) so
  the vendored spec is byte-for-byte identical to apache-iceberg-1.10.0
- Add verifyIcebergRestSpecSync Gradle task that downloads the upstream spec
  from the pinned tag and fails if it differs from the vendored copy
- Wire verifyIcebergRestSpecSync into the check task so CI catches drift
@cbb330 cbb330 force-pushed the chbush/iceberg-rest-3-tests branch from 8d2e93f to 4e8030c Compare March 11, 2026 23:23
cbb330 added 2 commits March 11, 2026 16:38
Implement the read-only Iceberg REST Catalog surface on top of the
generated OpenAPI interfaces from PR1:

Controller (IcebergRestCatalogController):
- Implements CatalogApiApi + ConfigurationApiApi generated interfaces
- GET /v1/config returns prefix override for route isolation
- GET /v1/{prefix}/namespaces/{ns}/tables lists tables via TablesService
- GET /v1/{prefix}/namespaces/{ns}/tables/{t} loads table via CatalogHandlers
- HEAD /v1/{prefix}/namespaces/{ns}/tables/{t} checks table existence
- All unimplemented endpoints return 501 via generated defaults

Serialization:
- IcebergRestHttpMessageConverter for Iceberg REST types (kebab-case JSON)
- IcebergRestSerde with Iceberg RESTSerializers + kebab-case ObjectMapper
- IcebergRestSerdeConfig registers converter without affecting existing Jackson

Error handling:
- IcebergRestExceptionHandler scoped to controller, returns Iceberg ErrorResponse

Service:
- TablesService.searchTables(databaseId, actingPrincipal) overload for auth
Comprehensive test coverage for the Iceberg REST Catalog endpoints:

Round-trip integration tests (IcebergRestCatalogRoundTripTest, 21 tests):
- List tables: single namespace, correct namespace, cross-namespace isolation,
  empty namespace
- Load table: schema columns, field IDs, required fields, different schemas,
  partition spec, unpartitioned, location, properties, sort order, snapshot,
  cross-namespace
- Table exists: HEAD for existing, missing, wrong namespace
- Error handling: load nonexistent table, load from nonexistent namespace
- Consistency: multiple loads return same metadata

Unit tests (IcebergRestCatalogControllerTest, 6 tests):
- MockMvc tests for config, list, load, load not found, head exists, head
  not found

CI:
- PyIceberg smoke test (iceberg_rest_catalog_smoke.py) validates stock
  RESTCatalog client against live service
- build-run-tests.yml adds :services:tables:check and smoke test step
@cbb330 cbb330 force-pushed the chbush/iceberg-rest-3-tests branch from 4e8030c to 4896bad Compare March 11, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant