feat: incident updates with a status, public or internal #143

Merged
Sebi merged 1 commits from feat/incident-updates into main 2026-11-23 22:58:47 +00:00
Owner

Model (migration 00048): incidents.title, incidents.status (latest update's), table incident_updates (status, Markdown message ≤ 5000, public, author, time; RLS per organization, cascades with the incident).

Status: investigating · identified · monitoring · resolved. An incident shows the status of its latest update; once its monitor recovers it is resolved regardless; before any update it stays "ongoing" as before.

API

  • GET /api/v1/org/incidents/:id (incidents.read) — incident with updates, internal notes included.
  • PATCH /api/v1/org/incidents/:id {title} — name it; empty shows the monitor's name.
  • POST /api/v1/org/incidents/:id/updates {status, message, public?} → 201; public defaults to true.
  • DELETE /api/v1/org/incidents/:id/updates/:update — status falls back to the previous update.
  • Writes need incidents.write for the monitor's group (group-scoped roles work); audited (incident.title, incident.update, incident.update_delete). The incident list now has title and status.

Console: incident list shows status label and title, linking to /incidents/:id: timeline newest first (outage began with cause, updates with author and an internal marker, recovery), form to post an update (status preselected one step further, Markdown editor, "show on status pages") and to set the title — only for writers.

Status pages: incidents show title (component next to it), status and the public updates with rendered Markdown (raw HTML dropped).

Export: organization export includes title, status and updates per incident.

Tests: TestIncidentUpdates (validation, status follows updates, title, list, status page snapshot excludes internal notes, console page, viewer reads but cannot post, delete falls back, recovery resolves, 404) and a status page rendering test (title, German status labels, Markdown, no script). Full suite and lint green. Dev env (:8080 API and :8082 status page) migrated and restarted.

Not included: notifying subscribers or channels about updates.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

**Model** (migration 00048): `incidents.title`, `incidents.status` (latest update's), table `incident_updates` (status, Markdown message ≤ 5000, `public`, author, time; RLS per organization, cascades with the incident). **Status**: `investigating` · `identified` · `monitoring` · `resolved`. An incident shows the status of its latest update; once its monitor recovers it is `resolved` regardless; before any update it stays "ongoing" as before. **API** - `GET /api/v1/org/incidents/:id` (incidents.read) — incident with updates, internal notes included. - `PATCH /api/v1/org/incidents/:id` `{title}` — name it; empty shows the monitor's name. - `POST /api/v1/org/incidents/:id/updates` `{status, message, public?}` → 201; `public` defaults to true. - `DELETE /api/v1/org/incidents/:id/updates/:update` — status falls back to the previous update. - Writes need `incidents.write` for the monitor's group (group-scoped roles work); audited (`incident.title`, `incident.update`, `incident.update_delete`). The incident list now has `title` and `status`. **Console**: incident list shows status label and title, linking to `/incidents/:id`: timeline newest first (outage began with cause, updates with author and an *internal* marker, recovery), form to post an update (status preselected one step further, Markdown editor, "show on status pages") and to set the title — only for writers. **Status pages**: incidents show title (component next to it), status and the public updates with rendered Markdown (raw HTML dropped). **Export**: organization export includes title, status and updates per incident. **Tests**: `TestIncidentUpdates` (validation, status follows updates, title, list, status page snapshot excludes internal notes, console page, viewer reads but cannot post, delete falls back, recovery resolves, 404) and a status page rendering test (title, German status labels, Markdown, no script). Full suite and lint green. Dev env (:8080 API and :8082 status page) migrated and restarted. Not included: notifying subscribers or channels about updates. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-23 22:38:22 +00:00
feat: incident updates with a status, public or internal
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m54s
ci / test (pull_request) Successful in 12m15s
ci / build (pull_request) Successful in 11m0s
ci / image (pull_request) Successful in 4m23s
43a04e99b1
Outages open and close with their monitor; now people can say what is
going on. An incident gets an optional title and updates, each with a
status (investigating, identified, monitoring, resolved) and a Markdown
message, shown on status pages or kept as an internal note. The incident
shows the latest update's status, resolved once its monitor recovered.

The console lists title and status and has a page per incident with its
timeline (outage, updates, recovery) and, for incidents.write in the
monitor's group, forms to post updates and set the title. Status pages
show title, status and public updates. API: GET/PATCH
/org/incidents/:id, POST and DELETE /org/incidents/:id/updates; the
incident list carries title and status; the organization export
includes the updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 3bf84e8c27 into main 2026-11-23 22:58:47 +00:00
Sebi deleted branch feat/incident-updates 2026-11-23 22:58:50 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#143