feat(statuspage): show the open incident's status next to its component
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 10m19s
ci / test (pull_request) Successful in 13m1s
ci / build (pull_request) Successful in 16m3s
ci / image (pull_request) Successful in 4m54s

The component list names the status of the component's newest unresolved
incident the organization gave one, built-in or own with its color.

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-24 07:09:50 +01:00
1 parent 45123ff93a
commit 316bdeb223
4 files changed
+190 -146

No files matched your search

+16
View File
@@ -275,6 +275,22 @@ func (s PageSnapshot) IncidentsForComponent(componentName string) []PageIncident
return out
}
// OpenIncidentStatus returns the newest unresolved incident of
// componentName the organization gave a status, if any.
func (s PageSnapshot) OpenIncidentStatus(componentName string) (PageIncident, bool) {
var found PageIncident
ok := false
for _, inc := range s.Incidents {
if inc.Component != componentName || inc.ResolvedAt != nil || inc.Status == "" {
continue
}
if !ok || inc.StartedAt.After(found.StartedAt) {
found, ok = inc, true
}
}
return found, ok
}
// MaintenanceForComponent splits planned maintenance affecting componentName
// into ongoing and upcoming occurrences at now.
func (s PageSnapshot) MaintenanceForComponent(componentName string, now time.Time) (ongoing, upcoming []PageMaintenance) {