feat(webui): Sentry/GlitchTip observability console & correlation view (Closes #649)
This commit is contained in:
@@ -1568,6 +1568,32 @@ class ControlPlaneDB:
|
||||
).fetchone()
|
||||
return dict(row) if row else None
|
||||
|
||||
def list_incident_links(
|
||||
self,
|
||||
*,
|
||||
provider: str | None = None,
|
||||
gitea_org: str | None = None,
|
||||
gitea_repo: str | None = None,
|
||||
limit: int = 100,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""List stored incident_links rows, optionally filtered by provider/repo (#612 / #649)."""
|
||||
query = "SELECT * FROM incident_links WHERE 1=1"
|
||||
params: list[Any] = []
|
||||
if provider:
|
||||
query += " AND provider = ?"
|
||||
params.append(provider.strip().lower())
|
||||
if gitea_org:
|
||||
query += " AND gitea_org = ?"
|
||||
params.append(_norm_scope(gitea_org))
|
||||
if gitea_repo:
|
||||
query += " AND gitea_repo = ?"
|
||||
params.append(_norm_scope(gitea_repo))
|
||||
query += " ORDER BY link_id DESC LIMIT ?"
|
||||
params.append(max(1, limit))
|
||||
with self._tx(immediate=False) as conn:
|
||||
rows = conn.execute(query, params).fetchall()
|
||||
return [dict(r) for r in rows]
|
||||
|
||||
|
||||
# ── lease lifecycle (#601) ────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user