Documentation
¶
Overview ¶
Package deploywhy turns the stored facts of one deploy into a short verdict.
Index ¶
Constants ¶
const ( VerdictOOMKilled = "oom_killed" VerdictExitNonZero = "exit_nonzero" VerdictHealthFailed = "health_failing" VerdictNewLogs = "new_log_patterns" VerdictNoSignal = "no_signal" VerdictOK = "ok" )
Verdict names the strongest signal found, in priority order.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Changes ¶
type Changes struct {
Image *Change `json:"image,omitempty"`
Port *Change `json:"port,omitempty"`
EnvAdded []string `json:"env_added,omitempty"`
EnvRemoved []string `json:"env_removed,omitempty"`
EnvChanged []string `json:"env_changed,omitempty"`
EnvBy []EnvBy `json:"env_by,omitempty"`
}
Changes is what differs from the last good deploy. Env holds key names only, never values.
type EnvBy ¶
type EnvBy struct {
Key string `json:"key"`
Action string `json:"action"`
Actor string `json:"actor"`
Source string `json:"source,omitempty"`
At string `json:"at"`
}
EnvBy says who last changed an env key between the last good deploy and this one. Key names only.
type EnvHint ¶
type EnvHint struct {
Key string `json:"key"`
Kind string `json:"kind"`
Reason string `json:"reason"`
}
EnvHint is one env contract rule the app's current env breaks. Key and reason only, never a value.
type Health ¶
type Health struct {
Target string `json:"target"`
Success bool `json:"success"`
StatusCode int `json:"status_code,omitempty"`
Error string `json:"error,omitempty"`
}
Health is the last probe result recorded for the deploy.
type Input ¶
type Input struct {
DeployID string
Failed bool
ExitCode *int
OOMKilled bool
Health *Health
Templates []Template
BaselineID string
BaselineTemplate []Template
Cause *Cause
TailLines []string
TailMax int
Changes Changes
EnvHints []EnvHint
}
Input is everything Compute needs, all read from stored records.
type Report ¶
type Report struct {
DeployID string `json:"deploy_id"`
Verdict string `json:"verdict"`
ExitCode *int `json:"exit_code,omitempty"`
OOMKilled bool `json:"oom_killed,omitempty"`
Health *Health `json:"health,omitempty"`
BaselineID string `json:"baseline_deploy_id,omitempty"`
NewTemplateCount int `json:"new_template_count"`
NewTemplates []Template `json:"new_templates"`
Cause *Cause `json:"cause,omitempty"`
Tail []TailLine `json:"tail,omitempty"`
Changes Changes `json:"changes"`
EnvHints []EnvHint `json:"env_hints,omitempty"`
Summary []string `json:"summary"`
}
Report is the verdict and its evidence.
type TailLine ¶
TailLine is one log line with the number of consecutive repeats folded into it.
func CollapseTail ¶
CollapseTail folds consecutive repeats of lines (already secret-masked) and keeps the last n entries.