Skip to content

Commit

Permalink
feat: add error column to playbooks
Browse files Browse the repository at this point in the history
This is for errors that are not related to actions.
Example:
- db errors when fetching the playbook
- when a non existent playbook id is supplied
- when a playbook delay expression is invalid (the delay is in action
  but its parsed by the run consumer.)
  • Loading branch information
adityathebe authored and moshloop committed Mar 7, 2024
1 parent 9d90b0e commit 2abd456
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions models/playbooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type PlaybookRun struct {
ComponentID *uuid.UUID `json:"component_id,omitempty"`
CheckID *uuid.UUID `json:"check_id,omitempty"`
ConfigID *uuid.UUID `json:"config_id,omitempty"`
Error *string `json:"error,omitempty"`
Parameters types.JSONStringMap `json:"parameters,omitempty" gorm:"default:null"`
AgentID *uuid.UUID `json:"agent_id,omitempty"`
}
Expand Down
4 changes: 4 additions & 0 deletions schema/playbooks.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ table "playbook_runs" {
default = var.uuid_nil
type = uuid
}
column "error" {
null = true
type = text
}
primary_key {
columns = [column.id]
}
Expand Down

0 comments on commit 2abd456

Please sign in to comment.