Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53e4d99
Add status/severity filters to the incidents list endpoint
ApparentlyTejas Nov 21, 2026
eacec0b
Add combined status+severity filter test for incidents list
ApparentlyTejas Nov 21, 2026
501788f
Scaffold the DevPulse frontend with Tailwind design tokens
ApparentlyTejas Nov 21, 2026
4afe944
Type-check test files and drop the unused smoke-test import
ApparentlyTejas Nov 21, 2026
a9f5bf4
Add API client, auth endpoints, and session context
ApparentlyTejas Nov 21, 2026
1c33800
De-duplicate concurrent token refresh calls
ApparentlyTejas Nov 21, 2026
4d32e29
Add auth pages, protected layout, and org context
ApparentlyTejas Nov 21, 2026
a8efe74
Bound derived org slug length to the backend's 64-char max
ApparentlyTejas Nov 21, 2026
61b214b
Use a shadcn Select for the org switcher instead of a native <select>
ApparentlyTejas Nov 21, 2026
d3cb706
Add services list with create, edit, and delete
ApparentlyTejas Nov 21, 2026
eaf88e4
Stop resetting service status on edit
ApparentlyTejas Nov 21, 2026
68d5611
Reset pagination offset when the selected org changes
ApparentlyTejas Nov 21, 2026
bc3de5d
Document that description/repository_url can't be cleared once set
ApparentlyTejas Nov 21, 2026
dfc0a2f
Pre-populate service status and repository URL in the edit dialog
ApparentlyTejas Nov 21, 2026
cdb1c3f
Add service detail page with tabbed layout
ApparentlyTejas Nov 21, 2026
4079e4f
Add alert rules tab with create, edit, and delete
ApparentlyTejas Nov 21, 2026
f947335
Add alert events tab with pagination and status updates
ApparentlyTejas Nov 21, 2026
6632818
Add metrics tab with snapshot list and manual recording
ApparentlyTejas Nov 21, 2026
35d9e78
Use a dialog for recording metric snapshots and reset pagination on c…
ApparentlyTejas Nov 21, 2026
c5b1ba7
Add incidents list with status and severity filtering
ApparentlyTejas Nov 21, 2026
36dc705
Add incident detail page with status control
ApparentlyTejas Nov 21, 2026
ac524de
Link incident titles in the list to their detail page
ApparentlyTejas Nov 21, 2026
ae68546
Link service names in the list to their detail page
ApparentlyTejas Nov 21, 2026
7104826
Add triage history timeline and run-triage action
ApparentlyTejas Nov 21, 2026
6818161
Add postmortem view and generate action
ApparentlyTejas Nov 21, 2026
863e82e
Add org members page with add, role change, and remove
ApparentlyTejas Nov 22, 2026
e434138
Add dashboard with org summary counts and recent alert events
ApparentlyTejas Nov 22, 2026
78b0085
Add primary nav, logout, and org load error/persistence handling
ApparentlyTejas Nov 22, 2026
cf41158
Fix active-tab styling, stale-404 handling, and pagination footer
ApparentlyTejas Nov 22, 2026
f298f1b
Don't retry 4xx errors in the production QueryClient; update stale RE…
ApparentlyTejas Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ The MCP server deliberately holds no database connection of its own. Every tool
| Tooling | ruff, mypy (strict), uv, Docker Compose, GitHub Actions |
| Logging | structlog (structured JSON) |

Frontend (React 18, TypeScript, Vite, shadcn/ui) is planned for a later phase and is not implemented yet, so there is no UI to screenshot today; everything above is exercised through the REST API, the test suite, and the MCP server.
Frontend (React, TypeScript, Vite, Tailwind, shadcn/ui, Base UI) lives in `frontend/`: auth, org switching, services, incidents, alert rules/events, metrics, AI triage/postmortems, and org members are all wired to the API. To run it:

```bash
cd frontend
npm install
cp .env.example .env # defaults to http://localhost:8000/api/v1
npm run dev
```

Run its tests with `npm test` and its production build with `npm run build`.

## Running it locally

Expand Down Expand Up @@ -135,7 +144,7 @@ uv run devpulse-mcp
| --- | --- | --- |
| Phase 1 | Core backend (auth through incidents) | Done |
| Phase 2 | AI layer (Claude triage, MCP, RAG) | In progress: triage, postmortems, and the MCP server are shipped; RAG is next |
| Phase 3 | Frontend | Not started |
| Phase 3 | Frontend | Done: auth, org switching, services, incidents, alert rules/events, metrics, AI triage/postmortems, and org members are all shipped |
| Phase 4 | Production infrastructure (AWS) | In progress: pagination, rate limiting, Claude timeouts/retries, and the prod secret guard are shipped; deployment and observability are next |
| Phase 5 | Polish, docs, demo | Not started |

Expand Down
19 changes: 16 additions & 3 deletions backend/app/modules/incidents/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

from __future__ import annotations

from typing import Annotated
from uuid import UUID

from fastapi import APIRouter, HTTPException, status
from fastapi import APIRouter, HTTPException, Query, status

from app.core.pagination import Page, Pagination
from app.db.session import DbSession
from app.modules.auth.deps import CurrentUser
from app.modules.incidents import service as incidents_service
from app.modules.incidents.models import IncidentSeverity, IncidentStatus
from app.modules.incidents.schemas import (
CreateIncidentRequest,
IncidentOut,
Expand Down Expand Up @@ -53,11 +55,22 @@ async def create_incident(

@router.get("", response_model=Page[IncidentOut])
async def list_incidents(
org_id: UUID, db: DbSession, current_user: CurrentUser, page: Pagination
org_id: UUID,
db: DbSession,
current_user: CurrentUser,
page: Pagination,
incident_status: Annotated[IncidentStatus | None, Query(alias="status")] = None,
severity: IncidentSeverity | None = None,
) -> Page[IncidentOut]:
try:
incidents, total = await incidents_service.list_incidents(
db, org_id=org_id, user_id=current_user.id, limit=page.limit, offset=page.offset
db,
org_id=org_id,
user_id=current_user.id,
limit=page.limit,
offset=page.offset,
status=incident_status,
severity=severity,
)
except OrgNotFoundError as exc:
raise HTTPException(
Expand Down
20 changes: 15 additions & 5 deletions backend/app/modules/incidents/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,26 @@ async def create_incident(


async def list_incidents(
db: AsyncSession, org_id: UUID, user_id: UUID, limit: int, offset: int
db: AsyncSession,
org_id: UUID,
user_id: UUID,
limit: int,
offset: int,
status: IncidentStatus | None,
severity: IncidentSeverity | None,
) -> tuple[list[Incident], int]:
await _assert_org_membership(db, org_id, user_id)

total = await db.scalar(
select(func.count()).select_from(Incident).where(Incident.org_id == org_id)
)
filters = [Incident.org_id == org_id]
if status is not None:
filters.append(Incident.incident_status == status)
if severity is not None:
filters.append(Incident.severity == severity)

total = await db.scalar(select(func.count()).select_from(Incident).where(*filters))
result = await db.execute(
select(Incident)
.where(Incident.org_id == org_id)
.where(*filters)
.order_by(Incident.created_at.desc())
.limit(limit)
.offset(offset)
Expand Down
68 changes: 68 additions & 0 deletions backend/tests/integration/test_incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,74 @@ async def test_list_incidents_rejects_limit_over_max(client: AsyncClient) -> Non
assert resp.status_code == 422


async def test_list_incidents_filters_by_status(client: AsyncClient) -> None:
token, org_id = await _setup(client, "inc-filter-status@example.com", "inc-filter-status-org")
hdrs = {"Authorization": f"Bearer {token}"}
url = _inc_url(org_id)
await client.post(url, json={"title": "A", "severity": "sev1"}, headers=hdrs)
resp_open = await client.post(url, json={"title": "B", "severity": "sev1"}, headers=hdrs)
await client.patch(
f"{url}/{resp_open.json()['id']}/status",
json={"incident_status": "resolved"},
headers=hdrs,
)

resp = await client.get(url, params={"status": "resolved"}, headers=hdrs)
assert resp.status_code == 200
body = resp.json()
assert body["total"] == 1
assert body["items"][0]["title"] == "B"


async def test_list_incidents_filters_by_severity(client: AsyncClient) -> None:
token, org_id = await _setup(client, "inc-filter-sev@example.com", "inc-filter-sev-org")
hdrs = {"Authorization": f"Bearer {token}"}
url = _inc_url(org_id)
await client.post(url, json={"title": "A", "severity": "sev1"}, headers=hdrs)
await client.post(url, json={"title": "B", "severity": "sev4"}, headers=hdrs)

resp = await client.get(url, params={"severity": "sev4"}, headers=hdrs)
assert resp.status_code == 200
body = resp.json()
assert body["total"] == 1
assert body["items"][0]["title"] == "B"


async def test_list_incidents_combined_status_and_severity_zero_matches(client: AsyncClient) -> None:
token, org_id = await _setup(client, "inc-filter-combo@example.com", "inc-filter-combo-org")
hdrs = {"Authorization": f"Bearer {token}"}
url = _inc_url(org_id)
# A is sev1 and open; B is sev4 and resolved. Each filter alone matches one
# incident, but no incident matches both status=resolved and severity=sev1.
await client.post(url, json={"title": "A", "severity": "sev1"}, headers=hdrs)
resp_b = await client.post(url, json={"title": "B", "severity": "sev4"}, headers=hdrs)
await client.patch(
f"{url}/{resp_b.json()['id']}/status",
json={"incident_status": "resolved"},
headers=hdrs,
)

resp = await client.get(
url,
params={"status": "resolved", "severity": "sev1"},
headers=hdrs,
)
assert resp.status_code == 200
body = resp.json()
assert body["total"] == 0
assert body["items"] == []


async def test_list_incidents_rejects_invalid_status(client: AsyncClient) -> None:
token, org_id = await _setup(client, "inc-filter-bad@example.com", "inc-filter-bad-org")
resp = await client.get(
_inc_url(org_id),
params={"status": "not-a-real-status"},
headers={"Authorization": f"Bearer {token}"},
)
assert resp.status_code == 422


async def test_get_incident_not_found_returns_404(client: AsyncClient) -> None:
token, org_id = await _setup(client, "inc-get404@example.com", "inc-get404-org")
import uuid
Expand Down
1 change: 1 addition & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://localhost:8000/api/v1
25 changes: 25 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
.env

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions frontend/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
32 changes: 32 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)

## React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).

## Expanding the Oxlint configuration

If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`:

```json
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
```

See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories.
25 changes: 25 additions & 0 deletions frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "base-nova",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"menuColor": "default",
"menuAccent": "subtle",
"registries": {}
}
19 changes: 19 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DevPulse</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap"
rel="stylesheet"
/>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading