feat: own incident statuses with a color; incidents before maintenance #144

Merged
Sebi merged 1 commits from feat/incident-statuses into main 2026-11-23 22:59:18 +00:00
Owner

Builds on #143 (incident updates); merge that first.

Own statuses (migration 00049): table incident_statuses (name ≤ 40, unique per organization, color #rrggbb, RLS). Updates and incidents store status = 'custom' plus status_id (FK, ON DELETE RESTRICT, check that both go together).

  • API: GET /api/v1/org/incident-statuses (incidents.read), POST, PUT /:id, DELETE /:id (org.manage; 409 status_in_use, 409 status_name_taken, 422 for bad colors). Audited.
  • POST …/updates takes a built-in status or the ID of an own one; responses carry status: "custom", status_id, status_name, status_color.
  • Settings → Incident statuses: built-in ones shown, own ones listed with color picker, rename, delete, and an add form (read-only for those without org.manage).
  • Console and status pages show own statuses as a colored dot with the name; the update form lists them after the built-in ones and preselects the current own status for the next update.
  • Renaming/recoloring applies to past updates too.

Status page order: Recent incidents now come before Planned maintenance (main page and component pages); ongoing maintenance stays at the top under the overall status.

Tests: TestCustomIncidentStatuses (validation, duplicate, viewer refused, update with own status, unknown ID refused, API fields, status page snapshot, console color and preselection, settings page, rename carries over, in-use delete refused, unused delete) and status page rendering (color, name, incidents before maintenance). Full suite and lint green. Dev env (:8080, :8082) migrated (00049) and restarted.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

> Builds on #143 (incident updates); merge that first. **Own statuses** (migration 00049): table `incident_statuses` (name ≤ 40, unique per organization, color `#rrggbb`, RLS). Updates and incidents store `status = 'custom'` plus `status_id` (FK, `ON DELETE RESTRICT`, check that both go together). - API: `GET /api/v1/org/incident-statuses` (incidents.read), `POST`, `PUT /:id`, `DELETE /:id` (org.manage; `409 status_in_use`, `409 status_name_taken`, `422` for bad colors). Audited. - `POST …/updates` takes a built-in status or the ID of an own one; responses carry `status: "custom"`, `status_id`, `status_name`, `status_color`. - Settings → *Incident statuses*: built-in ones shown, own ones listed with color picker, rename, delete, and an add form (read-only for those without org.manage). - Console and status pages show own statuses as a colored dot with the name; the update form lists them after the built-in ones and preselects the current own status for the next update. - Renaming/recoloring applies to past updates too. **Status page order**: *Recent incidents* now come before *Planned maintenance* (main page and component pages); ongoing maintenance stays at the top under the overall status. **Tests**: `TestCustomIncidentStatuses` (validation, duplicate, viewer refused, update with own status, unknown ID refused, API fields, status page snapshot, console color and preselection, settings page, rename carries over, in-use delete refused, unused delete) and status page rendering (color, name, incidents before maintenance). Full suite and lint green. Dev env (:8080, :8082) migrated (00049) and restarted. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 2 commits 2026-11-23 22:50:12 +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 / image (pull_request) Successful in 4m23s
ci / build (pull_request) Successful in 11m0s
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
feat: own incident statuses with a color; incidents before maintenance
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m38s
ci / build (pull_request) Successful in 16m36s
ci / image (pull_request) Successful in 3m37s
ci / test (pull_request) Successful in 14m21s
2409a919c3
Organizations add statuses of their own, with a name and a color, next
to the built-in ones (Settings, incident statuses; API under
/org/incident-statuses, managed with org.manage). Updates pick them by
ID; the console and status pages show them in their color. Renaming or
recoloring carries into the history; a status in use cannot be deleted
(409 status_in_use). API responses give status "custom" with status_id,
status_name and status_color.

Status pages now list recent incidents before planned maintenance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 6a60ee746e into main 2026-11-23 22:59:18 +00:00
Sebi deleted branch feat/incident-statuses 2026-11-23 22:59:20 +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#144