Repository navigation
♻️ refactor(validation,sink): typed errors for family-sink and s3 empty-payload - #34
Conversation
Gate report (self-check; no APPROVE verdict claimed — auto-mode classifier blocks self-authored verdicts on own commits, see AGENTS.md)
FindingsNo findings identified during self-check. TDD noteBoth changes followed red->green: the test was rewritten to assert via the new typed error first (confirmed it failed to compile — Full gate report + functional-correctness writeup: |
…ty-payload Replace err.Error()-substring assertions with typed checks: family-sink validation errors now carry a FamilySinkInvalidError (Kind/Name fields, errors.As) instead of being identified by message matching, and the s3 backend's empty-payload case returns a sentinel ErrEmptyPayload (errors.Is) instead of a bare fmt.Errorf. Error() text is unchanged for both, so this is behavior-preserving for callers; only the brittle test assertions and the two backlog items (F61/F62) are addressed.
4d77123 to
b4203cf
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
REVIEW — typed-errors-family-sink-s3 @ 4d77123Verdict: APPROVE Reviewer: kollect-audit session (independent pass, maintainer-directed review+merge, 2026-07-01) Gate matrix (CI, current head)All CI checks green: build, verify, lint, test, test-integration, vulncheck, helm, fuzz suite, e2e (smoke/extended/webhook), audit-rbac, CodeQL, gitleaks. (sonarcloud: skipped, expected.) Functional reviewReplaces string-matched errors with typed errors so callers can use
Scope / docsChangelog synced. No CRD/RBAC surface change. Merging per explicit maintainer instruction this session ( |
…mily-sink-s3 # Conflicts: # CHANGELOG.md
…mily-sink-s3 # Conflicts: # CHANGELOG.md
REVIEW — typed-errors-family-sink-s3 @ b1232fb — APPROVE — 2026-07-04Verdict: APPROVE Gate matrix (run locally against
|
| Gate | Result |
|---|---|
| go build ./... | PASS |
| task verify | PASS — no codegen drift |
| task lint | PASS — 0 issues |
| task arch-lint | PASS |
| task test (full incl. envtest) | PASS — all 30+ packages green |
| task coverage | PASS — internal/ 82.2% (floor 72%) |
| task scrub | PASS — clean |
| task changelog:verify | PASS — resynced via task changelog:write after rebase onto current main |
Findings
None. Confirmed ErrEmptyPayload/FamilySinkInvalidError are used only via function-reference callbacks in internal/webhook/v1alpha1/family_sink_webhook.go (signature func(name string, errs field.ErrorList) error unchanged), so the concrete-type change is source-compatible. Scoped only to internal/sink/s3 (not kafka/git/nats, which intentionally keep their own fmt.Errorf — out of scope here). gh pr diff 34 --name-only confirmed still limited to the 4 originally-reviewed files + CHANGELOG.
Summary
Rebased twice onto a moving main (direct-push family-sink/dispatch-backpressure fixes landed mid-review, then PR #38/#41 merges). Diff vs current origin/main is exactly the 5 expected files. Clear to merge.
REVIEW — /kollect-mr-reviewVerdict: APPROVE Scope: Typed sentinel errors for family-sink validation and s3 empty-payload — replaces Gate matrix: GitHub CI green on head
Merging via merge-commit (squash disabled on repo). |
♻️ refactor(validation,sink): typed errors for family-sink and s3 empty-payload
Summary
internal/validation/family_sink.go:SnapshotSinkInvalid/DatabaseSinkInvalid/EventSinkInvalidnow return*FamilySinkInvalidError{Kind, Name, Errs}instead of a barefmt.Errorf; callers canerrors.Asto get the originating CRD kind instead of substring-matchingerr.Error().Error()text is unchanged.internal/sink/s3/backend.go: the empty-payload case now returns a sentinelErrEmptyPayload(errors.Is) instead offmt.Errorf("s3 export: empty payload"). Message text unchanged.Test plan
go build ./...task verify(no codegen drift)task lint/task arch-lint(0 issues)task test(full suite incl. envtest, green)task coverage— internal/ 78.9% (floor 72%)task scrub(clean)task changelog:verifySee OPERATOR-BOARD GATE REPORT entry (no self-verdict per auto-mode classifier self-approval policy — maintainer judges from raw findings).