Clarify run-if skip reasons with the resolved variable value.
Failed conditions now explain skips in plain language (e.g. UpdateCount was 0) and truncate long captures so misconfigured apt listings cannot flood the UI.
This commit is contained in:
@@ -128,15 +128,16 @@ type ActionEnvVar struct {
|
||||
|
||||
// Action is a named shell command or script that can run on managed nodes.
|
||||
type Action struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Kind ActionKind `json:"kind"`
|
||||
Body string `json:"body"`
|
||||
Env []ActionEnvVar `json:"env"`
|
||||
Builtin bool `json:"builtin"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Kind ActionKind `json:"kind"`
|
||||
Body string `json:"body"`
|
||||
Env []ActionEnvVar `json:"env"`
|
||||
RequiresSudo bool `json:"requires_sudo"`
|
||||
Builtin bool `json:"builtin"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// ActionStore is the plain JSON payload in actions.json.
|
||||
@@ -184,6 +185,9 @@ type NodeActionItem struct {
|
||||
Kind ActionKind `json:"kind,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Env []ActionEnvVar `json:"env,omitempty"`
|
||||
RequiresSudo bool `json:"requires_sudo,omitempty"` // local items; library refs inherit from library
|
||||
SetVariable string `json:"set_variable,omitempty"` // capture trimmed stdout into this run-scoped name
|
||||
RunIf string `json:"run_if,omitempty"` // e.g. "if $UpdateCount >= 1"
|
||||
}
|
||||
|
||||
// NodeActionGroup is a named ordered set of actions with one schedule on a node.
|
||||
@@ -213,15 +217,22 @@ const (
|
||||
|
||||
// ActionItemRunResult is the captured output of one action within a run.
|
||||
type ActionItemRunResult struct {
|
||||
ItemID string `json:"item_id"`
|
||||
ActionName string `json:"action_name"`
|
||||
Source string `json:"source"`
|
||||
ExitCode int `json:"exit_code"`
|
||||
Stdout string `json:"stdout"`
|
||||
Stderr string `json:"stderr"`
|
||||
Error string `json:"error,omitempty"`
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
FinishedAt time.Time `json:"finished_at"`
|
||||
ItemID string `json:"item_id"`
|
||||
ActionName string `json:"action_name"`
|
||||
Source string `json:"source"`
|
||||
Kind ActionKind `json:"kind,omitempty"`
|
||||
RemoteCommand string `json:"remote_command,omitempty"`
|
||||
SSHUsername string `json:"ssh_username,omitempty"`
|
||||
ExitCode int `json:"exit_code"`
|
||||
Stdout string `json:"stdout"`
|
||||
Stderr string `json:"stderr"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Skipped bool `json:"skipped,omitempty"`
|
||||
SkipReason string `json:"skip_reason,omitempty"`
|
||||
SetVariable string `json:"set_variable,omitempty"`
|
||||
VariableValue string `json:"variable_value,omitempty"`
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
FinishedAt time.Time `json:"finished_at"`
|
||||
}
|
||||
|
||||
// ActionGroupRunRecord is one execution of a group (or a single-item manual run).
|
||||
|
||||
Reference in New Issue
Block a user