refactor(mirror): rename source types to ledgerV2Http / ledgerV2Database#1590
refactor(mirror): rename source types to ledgerV2Http / ledgerV2Database#1590sylr wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
✅ Approve — automated reviewThe rename of source types to No findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v3.0 #1590 +/- ##
================================================
- Coverage 75.00% 74.48% -0.52%
================================================
Files 429 430 +1
Lines 44956 45722 +766
================================================
+ Hits 33719 34057 +338
- Misses 8297 8629 +332
- Partials 2940 3036 +96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
27f1e29 to
c69b244
Compare
The mirror source-type discriminators were named `http` / `postgres`, which describe the transport rather than what they connect to. Rename them to `ledgerV2Http` and `ledgerV2Database` so they convey that both read from a Ledger v2 system (via its HTTP API or directly from its PostgreSQL database). The `mirrorSource` config stays a single object with one sub-property selecting the source type (multi-source support is intentionally not implemented). Renamed across the proto oneof field names (JSON keys + Go accessors), the HTTP body `type` values, the ledgerctl `--mirror-source-type` values, and the operator CRD `spec.mirrorSource` sub-fields (+ a new CEL rule enforcing exactly one type). The underlying message/struct type names (HttpMirrorSourceConfig, PostgresMirrorSource, …) are unchanged — they are internal identifiers that never appear in JSON/YAML. The proto change only renames oneof field names; tag numbers (2/3) are preserved, so it is wire-compatible with existing persisted data. Rejected: multiple mirror sources per ledger (mirrorSources list) | not needed for now Rejected: rename the underlying config message/struct types | internal-only names, never user-visible Confidence: high Scope-risk: moderate
c69b244 to
ca1468e
Compare
flemzord
left a comment
There was a problem hiding this comment.
Reviewed at ca1468e6. The rename is otherwise consistently propagated through proto, HTTP input, CLI, operator CRDs, docs, and generated artifacts, and all targeted tests plus CI pass. One OpenAPI response-contract gap remains; details are inline.
| - postgres | ||
| default: http | ||
| description: Source type (defaults to "http" if omitted) | ||
| - ledgerV2Http |
There was a problem hiding this comment.
[P2] Split the request and response mirror-source schemas
This schema is also referenced by LedgerInfo, but that response is not encoded through mirrorSourceBody. LedgerInfo.MarshalJSON calls protoFieldJSON, so the renamed proto oneof serializes as {\"ledgerV2Http\":{...}} (or ledgerV2Database), not the flat {\"type\":\"ledgerV2Http\",...} declared here. Generated clients therefore still cannot model mirror-ledger responses from this contract. Please give LedgerInfo a oneof-shaped response schema, or normalize response serialization to the flat discriminator.
What
Renames the two mirror source-type discriminators from
http/postgrestoledgerV2Http/ledgerV2Database. ThemirrorSourceconfig stays a single object with one sub-property selecting the source type.Why
http/postgresdescribe the transport, not what they connect to.ledgerV2Http/ledgerV2Databaseconvey that both current sources read from a Ledger v2 system — via its HTTP API, or directly from its PostgreSQL database.Scope
common.proto): oneof field nameshttp/postgres→ledger_v2_http/ledger_v2_database. Tag numbers (2/3) are preserved, so the change is wire-compatible with existing persisted data — only the field names (JSON keys + Go accessors) change.mirrorSource.typevalues →ledgerV2Http/ledgerV2Database(defaultledgerV2Http).--mirror-source-typevalues + completions + help.spec.mirrorSource.ledgerV2Http/.ledgerV2Databasesub-fields, plus a new CEL rule enforcing exactly one source type. Regenerated deepcopy + CRD YAML (config + helm, in sync).The underlying message/struct type names (
HttpMirrorSourceConfig,PostgresMirrorSource, …) are intentionally unchanged — they are internal identifiers that never appear in JSON/YAML.Compatibility
Breaking rename of the API/CRD discriminator on pre-GA
v1alpha1; existing mirrorLedgerCRs / API bodies usinghttp/postgresmust switch toledgerV2Http/ledgerV2Database. Persisted proto data is unaffected (tag numbers unchanged).Verification
golangci-linton the touched packages: 0 issues.Note: the sandbox's proto/golangci toolchain drifted mid-session (a
--fixtag-reorder + a golangci-lint linter-set change); those artifacts were kept out of this diff, which contains only the rename.