reporting

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package reporting renders a concise, machine- and human-readable summary of a runiac run (per-step status, errors, and terraform plan changes) so results can be surfaced without scrolling the full logs.

Index

Constants

View Source
const OutputDirEnv = "RUNIAC_OUTPUT_DIR"

OutputDirEnv, when set, is the directory the JSON and Markdown reports are written to. When unset, reporting only returns the Markdown for echoing and writes no files (keeps the default behaviour side-effect free).

Variables

This section is empty.

Functions

func SortSteps

func SortSteps(steps []StepReport)

SortSteps orders steps deterministically (track, step, region) for stable output.

func Write

func Write(fs afero.Fs, log *logrus.Entry, report RunReport) string

Write renders the Markdown summary and, when OutputDirEnv is set, also writes summary.json and summary.md to that directory. It is best-effort: any IO error is logged and swallowed so reporting never changes the run's outcome. The Markdown is always returned so the caller can echo it to stdout.

Types

type RunReport

type RunReport struct {
	Result        string       `json:"result"`
	Message       string       `json:"message"`
	ExecutedSteps int          `json:"executed_steps"`
	TotalSteps    int          `json:"total_steps"`
	FailedSteps   []string     `json:"failed_steps,omitempty"`
	SkippedSteps  []string     `json:"skipped_steps,omitempty"`
	Steps         []StepReport `json:"steps"`
}

RunReport is the full run summary.

type StepReport

type StepReport struct {
	Track            string              `json:"track"`
	Step             string              `json:"step"`
	Region           string              `json:"region"`
	RegionDeployType string              `json:"region_deploy_type"`
	Status           string              `json:"status"`
	Error            string              `json:"error,omitempty"`
	PlanChanges      map[string][]string `json:"plan_changes,omitempty"`
}

StepReport is the per-step result captured in the run report.

Jump to

Keyboard shortcuts

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