Documentation
¶
Overview ¶
Package report writes the static HTML board, the JSON result and the step summary. The board needs no server, no account and no network.
Index ¶
- Constants
- func FontCSS() (template.CSS, error)
- func Summary(j JSONResult) string
- func Write(dir string, b *Board) (string, error)
- func WriteJSON(path string, j JSONResult) error
- type AttentionRow
- type Board
- type Counts
- type Finding
- type Item
- type ItemVerdict
- type JSONResult
- type Pack
- type Run
- type Safeguard
Constants ¶
const LastRuns = 8
LastRuns is how many runs each lamp shows.
Variables ¶
This section is empty.
Functions ¶
func FontCSS ¶
FontCSS returns @font-face rules with the embedded fonts inlined, for any page Firedrill writes.
func Summary ¶
func Summary(j JSONResult) string
Summary renders counts and what needs attention, with no evidence.
func WriteJSON ¶
func WriteJSON(path string, j JSONResult) error
WriteJSON stores the result in a file, never the CI log.
Types ¶
type AttentionRow ¶
type AttentionRow struct {
Kind, DrillID, Target, Class, Severity, Reason string
}
AttentionRow is one safeguard the board leads with: a change in the latest run, or one still open.
type Board ¶
type Board struct {
Generated string
Counts Counts
Attention []AttentionRow
Packs []Pack
Untouched []Item
Unowned []Item
Items []Item
Fonts template.CSS
}
Board is everything the templates need.
type Counts ¶
type Counts struct {
Open, Closed, Unknown, Retired, Pass, Fail, Warn, NA, Skip, Error, Total int
}
Counts summarizes the latest verdicts and states.
type Finding ¶
type Finding struct {
Drill string `json:"drill"`
Target string `json:"target"`
Severity string `json:"severity"`
Verdict string `json:"verdict"`
State string `json:"state"`
Owner string `json:"owner,omitempty"`
Reason string `json:"reason,omitempty"`
Waived bool `json:"waived,omitempty"`
Failing []string `json:"failing_conditions,omitempty"`
Fix string `json:"fix,omitempty"`
Unverified string `json:"unverified,omitempty"`
Retired string `json:"retired,omitempty"`
Facts any `json:"facts,omitempty"`
}
Finding is an entry for scripts in the JSON result.
type Item ¶
type Item struct {
ID string
Kind string
Name string
Live bool
Slug string
Verdicts []ItemVerdict
Seen string
}
Item is one thing in the estate.
type ItemVerdict ¶
type ItemVerdict struct {
DrillID, Target, Verdict, Class, Date string
}
ItemVerdict is one verdict that read an item.
type JSONResult ¶
type JSONResult struct {
Time time.Time `json:"time"`
Stream string `json:"stream"`
DefaultOwner string `json:"default_owner,omitempty"`
Results []Finding `json:"results"`
NewlyOpen []Finding `json:"newly_open"`
NewlyClosed []Finding `json:"newly_closed"`
OpenUnverified []Finding `json:"open_unverified"`
ClosedUnverified []Finding `json:"closed_unverified"`
Retired []Finding `json:"retired"`
Skips []string `json:"waiting"`
ExitCode int `json:"exit_code"`
}
JSONResult is the full result for scripts.
type Pack ¶
Pack groups safeguards. NotApplicable holds those whose latest verdict is N/A and which are not open, so the board can fold them away.