fix(cdc): reject ignored PostgreSQL SPI config - #300
Conversation
📝 WalkthroughWalkthroughPostgreSQL Debezium CDC 소스가 배포 구성 기반 서비스와 빈 per-call 설정 계약을 문서화하고 검증합니다. null 및 비어 있지 않은 설정은 예외로 처리하며, 빈 설정은 배포 구성 서비스를 시작합니다. ChangesPostgreSQL CDC 설정 계약
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java (1)
42-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winprovider 조회 부재도 검증하세요.
현재
verifyNoInteractions(service)만 사용합니다.provider.getIfAvailable()가 호출된 뒤CdcService메서드가 호출되지 않아도 테스트가 통과합니다. 비어 있지 않은 설정을 서비스 조회 전에 거부하는 계약을 보호하려면 provider 조회 횟수가 0인지 확인하세요.수정 예시
+import static org.mockito.Mockito.never; ... + verify(provider, never()).getIfAvailable(); verifyNoInteractions(service);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java` at line 42, Update the test around the configuration validation path to explicitly verify that the provider lookup via provider.getIfAvailable() occurs zero times, in addition to verifyNoInteractions(service). Preserve the assertion that non-empty configuration is rejected before any CdcService method is invoked.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java`:
- Line 42: Update the test around the configuration validation path to
explicitly verify that the provider lookup via provider.getIfAvailable() occurs
zero times, in addition to verifyNoInteractions(service). Preserve the assertion
that non-empty configuration is rejected before any CdcService method is
invoked.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6134b981-2bff-4c26-91c0-0671bb7b503b
📒 Files selected for processing (2)
cdc-service/src/main/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSource.javacdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java
Implements issue #238 without accepting caller-supplied PostgreSQL CDC values that the live service would silently ignore.
Exact current state:
827df9b2e15b8afbd78da23ac4a165e7a45e26fedevelop@f340d37caba9df0d4aeb88e5d18b78bd8cca4b60690f6ed6eae00b11c732f126393df99303c2739e+ live protected base, combined non-destructively by the current merge commit10074824dc7cbc97ac097ae0bf51a4a74c70a8fcBehavior:
PostgresDebeziumCdcSource.start(config)rejectsnulland every non-empty per-call map before service lookup, uses a stable non-sensitive error, and preserves empty-map delegation to the deployment-configured liveCdcService. Public Javadocs document that deployment configuration owns PostgreSQL/Debezium settings.Focused regression coverage proves credential-like values are rejected without echo, no service interaction occurs on invalid input, null fails before provider lookup, and empty configuration still starts the service.
Fresh current-head GitHub workflows completed successfully for CI, Dependency Review, Generate SBOM, SAST, and Security across the repository's hosted matrix. These checks do not substitute for a qualifying independent exact-head formal APPROVED review. Historical checks/reviews from predecessor heads do not transfer.
Summary by CodeRabbit
문서
버그 수정
null설정을 제공하면 서비스 조회 및 시작 전에 명확한 오류가 표시됩니다.