Documentation
¶
Overview ¶
Package report holds the result of a run as a tree — nodes, their hooks and attempts, container lanes — and writes it as JSON, JUnit XML, Markdown or plain text. It is pure data and formatting: the engine builds the tree from its events; this package never imports it.
Everything in a report is already masked by whoever built it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
WriteJSON writes r as indented JSON. Durations are written as milliseconds (duration_ms, grace_ms).
func WriteJUnit ¶
WriteJUnit writes r as JUnit XML. Statuses map as: failed → <failure>, error and aborted → <error>, skipped and cancelled → <skipped>. Handled failures pass, with their diagnostics in <system-err>.
func WriteMarkdown ¶
WriteMarkdown writes r as a Markdown summary (for digests, PR comments and CI job summaries).
Types ¶
type Abort ¶
type Abort struct {
Reason string `json:"reason"`
Grace time.Duration `json:"-"`
Inflight []string `json:"inflight"`
}
Abort says why a cancelled run was forced to stop.
type Attempt ¶
type Attempt struct {
N int `json:"n"`
Method string `json:"method"`
URL string `json:"url"`
Status int `json:"status,omitempty"`
Error string `json:"error,omitempty"`
Duration time.Duration `json:"-"`
}
Attempt is one HTTP attempt of a request.
func (Attempt) MarshalJSON ¶
MarshalJSON adds duration_ms.
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Severity string `json:"severity,omitempty"`
Message string `json:"message"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
}
Diagnostic is a diagnostic with its message already rendered.
type Hook ¶
type Hook struct {
Phase string `json:"phase"`
Level string `json:"level"`
Step string `json:"step"`
Index int `json:"index"`
Status string `json:"status"`
Duration time.Duration `json:"-"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
Nodes []Node `json:"nodes,omitempty"`
}
Hook is one API hook step of a request node.
type Node ¶
type Node struct {
Path string `json:"path"`
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name,omitempty"`
Status string `json:"status"`
Handled bool `json:"handled,omitempty"` // failed, but on_error let the run continue
Started time.Time `json:"started,omitzero"`
Duration time.Duration `json:"-"`
Outputs map[string]any `json:"outputs,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
Attempts []Attempt `json:"attempts,omitempty"`
Hooks []Hook `json:"hooks,omitempty"`
Lanes []Lane `json:"lanes,omitempty"`
}
Node is one node instance. Containers group their children in Lanes (batch iterations, parallel branches, the chosen condition branch).
type Run ¶
type Run struct {
ID string `json:"id"`
Kind string `json:"kind"` // "flow" or "send"
FlowID string `json:"flow_id,omitempty"`
FlowPath string `json:"flow_path,omitempty"`
FlowName string `json:"flow_name,omitempty"`
Collection string `json:"collection,omitempty"`
Env string `json:"env,omitempty"`
Status string `json:"status"`
Seed uint64 `json:"seed"`
Started time.Time `json:"started,omitzero"`
Duration time.Duration `json:"-"`
Nodes []Node `json:"nodes"`
Warnings []Diagnostic `json:"warnings,omitempty"`
Notes []Note `json:"notes,omitempty"`
Versions []VersionUse `json:"versions,omitempty"`
Aborted *Abort `json:"aborted,omitempty"`
}
Run is the report of one run (a flow run or a standalone send).