dashboard

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MPL-2.0 Imports: 20 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 dashboard holds what the dashboard shows, shared by the self-hosted server and the local "bogform ui", so that both serve the same API to the same web page.

Index

Constants

View Source
const ReportFile = ".bogform-ci/report.json"

ReportFile is where "bogform ci" writes its report, relative to the configuration directory.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	// contains filtered or unexported fields
}

Local serves the dashboard's read-only API from report files on this computer, for "bogform ui".

func NewLocal

func NewLocal(roots []string, token string, assets fs.FS) *Local

NewLocal creates a local dashboard over the reports under roots. Every request must carry token, which the person gets in the address that "bogform ui" prints. assets is the built web page, or nil.

func (*Local) Handler

func (l *Local) Handler() http.Handler

Handler serves the API and the web page.

type LocalReport

type LocalReport struct {
	Path   string
	Report ci.Report
}

LocalReport is a report file that was found, and the run it describes.

func FindReports

func FindReports(roots []string) ([]LocalReport, []error)

FindReports searches roots for report files. Files that can't be read are skipped, and returned as problems, so that one broken file doesn't hide the rest.

type RepositoryOverview

type RepositoryOverview struct {
	Platform   string              `json:"platform"`
	Repository string              `json:"repository"`
	Workspaces []WorkspaceOverview `json:"workspaces"`
}

RepositoryOverview groups a repository's workspaces.

func GroupRepositories

func GroupRepositories(workspaces []WorkspaceOverview) []RepositoryOverview

GroupRepositories sorts workspaces into repositories, with failures first, then drift, then unapplied changes, so that what needs attention is at the top.

type Run

type Run struct {
	ID             int64       `json:"id"`
	WorkspaceID    int64       `json:"workspace_id"`
	Repository     string      `json:"repository,omitempty"`
	Directory      string      `json:"directory,omitempty"`
	WorkspaceName  string      `json:"workspace,omitempty"`
	Kind           string      `json:"kind"`
	Status         string      `json:"status"`
	Branch         string      `json:"branch"`
	Commit         string      `json:"commit"`
	PullRequest    string      `json:"pull_request,omitempty"`
	RunURL         string      `json:"run_url,omitempty"`
	BogformVersion string      `json:"bogform_version"`
	Counts         ci.Counts   `json:"counts"`
	Changes        []ci.Change `json:"changes,omitempty"`
	OutputsChanged []string    `json:"outputs_changed,omitempty"`
	Error          string      `json:"error,omitempty"`
	StartedAt      time.Time   `json:"started_at"`
	FinishedAt     time.Time   `json:"finished_at"`
}

Run is the record of one pipeline run.

type RunSummary

type RunSummary struct {
	ID          int64     `json:"id"`
	Status      string    `json:"status"`
	FinishedAt  time.Time `json:"finished_at"`
	PullRequest string    `json:"pull_request,omitempty"`
	Counts      ci.Counts `json:"counts"`
}

RunSummary is the gist of one run, for the overview.

type Workspace

type Workspace struct {
	ID           int64      `json:"id"`
	Platform     string     `json:"platform"`
	Repository   string     `json:"repository"`
	Directory    string     `json:"directory"`
	Name         string     `json:"workspace"`
	DefaultRef   string     `json:"default_ref,omitempty"`
	LastStatus   string     `json:"last_status"`
	LastKind     string     `json:"last_kind"`
	LastRunAt    time.Time  `json:"last_run_at"`
	LastApplyAt  *time.Time `json:"last_apply_at,omitempty"`
	DriftStatus  string     `json:"drift_status,omitempty"`
	DriftCheckAt *time.Time `json:"drift_checked_at,omitempty"`
}

Workspace is one configuration directory and workspace in one repository.

type WorkspaceOverview

type WorkspaceOverview struct {
	Workspace
	LastPlan  *RunSummary `json:"last_plan,omitempty"`
	LastApply *RunSummary `json:"last_apply,omitempty"`
	LastDrift *RunSummary `json:"last_drift,omitempty"`
	// OpenChanges are the changes in the latest plan, if it's newer than the latest apply.
	OpenChanges *ci.Counts `json:"open_changes,omitempty"`
	Severity    int        `json:"-"`
}

WorkspaceOverview is a workspace with its latest run of each kind.

func (*WorkspaceOverview) Classify

func (w *WorkspaceOverview) Classify()

Classify works out the workspace's open changes and how urgent it is.

Jump to

Keyboard shortcuts

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