feat(alerts): an acknowledgement is on the record, with who made it (#5463)
#5463 "Acknowledgements on record: an event and who did it", step 1 of milestone 499 "Alerts you can trust". The live walk in #5461 found that acknowledging changed only the alert's current state: once it resolved, nothing said who had acknowledged it or when. - alert_events.actor_id (migration 0040): the person behind a transition. - Acknowledging writes a firing → acknowledged event by the acknowledger. - A rule edit, disable or enable that resets an alert carries its actor (web and MCP alike). - The history page notes "acknowledged by X" and "rule disabled by X"; MCP get_alert_history returns `by`. - One usernames() helper in alerts.service, used by the active list, the history page and the MCP tools. - docs/core/alerting.md: the state diagram no longer shows an acknowledged alert re-firing, and says what an event records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,12 @@ class AlertEvent(Base):
|
||||
email_error: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
webhook_sent: Mapped[bool | None] = mapped_column(Boolean, nullable=True)
|
||||
webhook_error: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
# Who made this transition happen, when a person did: an acknowledgement,
|
||||
# or a rule edit, disable or enable that reset the alert (#5463). None for
|
||||
# every transition a sample or Steward itself caused.
|
||||
actor_id: Mapped[str | None] = mapped_column(
|
||||
String(36), ForeignKey("users.id", ondelete="SET NULL"), nullable=True
|
||||
)
|
||||
# Set when this firing event triggered an Ansible action run (audit link).
|
||||
ansible_run_id: Mapped[str | None] = mapped_column(
|
||||
String(36), ForeignKey("ansible_runs.id", ondelete="SET NULL"), nullable=True
|
||||
|
||||
Reference in New Issue
Block a user