runview

package
v1.5.16 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 5 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 runview is the one run, stage, step shape that deploys and pipelines both map to, so a single viewer can render either.

Index

Constants

View Source
const (
	KindPipeline = "pipeline"
	KindDeploy   = "deploy"
)

Kinds of run a view can describe.

View Source
const (
	CacheHit     = "hit"
	CachePartial = "partial"
	CacheMiss    = "miss"
	CacheUnknown = "unknown"
)

Cache states. Unknown never means miss.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildStage

type BuildStage struct {
	Stage       string
	Status      string
	StartedAt   time.Time
	EndedAt     *time.Time
	DurationMS  int64
	CacheState  string
	MissStep    string
	MissCause   string
	Vertices    int
	CachedCount int
}

BuildStage is the slice of a build stage the view needs; callers convert from the trace type so this package stays free of its dependents.

type Cache

type Cache struct {
	State     string `json:"state"`
	Key       string `json:"key,omitempty"`
	MissStep  string `json:"miss_step,omitempty"`
	MissCause string `json:"miss_cause,omitempty"`
	Vertices  int    `json:"vertices,omitempty"`
	Cached    int    `json:"cached,omitempty"`
}

Cache is the cache outcome of a stage.

type Node

type Node struct {
	ID  string `json:"id"`
	Why string `json:"why,omitempty"`
}

Node is where a stage ran and, when known, why it was placed there.

type Run

type Run struct {
	Kind       string     `json:"kind"`
	ID         string     `json:"id"`
	App        string     `json:"app"`
	Name       string     `json:"name,omitempty"`
	Status     string     `json:"status"`
	Reason     string     `json:"reason,omitempty"`
	StartedAt  *time.Time `json:"started_at,omitempty"`
	EndedAt    *time.Time `json:"ended_at,omitempty"`
	DurationMS int64      `json:"duration_ms"`
	Stages     []Stage    `json:"stages"`
}

Run is one pipeline run or one deploy attempt.

func FromDeploy

func FromDeploy(a store.DeployAttempt, stages []BuildStage, nodeID, why string, now time.Time) Run

FromDeploy maps a deploy attempt and its build stages to the shared shape. nodeID and why describe where the build ran and may be empty.

func FromPipeline

func FromPipeline(run store.PipelineRun, jobs []store.PipelineJob, now time.Time) Run

FromPipeline maps a stored pipeline run and its jobs to the shared shape. Each job becomes a stage; free text is masked before it leaves the store.

type Stage

type Stage struct {
	Key  string `json:"key"`
	Name string `json:"name"`
	// StageName is the pipeline stage group the job belongs to, empty without stages.
	StageName  string            `json:"stage,omitempty"`
	Status     string            `json:"status"`
	Reason     string            `json:"reason,omitempty"`
	Needs      []string          `json:"needs"`
	Matrix     map[string]string `json:"matrix,omitempty"`
	StartedAt  *time.Time        `json:"started_at,omitempty"`
	EndedAt    *time.Time        `json:"ended_at,omitempty"`
	DurationMS int64             `json:"duration_ms"`
	Cache      Cache             `json:"cache"`
	Node       *Node             `json:"node,omitempty"`
	Steps      []Step            `json:"steps"`
}

Stage is a pipeline job or a build stage.

type Step

type Step struct {
	Index      int        `json:"index"`
	Name       string     `json:"name"`
	Kind       string     `json:"kind,omitempty"`
	Status     string     `json:"status"`
	Reason     string     `json:"reason,omitempty"`
	ExitCode   *int       `json:"exit_code,omitempty"`
	StartedAt  *time.Time `json:"started_at,omitempty"`
	EndedAt    *time.Time `json:"ended_at,omitempty"`
	DurationMS int64      `json:"duration_ms"`
}

Step is one step of a pipeline job.

Jump to

Keyboard shortcuts

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