Documentation
¶
Overview ¶
Package report turns probe and diff results into user-facing reports and writes them as table, json, markdown, sarif or GitHub annotations.
Index ¶
- Variables
- func MarkShared(c *Check, users map[string][]string, norm func(string) string)
- func ResolveShared(cs []*Check)
- type Change
- type Check
- type Diff
- type Explain
- type Key
- type Painter
- func (p Painter) Blue(s string) string
- func (p Painter) Bold(s string) string
- func (p Painter) Cyan(s string) string
- func (p Painter) Dim(s string) string
- func (p Painter) Green(s string) string
- func (p Painter) Magenta(s string) string
- func (p Painter) Red(s string) string
- func (p Painter) Status(s string, width int) string
- func (p Painter) Yellow(s string) string
- type Writer
Constants ¶
This section is empty.
Variables ¶
var Formats = []string{"table", "json", "markdown", "sarif", "github"}
Functions ¶
func MarkShared ¶
MarkShared handles a single-app check: keys with no effect that come only from values files other Applications also load cannot be judged from this app alone. They are shown as SHARED, pointing at scan, and do not fail. users maps a normalized file path to the other Applications loading it.
func ResolveShared ¶
func ResolveShared(cs []*Check)
ResolveShared handles values files loaded by several targets, such as a global values file passed to many charts: a key that has no effect in one chart but is used by another chart loading the same file is not reported.
Types ¶
type Change ¶
type Change struct {
Key string `json:"key"`
Path []string `json:"path"`
Kind string `json:"kind"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Value interface{} `json:"value,omitempty"`
OldDefault interface{} `json:"oldDefault,omitempty"`
NewDefault interface{} `json:"newDefault,omitempty"`
Detail string `json:"detail"`
Origins []values.Origin `json:"origins,omitempty"`
Ignored bool `json:"ignored,omitempty"`
// contains filtered or unexported fields
}
type Check ¶
type Check struct {
App string `json:"app"`
AppFile string `json:"appFile,omitempty"`
Chart string `json:"chart"`
Values []string `json:"values"`
Renders int64 `json:"renders"`
Millis int64 `json:"durationMs"`
Noise int `json:"noisyFields"`
Keys []Key `json:"keys"`
Counts map[string]int `json:"counts"`
Ignored int `json:"ignored"`
Notes []string `json:"notes,omitempty"`
Unproven int `json:"sharedUnverified"`
Error string `json:"error,omitempty"`
}
type Diff ¶
type Diff struct {
App string `json:"app"`
AppFile string `json:"appFile,omitempty"`
Chart string `json:"chart"`
From string `json:"from"`
To string `json:"to"`
Values []string `json:"values"`
Renders int64 `json:"renders"`
Millis int64 `json:"durationMs"`
Changes []Change `json:"changes"`
Counts map[string]int `json:"counts"`
Error string `json:"error,omitempty"`
}
func FailedDiff ¶
type Key ¶
type Key struct {
Key string `json:"key"`
Path []string `json:"path"`
Status string `json:"status"`
Value interface{} `json:"value"`
Default interface{} `json:"default,omitempty"`
Detail string `json:"detail,omitempty"`
Origins []values.Origin `json:"origins,omitempty"`
Ignored bool `json:"ignored,omitempty"`
UsedBy string `json:"usedBy,omitempty"`
// only this app was analyzed: the key may be used by them.
SharedWith []string `json:"sharedWith,omitempty"`
// contains filtered or unexported fields
}
func (Key) Reportable ¶
type Painter ¶
type Painter struct{ On bool }
Painter adds ANSI colors when On. Padding is applied before coloring so escape codes never break column alignment.