Skip to content

Sprint v0.4.0-alpha: Add Data Source Diagnostics (backend + UI + tests) - #26

Merged
DeepZone merged 1 commit into
mainfrom
codex/add-data-source-diagnostics-feature
May 20, 2026
Merged

Sprint v0.4.0-alpha: Add Data Source Diagnostics (backend + UI + tests)#26
DeepZone merged 1 commit into
mainfrom
codex/add-data-source-diagnostics-feature

Conversation

@DeepZone

Copy link
Copy Markdown
Owner

Motivation

  • Provide transparent, per-check diagnostics about which external data sources were queried and why a check may be UNKNOWN/WARNING (timeouts, parse errors, empty data, cache hints, etc.).
  • Make diagnostics available in reports and the UI so operators can distinguish data problems from true operational issues.
  • Preserve existing public APIs and demo-mode behavior while keeping the system read-only.

Description

  • Added a centralized diagnostics model backend/app/core/source_diagnostics.py with status constants and make_source_diagnostic(...) to produce a stable diagnostic shape.
  • Instrumented RipeStatClient (get_with_diagnostics(...)) to measure duration, honor demo mode, use existing caching best-effort, and classify errors (TIMEOUT, RATE_LIMITED, HTTP_ERROR, PARSE_ERROR, EMPTY_RESPONSE, OK, etc.) while keeping get(...) backwards-compatible.
  • Propagated diagnostics into checks: Prefix, ASN (including aggregated RPKI-batch metadata), and Preflight now include details.source_diagnostics and where appropriate attach per-call source_diagnostic entries from RPKI checks.
  • Improved routing-visibility UNKNOWN explanations when the RIPEstat routing-status payload cannot be interpreted and flagged the structure as unknown.
  • Extended report templates (report.md.j2, report.html.j2) with a Data Source Diagnostics section and added a Diagnostics table/card to the frontend ReportView with a new SourceDiagnostic type in frontend/src/types.ts.
  • Added tests (backend/tests/test_source_diagnostics.py) and enhanced smoke tests to assert details.source_diagnostics presence; bumped visible version strings to v0.4.0-alpha / 0.4.0.

Testing

  • Ran backend unit test suite with cd backend && pytest -q resulting in all tests passing (64 passed).
  • Ran frontend build with cd frontend && npm run build and the production build completed successfully.
  • Added backend/tests/test_source_diagnostics.py and extended existing smoke tests to check that details.source_diagnostics is present for Prefix, ASN and Preflight checks, and demo-mode diagnostics indicate demo_mode or the demo message.

Codex Task

@DeepZone
DeepZone merged commit 0892d1d into main May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant