Repository navigation
♻️ refactor(sink): extract shared secret-value-from-keys helper (dup audit) - #38
Conversation
…audit) postgres's dsnFromSecret and mongodb's uriFromSecret independently looped over a set of candidate secret keys (dsn/url/connectionString/... vs uri/url/connectionString/...) looking for the first non-empty value, with near-identical bodies. Extracts the scan into internal/sink/secretkv.FirstValue (a new leaf package under the sink component, no import-cycle risk since postgres/mongodb are imported BY internal/sink, not the other way around). Pure refactor: both callers keep their own candidate key lists and error messages, so observable behavior (including error text) is unchanged. Backed by the existing postgres/mongodb regression suite (unmodified, still green) plus new direct unit tests for the extracted helper.
REVIEW — sink-secret-value-dedup @ bb0f85f — NO SELF-VERDICT — 2026-07-01No verdict posted (auto-mode classifier blocks self-authored APPROVE on own commits this Reviewer: next-sprint session (self-review attempt blocked by auto-mode classifier) Gate matrix
Findings
No P0/P1 findings. Functional correctnessDelivers BACKLOG.md §3 "dup audit" item (postgres/mongodb/gitlab triplication note). On inspection, TDD followed: Drive-by (not part of this diff): while picking up the original "Multi-operator sink dedupe Coverage delta
Summary / next stepsMaintainer review needed on GitHub — no self-verdict claimed per auto-mode classifier policy. All |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
REVIEW — sink-secret-value-dedup @ bb0f85f — APPROVE — 2026-07-03Verdict: APPROVE Gate matrix
FindingsNone. Functional correctnessExtracts the identical "scan secret data for first non-empty value among candidate keys, trimmed" loop that both TDD complianceNew Coverage delta
Summary / next stepsClear to merge, no follow-up needed. |
# Conflicts: # CHANGELOG.md
|
Rebase-only update: head moved |
…audit) (#38) * ♻️ refactor(sink): extract shared secret-value-from-keys helper (dup audit) postgres's dsnFromSecret and mongodb's uriFromSecret independently looped over a set of candidate secret keys (dsn/url/connectionString/... vs uri/url/connectionString/...) looking for the first non-empty value, with near-identical bodies. Extracts the scan into internal/sink/secretkv.FirstValue (a new leaf package under the sink component, no import-cycle risk since postgres/mongodb are imported BY internal/sink, not the other way around). Pure refactor: both callers keep their own candidate key lists and error messages, so observable behavior (including error text) is unchanged. Backed by the existing postgres/mongodb regression suite (unmodified, still green) plus new direct unit tests for the extracted helper. * 📄 docs: sync CHANGELOG * 📄 docs: sync CHANGELOG
Summary
internal/sink/postgres/config.go'sdsnFromSecretandinternal/sink/mongodb/config.go'suriFromSecretindependently looped over a set of candidate secret keys looking for the first non-empty value — near-identical bodies, different key lists/error text.internal/sink/secretkv(FirstValue(data, keys...)). No import-cycle risk:internal/sink(registry) already importsinternal/sink/postgres/internal/sink/mongodb, so those two could never importinternal/sinkback;secretkvsits as a sibling leaf package instead, same pattern asinternal/sink/git/internal/sink/layout.BACKLOG.mdentry for "Multi-operator sink dedupe guidance" (P2) discovered already shipped indocs/deployment/topology-matrix.md's "Multi-operator sink dedupe runbook" section (19107a20e) while picking this lane — local-only coordination doc, not part of this diff.Test plan
TestFirstValue_*ininternal/sink/secretkv/secretkv_test.gowritten first, confirmed red (undefined: FirstValue), then made green.postgres/mongodbconfig tests pass unmodified (no behavior change).task test— full unit + envtest suite greentask lint/task arch-lint— 0 issuestask verify— no codegen drifttask coverage— internal/ 80.6% (floor 72%); new package 100%task scrub— cleantask changelog:verify— synced🤖 Generated with Claude Code