report

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const LastRuns = 8

LastRuns is how many runs each lamp shows.

Variables

This section is empty.

Functions

func FontCSS

func FontCSS() (template.CSS, error)

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 Write

func Write(dir string, b *Board) (string, error)

Write renders the board and one page per item into dir.

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.

func Build

func Build(store tag.Store, est *graph.Estate, drills []*drill.Drill, now time.Time) (*Board, error)

Build assembles the board from tags and the estate.

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.

func BuildJSON

func BuildJSON(res *run.Result, now time.Time, exit int) JSONResult

BuildJSON assembles the result. Lists used for issues and summaries carry no evidence values; only the full results list does.

type Pack

type Pack struct {
	Name          string
	Safeguards    []Safeguard
	Shown         []Safeguard
	NotApplicable []Safeguard
}

Pack groups safeguards. NotApplicable holds those whose latest verdict is N/A and which are not open, so the board can fold them away.

type Run

type Run struct {
	Verdict string
	Class   string
	Date    string
}

Run is one past verdict on a safeguard.

type Safeguard

type Safeguard struct {
	DrillID    string
	Rule       string
	Target     string
	Verdict    string
	State      string
	Lamp       string
	Label      string
	Owner      string
	Reason     string
	Severity   string
	Waived     bool
	Unverified bool
	Runs       []Run
	Chain      string
	Slug       string
}

Safeguard is one drill and target on the board.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL