Add incidents and scheduled maintenance#102
Draft
lewispb wants to merge 5 commits into
Draft
Conversation
Operator-authored incidents and scheduled maintenance windows, shown on the public status page and managed from the admin area. Maintenance is modelled as an STI subclass of Incident, sharing the update timeline and affected-service links. Status is probe-derived, so an incident is a narrative overlay rather than a status source; an active maintenance suppresses its services from the live alarm and shows an "under maintenance" state, while a real outage still outranks it for the top-level banner. A recurring job advances maintenance windows through their lifecycle.
Rebuild the incident/maintenance index and form with a status-spine visual language: a colored rail that adopts the public-page status colour as impact and kind are chosen, a segmented type toggle, a colour-swatch impact picker, service chips, and a lifecycle stepper and timeline on edit. Keep native datetime-local inputs, made legible in dark mode via color-scheme. Also give admin pages meaningful titles via a content_for-driven layout title.
Add a public permalink for each incident and maintenance with its full update timeline, linked from the status page cards and the RSS feed. An active incident's impact now raises the top-level banner alongside probe-derived status (worst wins; maintenance stays lowest). Refactor to house style: incidents seed their default status and first update via model callbacks so the controller just builds and saves, params.expect for strong params, conditional checks over guard returns, and a page_title_tag helper driving per-page titles. Document the dummy-app test/DB workflow.
A display name isn't unique across probes — an HTTP and a traceroute check can share one — so keying ProbeRollup on (probe_name, period_start) collided them into a single row, silently dropping one probe's uptime and its probe_service for the day. On the public status page that left the affected service showing no history at all. Add probe_type/probe_target to the rollup and dedupe on the full probe identity. Elevate [name, type, probe_target] as probe_key on Probeable and its Probes::Status::Probe value object, reused by Status#build_probes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds operator-authored incidents and scheduled maintenance to the status page.
Model
Incident(STI base + reactive incident) with a sharedIncidentUpdatetimeline andIncidentAffectedServicelinks (services areFrozenRecord, so linked by code).Maintenance < Incident— planned window (starts_at/ends_at), impact forced tomaintenance, own lifecycle.Incidents::Lifecycle(scopes +record_update) andServices::MaintenanceStatus(mixed intoService).Status stays probe-derived — an incident is a narrative overlay, not a status source.
Behaviour
/incidents(authenticated), linked from the header nav.scheduled → in_progress → completed.Not included (deferred)
Notes
create_upright_incidents) pluspersistent_schemaupdate.