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

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
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-23 23:38:07 +01:00
1 parent 6f0cf59406
commit 43a04e99b1
27 files changed
+2753 -908

No files matched your search

+19
View File
@@ -357,6 +357,13 @@ func TestNestedGroupsAndComponentDetails(t *testing.T) {
},
Incidents: []agentapi.PageIncident{
{Component: "Public API", StartedAt: now.Add(-10 * time.Minute)},
{
Component: "Website", StartedAt: now.Add(-time.Hour), Title: "Anmeldung langsam", Status: "monitoring",
Updates: []agentapi.PageIncidentUpdate{
{Status: "monitoring", Message: "Fix ist **ausgerollt**.", At: now.Add(-5 * time.Minute)},
{Status: "investigating", Message: "Wir schauen.\n\n<script>alert(1)</script>", At: now.Add(-50 * time.Minute)},
},
},
},
}
@@ -366,6 +373,18 @@ func TestNestedGroupsAndComponentDetails(t *testing.T) {
}}
h := newHarness(t, src, t.TempDir(), &now)
t.Run("incidents show their title, status and updates", func(t *testing.T) {
_, body := h.get("status.example.test", "/acme")
for _, want := range []string{"Anmeldung langsam", "Beobachtung", "Untersuchung läuft", "<strong>ausgerollt</strong>", "Wir schauen."} {
if !strings.Contains(body, want) {
t.Errorf("GET /acme missing %q", want)
}
}
if strings.Contains(body, "<script>alert") {
t.Error("an update's HTML reached the page")
}
})
t.Run("main page renders nested groups and clickable links", func(t *testing.T) {
code, body := h.get("status.example.test", "/acme")
if code != http.StatusOK {