Repository navigation
feat(api): error surface — deep health preflights + error_id handler - #75
Merged
Merged
Conversation
Tests first (tests/test_error_surfacing.py): Postgres down, CVE feed missing/never-refreshed/stale, kubeconfig absent, unauthenticated request, and unhandled server exception. GET /health stays a cheap liveness probe; /health?deep=1 preflights every dependency and reports each failure with the exact fix command (compose one-liner for Postgres, /cve/feeds/refresh-all for stale feeds, KUBECONFIG/ServiceAccount guidance for cluster access). 503 only when a required dependency is down; optional failures degrade. Global exception handler logs the full traceback under a generated error_id and returns only that id to the client — stack traces, exception types, and messages never leave the server. Connection URLs are rendered with the password masked everywhere. Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
rrskris
enabled auto-merge (squash)
July 18, 2026 14:22
rrskris
added a commit
that referenced
this pull request
Aug 5, 2026
@floze-the-genius shipped three PRs, but only the bugfix (#100) appeared in the changelog — the two features it built on, GET /rbac/scan/diff (#82) and the kaaval doctor preflight (#80), were missing entirely. Anyone reading the release notes would see the fix to a feature whose arrival was never recorded. Scope of each entry was taken from the merge commits rather than the issue titles: #80 adds the CLI command and typed health results on top of the deep health checks that #75 already provided, so it is credited for the wrapper it actually wrote, not for the checks themselves. Prep for the v1.2.0 release notes, so the credit ships in the release rather than as a later correction. Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Written tests-first (
tests/test_error_surfacing.py, 10 tests): Postgres down, CVE feeds missing/never-refreshed/stale, kubeconfig absent, unauthenticated request, unhandled server exception. Bad--manifestspaths were already pinned bytest_cli_manifests_errors.py(#45).GET /health?deep=1(newapp/health.py): preflights Postgres, CVE feed presence + freshness (48h staleness window = two missed scheduler cycles), and Kubernetes credentials. Every failing check carries the exact fix: the compose one-liner for Postgres,POST /cve/feeds/refresh-allfor stale feeds,KUBECONFIG/ServiceAccount guidance (pointing atdeploy/cronjob.yaml) for cluster access. 503 only when a required dependency is down; optional failures reportdegraded. PlainGET /healthstays a dependency-free liveness probe.error_id; the client receives only{"detail", "error_id"}— never the stack, exception type, or message. DB URLs render with the password masked everywhere.Verification
/health?deep=1returnsdegradedwith per-check fixes when feeds are unrefreshed and no kubeconfig is present; credentials masked (kaaval:***@); shallow probe 200.