Skip to content

fix(cdc): reject ignored PostgreSQL source SPI config - #239

Draft
seonghobae wants to merge 3 commits into
developfrom
fix/postgres-spi-config-truth-622e5e6
Draft

fix(cdc): reject ignored PostgreSQL source SPI config#239
seonghobae wants to merge 3 commits into
developfrom
fix/postgres-spi-config-truth-622e5e6

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Advance #238 test-first from exact protected develop@622e5e6c3d534f230c390f10e3832efadfc01825. The live PostgresDebeziumCdcSource delegates lifecycle to deployment-configured CdcService; caller-supplied per-call maps are not an authoritative Debezium configuration. Protected source accepted and silently ignored non-empty maps, so caller intent (including credential-like values) could appear accepted while having no runtime effect.

Exact current identity

  • protected/live base: develop@622e5e6c3d534f230c390f10e3832efadfc01825;
  • branch: fix/postgres-spi-config-truth-622e5e6;
  • fail-first source head: 9b98a3b74274c9488422638f2eca7640a34f8057;
  • exact current GREEN source head: 75065b5c675408f69b0eab918d58fef991950e0f;
  • current synthetic merge preview: 2a369886794b7d031ba952ac38ad6ceb2375d230;
  • comparison to live protected base: two commits ahead, zero behind, merge base exactly protected develop;
  • changed paths: exactly PostgresDebeziumCdcSource.java and its focused configuration test;
  • Draft / mergeable: true / true;
  • formal reviews: none;
  • unresolved review threads: zero.

Every predecessor-head check, review, base snapshot, or merge preview is historical after head movement.

RCA

  • Immediate cause: validate(Map) rejected only null; start(Map) therefore accepted every non-empty map and immediately delegated to deployment-owned CdcService, ignoring all entries.
  • Technical root cause: the SPI shape suggested per-call configuration authority that the live PostgreSQL implementation does not possess.
  • Control failure: existing lifecycle tests covered the valid empty-map delegation path but not rejection of non-empty caller configuration.
  • Product/security impact: integrations could believe connection/configuration values had been honored when they had not; credential-like material could be unnecessarily passed across an API boundary with no effect.

TDD evidence

RED — exact source 9b98a3b74274c9488422638f2eca7640a34f8057

The fail-first commit added only PostgresDebeziumCdcSourceConfigurationTest. It sends a non-empty map containing a credential-like value through the real start(config) production boundary and requires rejection before any CdcService interaction, with a stable failure message that echoes neither key nor value.

CI 31391184511, macOS job 93463055955, checked out GitHub synthetic merge ab39fd93fae3456cbeb5cbf6d7b55d2a9827f355 (Merge 9b98a3b... into 622e5e6...). ETL completed 275 tests green. CDC ran 107 tests with exactly the new test failing and zero test errors/skips: an IllegalArgumentException was expected but production threw nothing. This reached the intended production adapter boundary rather than failing in setup/import/fixture/dependency code.

GREEN — exact current source 75065b5c675408f69b0eab918d58fef991950e0f

The production correction is deliberately narrow:

  • null remains invalid;
  • every non-empty per-call map is rejected before service lookup/start;
  • the exception is stable and contains no rejected key/value;
  • empty-map behavior is unchanged and continues to delegate to deployment-configured CdcService;
  • public class/validation/start Javadocs state the deployment-owned configuration contract and failure semantics.

All exposed workflow aggregates associated with this exact current source are terminal-success:

  • CI 31392884219: success;
  • Dependency Review 31392881274: success;
  • CycloneDX SBOM 31392878898: success;
  • SAST Semgrep 31392877894: success;
  • Security Scan 31392877892: success.

CI macOS job 93468612634 checked out synthetic merge 2a369886794b7d031ba952ac38ad6ceb2375d230 (Merge 75065b5... into 622e5e6...). The full reactor completed BUILD SUCCESS: ETL 275/275, CDC 107/107 including PostgresDebeziumCdcSourceConfigurationTest 1/1, and gateway 3/3.

Evidence boundary

The current CI is strong causal merged-tree proof, but it is not literal-source acceptance evidence: checkout was refs/pull/239/merge, not literal source 75065b5.... The same log still reports Analyzed bundle 'etl-service' with 0 classes followed by successful JaCoCo checks; #162/#164 owns the non-vacuous coverage repair and #205 owns repository-wide owned-production scope. #196 separately owns dependency-resolution/scanner completeness. No qualifying independent non-author formal approval exists on this head.

Merge boundary

Keep Draft. Do not merge until the unchanged exact source head has accepted literal-source deterministic/security evidence, complete same-revision dependency/vulnerability evidence, non-vacuous applicable owned-production coverage, every required CI/security/SBOM/provenance gate, zero valid unresolved findings, current live-base integrity, and qualifying independent non-author formal approval where governance requires it. No predecessor-head, other-PR, incomplete-scanner, status-only, skipped-required, author-only, or synthetic-merge-only evidence transfers.

Summary by CodeRabbit

  • 문서화

    • PostgreSQL Debezium CDC 소스의 배포 설정 기반 구성 방식과 입력 제약을 명확히 했습니다.
    • 호출별 설정이 비어 있는 Map만 허용되며, 유효하지 않은 입력과 서비스 부재 시 오류 조건을 안내합니다.
  • 버그 수정

    • 비어 있지 않은 호출별 설정을 전달할 때 명확한 오류가 발생하도록 검증했습니다.
    • 오류 메시지에 민감한 정보나 설정 키가 노출되지 않도록 개선했습니다.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a464c041-af39-4ce7-a55b-ed90dc86d8eb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

PostgreSQL Debezium CDC 소스가 배포 설정만 사용하도록 호출별 설정 제약을 문서화했습니다. 비어 있지 않은 설정을 거부하고, 오류 정보 노출과 CdcService 상호작용이 없는지 테스트합니다.

Changes

PostgreSQL CDC 구성 검증

Layer / File(s) Summary
호출별 설정 거부 및 검증
cdc-service/src/main/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSource.java, cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java
validatenull과 비어 있지 않은 설정을 구분해 처리합니다. 비어 있지 않은 설정은 IllegalArgumentException으로 거부합니다. start의 입력 제약과 CdcService 부재 시 예외 조건을 문서화했습니다. 테스트는 오류 메시지에 비밀값과 설정 키가 없고 CdcService와 상호작용하지 않음을 검증합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • ContextualWisdomLab/mightyETL issue 238: 비어 있지 않은 호출별 설정을 거부하는 구현과 테스트를 직접 다룹니다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 비어 있지 않은 PostgreSQL source SPI 설정을 거부하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/postgres-spi-config-truth-622e5e6

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java (1)

21-41: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

null과 빈 Map 경로를 추가로 테스트하세요.

현재 테스트는 비어 있지 않은 호출별 설정의 거부만 검증합니다. 변경 계약에는 null 거부와 Map.of() 전달 시 배포 설정 CdcService.start() 위임도 포함됩니다. null 경로에서 CdcService 미호출을 확인하고, 빈 Map 경로에서 verify(service).start()를 확인하는 별도 테스트를 추가하세요.

추가 테스트 예시
+import static org.mockito.Mockito.verify;
+
+    `@Test`
+    void rejectsNullCallerConfiguration() {
+        CdcService service = mock(CdcService.class);
+        `@SuppressWarnings`("unchecked")
+        ObjectProvider<CdcService> provider = mock(ObjectProvider.class);
+        when(provider.getIfAvailable()).thenReturn(service);
+        PostgresDebeziumCdcSource source = new PostgresDebeziumCdcSource(provider);
+
+        assertThrows(IllegalArgumentException.class, () -> source.start(null));
+        verifyNoInteractions(service);
+    }
+
+    `@Test`
+    void delegatesEmptyCallerConfiguration() {
+        CdcService service = mock(CdcService.class);
+        `@SuppressWarnings`("unchecked")
+        ObjectProvider<CdcService> provider = mock(ObjectProvider.class);
+        when(provider.getIfAvailable()).thenReturn(service);
+        PostgresDebeziumCdcSource source = new PostgresDebeziumCdcSource(provider);
+
+        source.start(Map.of());
+        verify(service).start();
+    }
🤖 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`
around lines 21 - 41, Extend PostgresDebeziumCdcSourceConfigurationTest with
separate tests for null and empty per-call configuration. Verify
source.start(null) throws IllegalArgumentException with the expected contract
message and does not interact with CdcService, while source.start(Map.of())
delegates to the mocked service.start() and verifies that invocation.
🤖 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`:
- Around line 21-41: Extend PostgresDebeziumCdcSourceConfigurationTest with
separate tests for null and empty per-call configuration. Verify
source.start(null) throws IllegalArgumentException with the expected contract
message and does not interact with CdcService, while source.start(Map.of())
delegates to the mocked service.start() and verifies that invocation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a69bba0-b1a6-4b12-9439-9d780f338c8b

📥 Commits

Reviewing files that changed from the base of the PR and between 622e5e6 and 75065b5.

📒 Files selected for processing (2)
  • cdc-service/src/main/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSource.java
  • cdc-service/src/test/java/com/xtrmetl/cdc/spi/PostgresDebeziumCdcSourceConfigurationTest.java

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