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 ¶
const ( KindPipeline = "pipeline" KindDeploy = "deploy" )
Kinds of run a view can describe.
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 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.