feat: add Silo_Diag connection diagnostics command #6

Merged
forbes merged 1 commits from feature/silo-diag into main 2026-02-08 22:22:51 +00:00
Owner

Add a Silo_Diag command that sequentially tests connectivity and outputs results to the FreeCAD console.

Tests run

  1. DNS — resolve the configured silo hostname
  2. HealthGET /health (no auth required)
  3. ReadyGET /ready (checks DB + MinIO)
  4. AuthGET /api/auth/me with current credentials
  5. SSE — attempt event-stream handshake to /api/events

Implementation

  • _DiagWorker(QThread) runs all tests in a background thread
  • Each test emits a result(name, passed, detail) signal back to the main thread
  • Results printed to FreeCAD console as PASS / FAIL with details
  • All tests run independently — failure in one does not skip others
  • Double-click guard prevents overlapping runs
  • Reuses existing _get_api_url(), _get_auth_headers(), _get_ssl_context()

Files changed

  • freecad/silo_commands.py — added import socket, _DiagWorker, Silo_Diag class, command registration
  • freecad/InitGui.py — added Silo_Diag to toolbar/menu

Closes #3

Add a `Silo_Diag` command that sequentially tests connectivity and outputs results to the FreeCAD console. ## Tests run 1. **DNS** — resolve the configured silo hostname 2. **Health** — `GET /health` (no auth required) 3. **Ready** — `GET /ready` (checks DB + MinIO) 4. **Auth** — `GET /api/auth/me` with current credentials 5. **SSE** — attempt event-stream handshake to `/api/events` ## Implementation - `_DiagWorker(QThread)` runs all tests in a background thread - Each test emits a `result(name, passed, detail)` signal back to the main thread - Results printed to FreeCAD console as `PASS` / `FAIL` with details - All tests run independently — failure in one does not skip others - Double-click guard prevents overlapping runs - Reuses existing `_get_api_url()`, `_get_auth_headers()`, `_get_ssl_context()` ## Files changed - `freecad/silo_commands.py` — added `import socket`, `_DiagWorker`, `Silo_Diag` class, command registration - `freecad/InitGui.py` — added `Silo_Diag` to toolbar/menu Closes #3
forbes added 1 commit 2026-02-08 21:32:35 +00:00
Add a Silo_Diag command that sequentially tests DNS resolution, /health,
/ready, /api/auth/me, and SSE endpoint connectivity, outputting PASS/FAIL
results to the FreeCAD console.

Runs in a background QThread to avoid blocking the UI. Each test runs
independently regardless of prior failures. Includes a double-click
guard to prevent overlapping runs.

Closes #3
forbes force-pushed feature/silo-diag from 99d6dd173f to 7c7394f08b 2026-02-08 22:15:31 +00:00 Compare
forbes force-pushed feature/silo-diag from 7c7394f08b to 4ddbf26af7 2026-02-08 22:22:31 +00:00 Compare
forbes merged commit 76973aaae0 into main 2026-02-08 22:22:51 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo-mod#6