Repository navigation
✨ feat(controller): surface extraction failures in target status (EC-P1-05) - #36
Conversation
…P1-05) Attribute extraction errors (invalid/per-resource-failing CEL or JSONPath, ADR-0020 ErrTerminal) were previously only logged and the resource silently skipped — nothing reached KollectTarget.status, and GUIDELINES.md §1's mandated Degraded transition for terminal errors never fired. Engine now tracks, per target, the set of resources currently failing extraction (mirrors the existing forbidden/accessErr maps) behind a new ExtractFailures(ns, name) accessor returning a count and the most recent error message — counts/messages only, no per-resource payload (GUIDELINES.md §2 etcd-size guard). KollectTargetReconciler always writes these into status.extractionFailures/lastExtractionError, and hard-degrades the target (new ExtractionFailed reason) when the count is non-zero, matching the existing AccessCheckFailed disposition for the same ErrTerminal class — deliberately not the EC-P2-01 partial-scope-degrade pattern, since that's specific to ErrForbidden. TDD: engine_extract_failure_test.go and kollecttarget_extraction_failed_test.go were written and confirmed red (compile failures against not-yet-existing types/fields) before any production code changed.
REVIEW — ec-p1-05-extract-failure-visibility @ 3451d5f — 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
Functional correctness (self-assessment, not a verdict)Delivers BACKLOG.md §3 EC-P1-05 ("Extract-failure visibility in target status"). Before this Coverage delta
Summary / next stepsMaintainer review needed on GitHub — no self-verdict claimed per auto-mode classifier policy. All |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…-failure-visibility # Conflicts: # CHANGELOG.md
REVIEW — ec-p1-05-extract-failure-visibility @ 45bf7d3 — APPROVE — 2026-07-04Verdict: APPROVE Gate matrix (run locally against
|
| Gate | Result |
|---|---|
| go build ./... | PASS |
| task verify | PASS — CRD/deepcopy regenerated clean, no drift |
| task lint | PASS — 0 issues |
| task arch-lint | PASS |
| task test (full incl. envtest) | PASS — all packages green |
| task coverage | PASS — internal/ 82.3% (floor 72%) |
| task scrub | PASS — clean |
| task changelog:verify | PASS — resynced via task changelog:write after rebase |
Findings
None new. Independently traced applyTargetReadyState's branch order after the rebase brought
in the concurrently-landed dispatch-backpressure and family-sink-status-conflict fixes (both
auto-merged cleanly, no textual conflict in internal/collect/engine.go): precedence is
accessCheckFailed > extractFailCount>0 (this PR) > sink-unreachable > Ready, with
forbiddenScope handled independently via a Warning+Synced reason (doesn't block Ready). This
matches the PR's own description and GUIDELINES.md §1's ErrTerminal-vs-ErrForbidden distinction.
Confirmed ExtractionFailures/LastExtractionError status fields are set unconditionally before
the branch dispatch, so they stay visible even on the Ready path. Prior self-review's three P3
notes (MR-01 coverage gap on a pre-existing defensive branch, MR-02 changelog non-determinism
process note, MR-03 KollectClusterTarget not wired — explicitly out of scope) still stand,
none blocking.
CI note
test-integration first run hit the known transient Forgejo/gitlab testcontainer auth flake
(user does not exist [uid: 0, name: forgejo-admin], unrelated to this diff — this PR touches
no gitlab/git sink code); re-ran via gh run rerun --failed.
Summary
Diff vs current origin/main is exactly the 9 expected files. Clear to merge pending green CI rerun.
…P1-05) (#36) * ✨ feat(controller): surface extraction failures in target status (EC-P1-05) Attribute extraction errors (invalid/per-resource-failing CEL or JSONPath, ADR-0020 ErrTerminal) were previously only logged and the resource silently skipped — nothing reached KollectTarget.status, and GUIDELINES.md §1's mandated Degraded transition for terminal errors never fired. Engine now tracks, per target, the set of resources currently failing extraction (mirrors the existing forbidden/accessErr maps) behind a new ExtractFailures(ns, name) accessor returning a count and the most recent error message — counts/messages only, no per-resource payload (GUIDELINES.md §2 etcd-size guard). KollectTargetReconciler always writes these into status.extractionFailures/lastExtractionError, and hard-degrades the target (new ExtractionFailed reason) when the count is non-zero, matching the existing AccessCheckFailed disposition for the same ErrTerminal class — deliberately not the EC-P2-01 partial-scope-degrade pattern, since that's specific to ErrForbidden. TDD: engine_extract_failure_test.go and kollecttarget_extraction_failed_test.go were written and confirmed red (compile failures against not-yet-existing types/fields) before any production code changed. * 📄 docs(changelog): sync EC-P1-05 entry * 📄 docs: sync CHANGELOG
Summary
KollectTarget.status.internal/collect.Enginenow tracks, per target, the set of resources currently failing extraction (mirrors the existingforbidden/accessErrmaps) behind a newExtractFailures(ns, name) (count int, lastErr string)accessor.KollectTargetReconcileralways writesstatus.extractionFailures/status.lastExtractionError, and hard-degrades the target (newExtractionFailedreason) when the count is non-zero — matching the existingAccessCheckFaileddisposition for the sameErrTerminalclass (GUIDELINES.md §1), deliberately not the EC-P2-01 partial-scope-degrade pattern, since that's specific toErrForbidden.KollectTargetonly;KollectClusterTargetdoesn't yet check any of forbidden/accessErr/extraction signals — pre-existing gap, not introduced here.Test plan
go build ./...task verify(CRD/deepcopy codegen committed)task lint/task arch-linttask test(full suite incl. envtest, race detector)task coverage— internal/ 80.7% (floor 72%)task scrub/gitleaks protect --stagedtask changelog:verifyengine_extract_failure_test.goandkollecttarget_extraction_failed_test.gowritten and confirmed red (compile failures) before any production code changed