Record the actor on assign, archive and unarchive (#35)
Assign logged only the assignee (user_id), archive/unarchive logged nothing. Migration 018 adds actor_user_id/actor_service_account_id to incident_events for 'assigned'; archive/unarchive now log archived/unarchived events with the caller via callerActorIDs. Timeline JSON gains actor_* fields; web timeline renders them. Service accounts are still not assignable.
This commit is contained in:
@@ -74,7 +74,8 @@ type Incident struct {
|
||||
// and is the only history this server keeps — alert rows are mutated in place.
|
||||
//
|
||||
// Type is one of: triggered, alert_added, alert_resolved, acknowledged,
|
||||
// unacknowledged, assigned, snoozed, unsnoozed, resolved, note. UserID and
|
||||
// unacknowledged, assigned, archived, unarchived, snoozed, unsnoozed,
|
||||
// resolved, note. UserID and
|
||||
// ServiceAccountID are mutually exclusive; both nil means the server acted
|
||||
// rather than any caller.
|
||||
type IncidentEvent struct {
|
||||
@@ -92,6 +93,14 @@ type IncidentEvent struct {
|
||||
ServiceAccountID *int64 `json:"service_account_id,omitempty"`
|
||||
ServiceAccountName *string `json:"service_account_name,omitempty"`
|
||||
|
||||
// Actor* name who performed an 'assigned' event, whose UserID is the
|
||||
// assignee. Mutually exclusive; unset on every other event type and on
|
||||
// assignments made before migration 018. See terdut-server#35.
|
||||
ActorUserID *int64 `json:"actor_user_id,omitempty"`
|
||||
ActorUsername *string `json:"actor_username,omitempty"`
|
||||
ActorServiceAccountID *int64 `json:"actor_service_account_id,omitempty"`
|
||||
ActorServiceAccountName *string `json:"actor_service_account_name,omitempty"`
|
||||
|
||||
AlertID *int64 `json:"alert_id,omitempty"`
|
||||
Detail *string `json:"detail,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
||||
Reference in New Issue
Block a user