Skip to content

fix: fail incomplete database inspections - #99

Open
DivyamTalwar wants to merge 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/report-partial-database-coverage
Open

DivyamTalwar wants to merge 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/report-partial-database-coverage

Conversation

@DivyamTalwar

Copy link
Copy Markdown
Contributor

What and why

Closes #98.

When at least one database succeeded, runInspectAll calculated its exit status only from successful contexts, ignoring a failed database. Preserve the successful subset of the report, but let execution failure (exit 3) take precedence over finding thresholds. The all-failed and complete-success cases retain their existing behavior.

Verification

Verified commit: 945e9a67b93b56a90cdc81ec59cf9cf84366dcbb.

  • The actual main/Cobra subprocess regression fails on the base behavior: partial clean inspections exit 0 and partial critical inspections exit 2 rather than 3. Only discovery/collection are injected; CLI parsing, fanout, rendering and process exit remain real.
  • Affected command race tests, clean committed-HEAD bash scripts/gate.sh, and go test -race ./... pass.
  • Controls cover complete clean/warn/critical results, fail-on none and critical, partial failures, all failures, retained JSON output and skip diagnostics.

Scope, risk and rollback

No collector SQL, model fields, dependencies or migrations change. PR #38 overlaps the fanout file but its partial-failure handling is conditional on all-instances; this corrects plain all-databases independently. No live connection-failure simulation is claimed. Revert this commit to restore the former exit precedence.

Checklist

  • scripts/gate.sh passes on committed HEAD; full race suite passes.
  • Read-only, privacy and deterministic-finding invariants preserved.
  • No new finding or model.Context JSON field; catalog/model schema unchanged.

A successful subset of database inspections previously hid failures in other databases. Preserve the useful report but give execution failure precedence over findings. The subprocess regression exercises actual CLI parsing, fanout, JSON rendering and exit codes.

Verification: affected packages pass with the race detector. No collector SQL, dependency or JSON schema changes. Revert this commit to restore the prior behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partial all-database inspections can return a successful exit status

1 participant