execgraph

package
v3.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRanks

func AssignRanks(id string, depth int, nodes map[string]GraphNode, adj map[string]AdjacencyEntry)

func GetAllLogKeys

func GetAllLogKeys(node GraphNode) []string

GetAllLogKeys returns all log keys from executableResponses[0].

func GetLogKey

func GetLogKey(node GraphNode) string

GetLogKey returns the first log key for a node, for callers that only need one.

func HasLogs

func HasLogs(node GraphNode) bool

HasLogs reports whether the node has any log content to fetch.

func NodeName

func NodeName(node GraphNode) string

func ReUnmarshal

func ReUnmarshal[T any](data any) (T, error)

Types

type AdjacencyEntry

type AdjacencyEntry struct {
	Children []string `json:"children"`
	NextIDs  []string `json:"nextIds"`
}

type AsyncChainExecutableResponse

type AsyncChainExecutableResponse struct {
	CallbackID  string   `json:"callbackId"`
	CallbackIDs []string `json:"callbackIds"`
	ChainEnd    bool     `json:"chainEnd"`
	LogKeys     []string `json:"logKeys"`
	Units       []string `json:"units"`
	Status      string   `json:"status"`
	Timeout     int64    `json:"timeout,string"`
}

type AsyncExecutableResponse

type AsyncExecutableResponse struct {
	CallbackIDs                           []string `json:"callbackIds"`
	LogKeys                               []string `json:"logKeys"`
	Units                                 []string `json:"units"`
	Status                                string   `json:"status"`
	Timeout                               int64    `json:"timeout,string"`
	ShouldRemoveAlreadyProcessedNotifyIDs bool     `json:"shouldRemoveAlreadyProcessedNotifyIds"`
}

type ChildChainExecutableResponse

type ChildChainExecutableResponse struct {
	NextChildID     string `json:"nextChildId"`
	PreviousChildID string `json:"previousChildId"`
	LastLink        bool   `json:"lastLink"`
	Suspend         bool   `json:"suspend"`
}

type ChildExecutableResponse

type ChildExecutableResponse struct {
	ChildNodeID string   `json:"childNodeId"`
	Skip        bool     `json:"skip"`
	LogKeys     []string `json:"logKeys"`
	Units       []string `json:"units"`
}

type ChildPipelineExecutionDetails

type ChildPipelineExecutionDetails struct {
	PlanExecutionID string `json:"planExecutionId"`
	OrgID           string `json:"orgId"`
	ProjectID       string `json:"projectId"`
}

type ChildrenExecutableResponse

type ChildrenExecutableResponse struct {
	MaxConcurrency        int64    `json:"maxConcurrency,string"`
	ShouldProceedIfFailed bool     `json:"shouldProceedIfFailed"`
	LogKeys               []string `json:"logKeys"`
	Units                 []string `json:"units"`
}

type DelegateInfo

type DelegateInfo struct {
	Name string `json:"name"`
}

type ExecutableResponse

type ExecutableResponse struct {
	ResponseCase string                         `json:"responseCase"`
	Task         *TaskExecutableResponse        `json:"task"`
	TaskChain    *TaskChainExecutableResponse   `json:"taskChain"`
	Async        *AsyncExecutableResponse       `json:"async"`
	Sync         *SyncExecutableResponse        `json:"sync"`
	Child        *ChildExecutableResponse       `json:"child"`
	Children     *ChildrenExecutableResponse    `json:"children"`
	ChildChain   *ChildChainExecutableResponse  `json:"childChain"`
	AsyncChain   *AsyncChainExecutableResponse  `json:"asyncChain"`
	SkipTask     *SkipTaskExecutableResponse    `json:"skipTask"`
	Facilitator  *FacilitatorExecutableResponse `json:"facilitator"`
}

type ExecutionFull

type ExecutionFull struct {
	Graph          ExecutionGraph
	PipelineStatus string
	StartTs        int64
	EndTs          int64
}

func FetchExecutionFull

func FetchExecutionFull(ctx *cmdctx.Ctx, execId string) (ExecutionFull, error)

FetchExecutionFull fetches the execution graph and pipeline-level status in one call.

type ExecutionGraph

type ExecutionGraph struct {
	RootNodeID           string                    `json:"rootNodeId"`
	NodeMap              map[string]GraphNode      `json:"nodeMap"`
	NodeAdjacencyListMap map[string]AdjacencyEntry `json:"nodeAdjacencyListMap"`
}

func FetchExecutionGraph

func FetchExecutionGraph(ctx *cmdctx.Ctx, execId string) (ExecutionGraph, error)

type FacilitatorExecutableResponse

type FacilitatorExecutableResponse struct {
	Type             string   `json:"type"`
	Status           string   `json:"status"`
	StartTs          int64    `json:"startTs"`
	CallbackIDs      []string `json:"callbackIds"`
	TimeoutInSeconds int64    `json:"timeoutInSeconds"`
}

type FailureInfo

type FailureInfo struct {
	Message string `json:"message"`
}

type GraphNode

type GraphNode struct {
	UUID                string               `json:"uuid"`
	SetupID             string               `json:"setupId"`
	Identifier          string               `json:"identifier"`
	Name                string               `json:"name"`
	BaseFQN             string               `json:"baseFqn"`
	StepType            string               `json:"stepType"`
	Status              string               `json:"status"`
	LogBaseKey          string               `json:"logBaseKey"`
	StartTs             int64                `json:"startTs"`
	EndTs               int64                `json:"endTs"`
	DelegateInfoList    []DelegateInfo       `json:"delegateInfoList"`
	FailureInfo         FailureInfo          `json:"failureInfo"`
	StepDetails         StepDetails          `json:"stepDetails"`
	StepParameters      json.RawMessage      `json:"stepParameters"`
	Outcomes            map[string]any       `json:"outcomes"`
	ExecutableResponses []ExecutableResponse `json:"executableResponses"`

	Raw   json.RawMessage `json:"-"` // full wire JSON, populated by FetchExecutionGraph
	Rank  int             // computed, not from JSON
	Depth int             // computed, not from JSON
}

func WalkNodes

func WalkNodes(g ExecutionGraph, skipTypes map[string]bool) []GraphNode

WalkNodes traverses the execution graph in display order and returns a flat slice of GraphNode values with Depth set. Nodes whose StepType is in skipTypes are not included in the output but their children are still walked at the same depth.

func (GraphNode) ToMap

func (n GraphNode) ToMap() map[string]any

ToMap returns the full wire JSON of the node as a map, suitable for output rendering. Computed fields (Rank, Depth) are included. Callers may patch additional enrichments on top.

func (*GraphNode) UnmarshalJSON

func (n *GraphNode) UnmarshalJSON(data []byte) error

UnmarshalJSON captures the raw bytes for full-fidelity JSON output, then decodes the typed fields the CLI actually needs.

type LogUnit

type LogUnit struct {
	Key  string
	Unit string
}

LogUnit pairs a log service key with its human-readable section label.

func GetLogUnits

func GetLogUnits(node GraphNode) []LogUnit

GetLogUnits returns the ordered log units for a node, drawn from executableResponses[0] only (matching the web-UI behaviour). Units come from the parallel units[] array; if that is shorter than logKeys[], synthetic labels ("Section 1", "Section 2", …) are used for the remainder.

type SkipTaskExecutableResponse

type SkipTaskExecutableResponse struct {
	Message string `json:"message"`
}

type StepDetails

type StepDetails struct {
	ChildPipelineExecutionDetails ChildPipelineExecutionDetails `json:"childPipelineExecutionDetails"`
}

type SyncExecutableResponse

type SyncExecutableResponse struct {
	LogKeys []string `json:"logKeys"`
	Units   []string `json:"units"`
}

type TaskChainExecutableResponse

type TaskChainExecutableResponse struct {
	TaskID       string   `json:"taskId"`
	TaskName     string   `json:"taskName"`
	TaskCategory string   `json:"taskCategory"`
	ChainEnd     bool     `json:"chainEnd"`
	LogKeys      []string `json:"logKeys"`
	Units        []string `json:"units"`
}

type TaskExecutableResponse

type TaskExecutableResponse struct {
	TaskID       string   `json:"taskId"`
	TaskName     string   `json:"taskName"`
	TaskCategory string   `json:"taskCategory"`
	LogKeys      []string `json:"logKeys"`
	Units        []string `json:"units"`
}

Jump to

Keyboard shortcuts

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