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 ¶
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".
type LocalReport ¶
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.