You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(credentials): surface host-list query failures instead of returning an empty success #48
GET /admin/api/settings/hosts returns HTTP 200 with [] when the backing credential query fails. Users cannot distinguish "no configured Git hosts" from "credential metadata could not be read."
Related reproducer: #45. This issue covers error propagation/observability rather than duplicating the full database-compatibility migration.
Observed evidence
At source revision 41ec093a745f1c0277893dc8f758b96b216c970f, a fresh full-PostgreSQL deployment with authentication enabled initialized its PostgreSQL schema and admin key. An authenticated host-list request returned:
GET /admin/api/settings/hosts -> HTTP 200
[]
The application logged:
Failed to list git host credentials: no such table: git_host_credentials
In app/services/database/credentials.py::list_git_host_credentials(), any database query failure is caught with except Exception: return []. The API endpoint in app/api/routers/settings.py receives an empty list and returns HTTP 200, making database errors indistinguishable from having zero configured credentials.
3. Implementation Plan
Remove the silent except Exception: return [] block in list_git_host_credentials().
Propagate database exceptions (or return an explicit error result) to app/api/routers/settings.py.
Update settings.py to catch query exceptions and return HTTP 500 with sanitized diagnostics (ensuring tokens or connection strings are never leaked).
Reserve HTTP 200 with [] strictly for successful queries that find zero rows.
4. Acceptance Criteria
Successfully querying an empty credential table returns HTTP 200 with [].
Missing tables or database connection failures return HTTP 500 with sanitized error details.
Activity
spelech commentedon Oct 27, 2026
Triage & Implementation Brief
1. Scope & Effort
2. Root Cause & Context
In
app/services/database/credentials.py::list_git_host_credentials(), any database query failure is caught withexcept Exception: return []. The API endpoint inapp/api/routers/settings.pyreceives an empty list and returns HTTP 200, making database errors indistinguishable from having zero configured credentials.3. Implementation Plan
except Exception: return []block inlist_git_host_credentials().app/api/routers/settings.py.settings.pyto catch query exceptions and return HTTP 500 with sanitized diagnostics (ensuring tokens or connection strings are never leaked).[]strictly for successful queries that find zero rows.4. Acceptance Criteria
[].google-labs-jules commentedon Oct 27, 2026
Jules is on it. When finished, you will see another comment and be able to review a PR.
google-labs-jules commentedon Oct 27, 2026
Ready for a review! A PR has been created.