Skip to content

fix(cdc): snapshot canonical change record maps - #222

Closed
seonghobae wants to merge 2 commits into
developfrom
fix/cdc-canonical-record-snapshot-622e5e6
Closed

fix(cdc): snapshot canonical change record maps#222
seonghobae wants to merge 2 commits into
developfrom
fix/cdc-canonical-record-snapshot-622e5e6

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fix #221 test-first from exact protected develop@622e5e6c3d534f230c390f10e3832efadfc01825. CanonicalChangeRecord exposed unmodifiable views of caller-owned maps rather than construction-time snapshots, so the record and its equality/hash identity could change after construction when a caller mutated the backing map.

This direct-develop Draft changes only the canonical CDC value object and its focused test. It does not alter registry/discovery, Kafka publication, connector support, database state, migrations, dependencies, workflows, or canonical #149 documentation.

Exact current identity

  • protected/live base: develop@622e5e6c3d534f230c390f10e3832efadfc01825;
  • branch: fix/cdc-canonical-record-snapshot-622e5e6;
  • fail-first source head: 770c19c366cdbee0e92faea3312cbea747078cfd;
  • exact current GREEN source head: 621e7c25dae2081534d5fd94f2ac294128d1a8ff;
  • current synthetic merge preview: ef61e5cd8abb4c3561d072c87220cd1f13b0388e;
  • GitHub mergeability: true;
  • Draft: true;
  • formal reviews: none;
  • unresolved review threads: zero.

Every check/review from another head/base remains historical and does not transfer.

RED → GREEN

CanonicalChangeRecordTest reaches the real CDC value object and requires:

  1. caller mutation of mutable before, after, and pk maps after construction must not alter the record or its hashCode();
  2. getter maps remain unmodifiable;
  3. null database-row values remain representable and null map references normalize to empty maps.

Hosted fail-first CI 31369371587, macOS job 93394688767, compiled the reactor and ran CDC with exactly 109 tests, exactly one failure, zero errors/skips: CanonicalChangeRecordTest.snapshotsMutableInputMaps expected the construction-time value old but observed caller mutation mutated. The direct-unmodifiable and null-value assertions were green. This is valid production-boundary RED rather than setup/import/fixture/dependency failure.

Exact current source head 621e7c25dae2081534d5fd94f2ac294128d1a8ff applies the smallest correction: null/empty maps normalize to Map.of(), non-empty maps are shallow-copied into insertion-order-preserving LinkedHashMap snapshots and exposed as unmodifiable maps, and the public class/constructor/getter contracts now have beginner-readable Javadoc. Scalar metadata, nested-value semantics, equality/hashCode fields and public API shape remain unchanged.

Current hosted evidence

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

  • CI 31370594745: success on Ubuntu, macOS and Windows;
  • Dependency Review 31370594733: success;
  • CycloneDX SBOM 31370594735: success;
  • SAST Semgrep 31370594683: success;
  • Security Scan 31370594746: aggregate success.

CI macOS job 93398461439 checked out synthetic merge ef61e5cd8abb4c3561d072c87220cd1f13b0388e, not literal source head. On that merged tree CanonicalChangeRecordTest passed 3/3, CDC passed 109/109, ETL passed 275/275 and the full reactor completed BUILD SUCCESS. This proves merged-tree behavior compatibility, not literal-source acceptance.

The same CI log independently reproduces the protected JaCoCo false-green: Analyzed bundle 'etl-service' with 0 classes followed by coverage checks met. #162/#164 owns that root-cause repair, while #205 owns repository-wide coverage scope.

Security Scan Trivy job 93398461727 also checked out synthetic merge ef61e5cd... and printed Dependency version cannot be determined. Child dependencies will not be found. before reporting zero CRITICAL/HIGH/MEDIUM SARIF findings. #196 owns scanner-completeness; the aggregate green is therefore not accepted as complete same-revision vulnerability evidence. The scan also continues to observe the tracked 82 MB zipkin.jar, owned by #168/#169.

Documentation / traceability

#159 now records this change as active_pr and the durable architecture invariant: canonical CDC row maps are construction-time snapshots so caller mutation cannot alter value-object identity. Unstable SHAs/runs stay in dated evidence rather than timeless architecture.

Merge boundary

Keep Draft. The product defect is GREEN on the synthetic integration tree, but accepted literal-source execution/security evidence, complete dependency/vulnerability evidence, non-vacuous applicable owned-production coverage, current repository-wide quality scope, and any live protected merge/review requirements remain independent gates. Do not weaken those controls or copy shared workflow/coverage/scanner fixes into this two-file CDC slice.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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: ed534bd1-3ba8-4a97-a53b-96cfcb3c9064

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

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.

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.

[Data Integrity] Snapshot CDC canonical record maps at construction

1 participant