recipe

package
v0.0.78 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecutionDigest added in v0.0.52

func ExecutionDigest(r Recipe) (string, error)

ExecutionDigest identifies the serialized pinned recipe, including expanded inline boundaries. Round-tripping first makes programmatic and loaded recipes agree on omitted fields and canonical execution quantities.

func GenerateSchemaString

func GenerateSchemaString() (string, error)

func HasExecutionConstraints added in v0.0.64

func HasExecutionConstraints(r Recipe) bool

HasExecutionConstraints excludes packages: local setup does not require a resource-admission runtime when there are no image/capacity declarations.

func HasExecutionNeeds added in v0.0.52

func HasExecutionNeeds(r Recipe) bool

HasExecutionNeeds includes inline-expanded nodes and state bodies. It does not inspect separately submitted child recipes.

func HasWorkspaces added in v0.0.54

func HasWorkspaces(r Recipe) bool

func PrintSchema

func PrintSchema()

func Validate

func Validate(recipex string) error

Types

type ActivityExecution

type ActivityExecution struct {
	Name      string // Activity name from YAML definition
	Status    string // Use string for flexibility
	StartTime time.Time
	EndTime   time.Time
	Duration  *time.Duration
	Result    map[string]interface{}
	Error     string
	Attempt   int

	ActivityID   string
	ActivityType string
}

ActivityExecution represents the execution state of an activity within a job

type ActivityStatus

type ActivityStatus string

ActivityStatus represents the execution status of an activity

const (
	ActivityStatusPending   ActivityStatus = "pending"
	ActivityStatusRunning   ActivityStatus = "running"
	ActivityStatusCompleted ActivityStatus = "completed"
	ActivityStatusFailed    ActivityStatus = "failed"
	ActivityStatusSkipped   ActivityStatus = "skipped"
)

type BaseVisitor

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

BaseVisitor provides default pass-through implementations Embed this to only override specific node types you care about

func (*BaseVisitor) ShouldTraverseSequenceChildren

func (b *BaseVisitor) ShouldTraverseSequenceChildren(node *NodeSequence, path []string) bool

Control methods default to true (always traverse)

func (*BaseVisitor) ShouldTraverseStateChildren

func (b *BaseVisitor) ShouldTraverseStateChildren(node *NodeState, path []string) bool

func (*BaseVisitor) VisitNodeChildGroup added in v0.0.24

func (b *BaseVisitor) VisitNodeChildGroup(node *NodeChildGroup, path []string) (Node, error)

func (*BaseVisitor) VisitNodeInclude added in v0.0.29

func (b *BaseVisitor) VisitNodeInclude(node *NodeInclude, path []string) (Node, error)

func (*BaseVisitor) VisitNodeOp

func (b *BaseVisitor) VisitNodeOp(node *NodeOp, path []string) (Node, error)

Leaf nodes - just return unchanged

func (*BaseVisitor) VisitNodeSequence

func (b *BaseVisitor) VisitNodeSequence(node *NodeSequence, path []string) (Node, error)

Container nodes - must traverse children

func (*BaseVisitor) VisitNodeShared

func (b *BaseVisitor) VisitNodeShared(node *NodeShared, path []string) (Node, error)

func (*BaseVisitor) VisitNodeState

func (b *BaseVisitor) VisitNodeState(node *NodeState, path []string) (Node, error)

func (*BaseVisitor) VisitRecipe

func (b *BaseVisitor) VisitRecipe(recipe *Recipe) (Recipe, error)

func (*BaseVisitor) VisitRecipeChildGroup added in v0.0.24

func (b *BaseVisitor) VisitRecipeChildGroup(node *RecipeChildGroup, path []string) (*RecipeChildGroup, error)

func (*BaseVisitor) VisitRecipeOp

func (b *BaseVisitor) VisitRecipeOp(node *RecipeOp, path []string) (*RecipeOp, error)

Root recipe nodes

func (*BaseVisitor) VisitRecipeSequence

func (b *BaseVisitor) VisitRecipeSequence(node *RecipeSequence, path []string) (*RecipeSequence, error)

func (*BaseVisitor) VisitRecipeState

func (b *BaseVisitor) VisitRecipeState(node *RecipeState, path []string) (*RecipeState, error)

type CatchClause added in v0.0.22

type CatchClause struct {
	ID       string                 `yaml:"id,omitempty" json:"id,omitempty"`
	When     cel.CELExpr            `yaml:"when,omitempty" json:"when,omitempty"`
	To       string                 `yaml:"to,omitempty" json:"to,omitempty"`
	Payload  map[string]interface{} `yaml:"payload,omitempty" json:"payload,omitempty"`
	Continue *CatchContinue         `yaml:"continue,omitempty" json:"continue,omitempty"`
	Fail     *CatchFail             `yaml:"fail,omitempty" json:"fail,omitempty"`
}

func (CatchClause) JSONSchema added in v0.0.22

func (CatchClause) JSONSchema() *jsonschema.Schema

func (*CatchClause) UnmarshalYAML added in v0.0.22

func (c *CatchClause) UnmarshalYAML(node *yamlv3.Node) error

func (CatchClause) Validate added in v0.0.22

func (c CatchClause) Validate() error

type CatchContinue added in v0.0.22

type CatchContinue struct {
	Outputs map[string]interface{} `yaml:"outputs,omitempty" json:"outputs,omitempty"`
}

type CatchFail added in v0.0.22

type CatchFail struct {
	Kind    string      `yaml:"kind,omitempty" json:"kind,omitempty"`
	Code    string      `yaml:"code,omitempty" json:"code,omitempty"`
	Message string      `yaml:"message,omitempty" json:"message,omitempty"`
	Cause   interface{} `yaml:"cause,omitempty" json:"cause,omitempty"`
}

type ChildGroupAggregate added in v0.0.24

type ChildGroupAggregate struct {
	Shape    interface{} `yaml:"shape,omitempty" json:"shape,omitempty"`
	Artifact interface{} `yaml:"artifact,omitempty" json:"artifact,omitempty"`
}

type ChildGroupArtifacts added in v0.0.24

type ChildGroupArtifacts struct {
	Use []interface{} `yaml:"use,omitempty" json:"use,omitempty"`
}

type ChildGroupChild added in v0.0.24

type ChildGroupChild struct {
	Key        interface{}            `yaml:"key,omitempty" json:"key,omitempty"`
	Recipe     interface{}            `yaml:"recipe,omitempty" json:"recipe,omitempty"`
	CellName   interface{}            `yaml:"cell_name,omitempty" json:"cell_name,omitempty"`
	Required   interface{}            `yaml:"required,omitempty" json:"required,omitempty"`
	When       interface{}            `yaml:"when,omitempty" json:"when,omitempty"`
	SkipReason interface{}            `yaml:"skip_reason,omitempty" json:"skip_reason,omitempty"`
	GitRef     interface{}            `yaml:"git_ref,omitempty" json:"git_ref,omitempty"`
	Inputs     map[string]interface{} `yaml:"inputs,omitempty" json:"inputs,omitempty"`
	Artifacts  []interface{}          `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
}

type ChildGroupData added in v0.0.24

type ChildGroupData struct {
	Mode         string              `yaml:"mode,omitempty" json:"mode,omitempty"`
	Children     []ChildGroupChild   `yaml:"children,omitempty" json:"children,omitempty"`
	ChildrenFrom interface{}         `yaml:"children_from,omitempty" json:"children_from,omitempty"`
	Child        *ChildGroupChild    `yaml:"child,omitempty" json:"child,omitempty"`
	Artifacts    ChildGroupArtifacts `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
	Aggregate    ChildGroupAggregate `yaml:"aggregate,omitempty" json:"aggregate,omitempty"`
}

ChildGroupData describes a first-class recipe node that fans out to child recipes. The compiler lowers this node to internal task-backed recipe ops.

type Duration

type Duration time.Duration

Duration wraps time.Duration to provide custom YAML marshaling/unmarshaling It serializes to/from human-readable strings like "1s", "500ms", "2m"

func (Duration) JSONSchema

func (d Duration) JSONSchema() *jsonschema.Schema

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

MarshalYAML converts Duration to a YAML string

func (Duration) String

func (d Duration) String() string

String implements the Stringer interface

func (Duration) ToDuration

func (d Duration) ToDuration() time.Duration

ToDuration converts to standard time.Duration

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML parses a YAML string into a Duration

type ExecutionNeedResources added in v0.0.52

type ExecutionNeedResources struct {
	CPU              any `yaml:"cpu,omitempty" json:"cpu,omitempty"`
	Memory           any `yaml:"memory,omitempty" json:"memory,omitempty"`
	EphemeralStorage any `yaml:"ephemeral-storage,omitempty" json:"ephemeral-storage,omitempty"`
}

type ExecutionNeeds added in v0.0.52

type ExecutionNeeds struct {
	Packages  []string               `yaml:"packages,omitempty" json:"packages,omitempty"`
	Resources ExecutionNeedResources `yaml:"resources,omitempty" json:"resources,omitempty"`
	Image     any                    `yaml:"image,omitempty" json:"image,omitempty"`
	Platform  any                    `yaml:"platform,omitempty" json:"platform,omitempty"`
}

ExecutionNeeds contains literal or templated node properties. Validation of resolved values uses the existing execution.Requirements model.

func (*ExecutionNeeds) UnmarshalYAML added in v0.0.52

func (n *ExecutionNeeds) UnmarshalYAML(node *yaml.Node) error

type ExtensionFunctionImport

type ExtensionFunctionImport struct {
	Selector string            `yaml:"selector"`
	Include  []string          `yaml:"include,omitempty"`
	Rename   map[string]string `yaml:"rename,omitempty"`
}

type ExtensionImports

type ExtensionImports struct {
	Functions []ExtensionFunctionImport `yaml:"functions,omitempty"`
}

type FailureKind added in v0.0.22

type FailureKind string
const (
	FailureKindTimeout      FailureKind = "timeout"
	FailureKindTaskError    FailureKind = "task_error"
	FailureKindSystemError  FailureKind = "system_error"
	FailureKindCancellation FailureKind = "cancellation"
	FailureKindUnknown      FailureKind = "unknown"
)

type FailureNode added in v0.0.22

type FailureNode struct {
	ID   string          `json:"id,omitempty"`
	Path string          `json:"path,omitempty"`
	Type FailureNodeType `json:"type"`
	Op   string          `json:"op,omitempty"`
}

type FailureNodeType added in v0.0.22

type FailureNodeType string
const (
	FailureNodeOp           FailureNodeType = "op"
	FailureNodeSequence     FailureNodeType = "sequence"
	FailureNodeStateMachine FailureNodeType = "state_machine"
	FailureNodeState        FailureNodeType = "state"
)

type FailureTask added in v0.0.22

type FailureTask struct {
	Status     string `json:"status,omitempty"`
	ExitCode   *int   `json:"exit_code,omitempty"`
	StderrTail string `json:"stderr_tail,omitempty"`
	StdoutTail string `json:"stdout_tail,omitempty"`
}

type FailureTiming added in v0.0.22

type FailureTiming struct {
	Timeout string `json:"timeout,omitempty"`
	Scope   string `json:"scope,omitempty"`
	After   string `json:"after,omitempty"`
}

type HashComputer

type HashComputer struct{}

HashComputer computes canonical hashes for recipes

func NewHashComputer

func NewHashComputer() *HashComputer

NewHashComputer creates a new hash computer

func (*HashComputer) ComputeRecipeHash

func (h *HashComputer) ComputeRecipeHash(recipe *Recipe) string

ComputeRecipeHash computes a deterministic hash of recipe content

type IncludeData added in v0.0.29

type IncludeData struct {
	Recipe string `yaml:"recipe" json:"recipe"`
}

func (*IncludeData) UnmarshalYAML added in v0.0.29

func (i *IncludeData) UnmarshalYAML(node *yamlv3.Node) error

type InitialTransitions

type InitialTransitions []Transition

InitialTransitions represents the transition block used to choose the first state. YAML supports:

  • `initial: state_name` (shorthand)
  • `initial: {to: state_name, when: ...}`
  • `initial: [{to: state_a, when: ...}, ...]`

func InitialState

func InitialState(stateName string) InitialTransitions

InitialState returns the shorthand initial transition to a named state.

func (InitialTransitions) JSONSchema

func (InitialTransitions) JSONSchema() *jsonschema.Schema

func (InitialTransitions) MarshalYAML

func (i InitialTransitions) MarshalYAML() (interface{}, error)

func (InitialTransitions) ShortcutState

func (i InitialTransitions) ShortcutState() (string, bool)

func (InitialTransitions) Transitions

func (i InitialTransitions) Transitions() []Transition

func (*InitialTransitions) UnmarshalYAML

func (i *InitialTransitions) UnmarshalYAML(node *yamlv3.Node) error

type InlineInclusionMetadata added in v0.0.29

type InlineInclusionMetadata struct {
	Execution         *execution.Requirements `yaml:"execution,omitempty" json:"execution,omitempty"`
	CallsitePath      string                  `yaml:"callsite_path,omitempty" json:"callsite_path,omitempty"`
	RecipeID          string                  `yaml:"recipe_id,omitempty" json:"recipe_id,omitempty"`
	RecipeVersion     string                  `yaml:"recipe_version,omitempty" json:"recipe_version,omitempty"`
	Source            RecipeSourceSnapshot    `yaml:"source,omitempty" json:"source,omitempty"`
	ContentSHA256     string                  `yaml:"content_sha256,omitempty" json:"content_sha256,omitempty"`
	ResolvedSelectors map[string]string       `yaml:"resolved_selectors,omitempty" json:"resolved_selectors,omitempty"`
}

type InputSchema

type InputSchema struct {
	Secret      bool        `yaml:"secret,omitempty"`
	ObjectType  string      `yaml:"object_type,omitempty"`
	Type        string      `yaml:"type,omitempty"`                                                // Type of the input (string, number, boolean, etc.)
	Description string      `yaml:"description,omitempty"`                                         // Description of the input
	Required    bool        `yaml:"required,omitempty"`                                            // Whether the input is required
	Default     interface{} `yaml:"default_value,omitempty" jsonschema:"oneof_type=string;number"` // Default value if not provided
}

InputSchema defines the schema for an input parameter

func (InputSchema) ValidateSecretDeclaration added in v0.0.67

func (def InputSchema) ValidateSecretDeclaration() error

ValidateSecretDeclaration checks the public default without resolving it.

type Job

type Job struct {
	ID            string
	RecipeName    string
	RecipeVersion string
	Status        JobStatus
	StartTime     time.Time
	EndTime       *time.Time
	UpdateTime    time.Time
	Input         map[string]interface{}
	Output        map[string]interface{}
	Error         string

	// Optional fields
	Duration     *time.Duration
	Inputs       map[string]interface{} // alias for Input
	Outputs      map[string]interface{} // alias for Output
	Activities   []*ActivityExecution
	WorkflowType string

	ExecutionInfo *WorkflowExecutionInfo
}

Job represents an execution instance of a recipe

type JobFilter

type JobFilter struct {
	RecipeName string
	Status     *JobStatus
	StartTime  *time.Time
	EndTime    *time.Time
	Limit      int
}

JobFilter represents filter criteria for listing jobs

type JobStatus

type JobStatus string

JobStatus represents the execution status of a job

const (
	JobStatusUnknown    JobStatus = "unknown"
	JobStatusRunning    JobStatus = "running"
	JobStatusCompleted  JobStatus = "completed"
	JobStatusFailed     JobStatus = "failed"
	JobStatusCanceled   JobStatus = "canceled"
	JobStatusTerminated JobStatus = "terminated"
)

type Node

type Node struct {
	NodeImpl
}

func (Node) GetMetadata

func (n Node) GetMetadata() NodeMetadata

func (Node) JSONSchema

func (Node) JSONSchema() *jsonschema.Schema

func (Node) MarshalYAML

func (n Node) MarshalYAML() (interface{}, error)

MarshalYAML ensures Node marshals to the same shape expected by UnmarshalYAML by delegating directly to the underlying concrete implementation.

func (*Node) UnmarshalYAML

func (n *Node) UnmarshalYAML(node *yamlv3.Node) error

type NodeChildGroup added in v0.0.24

type NodeChildGroup struct {
	NodeMetadata `yaml:",inline"`
	ChildGroup   ChildGroupData `yaml:"child_group" json:"child_group"`
}

func (*NodeChildGroup) GetMetadata added in v0.0.24

func (n *NodeChildGroup) GetMetadata() NodeMetadata

type NodeImpl

type NodeImpl interface {
	GetMetadata() NodeMetadata
	// contains filtered or unexported methods
}

type NodeInclude added in v0.0.29

type NodeInclude struct {
	NodeMetadata `yaml:",inline"`
	Include      IncludeData `yaml:"include" json:"include"`
}

func (*NodeInclude) GetMetadata added in v0.0.29

func (n *NodeInclude) GetMetadata() NodeMetadata

type NodeInternalMetadata added in v0.0.29

type NodeInternalMetadata struct {
	Inline               *InlineInclusionMetadata `yaml:"inline,omitempty" json:"inline,omitempty"`
	CompositeInputSchema map[string]InputSchema   `yaml:"composite_input_schema,omitempty" json:"composite_input_schema,omitempty"`
}

type NodeList

type NodeList []Node

type NodeMetadata

type NodeMetadata struct {
	Workspace      *WorkspaceSpec         `yaml:"workspace,omitempty" json:"workspace,omitempty"`
	ExecutionNeeds *ExecutionNeeds        `yaml:"execution_needs,omitempty" json:"execution_needs,omitempty"`
	ID             string                 `yaml:"id,omitempty"`
	Desc           string                 `yaml:"desc,omitempty"`
	Const          bool                   `yaml:"const,omitempty"`
	Timeout        Duration               `yaml:"timeout,omitempty"`
	Retry          *RetryPolicy           `yaml:"retry,omitempty"`
	Inputs         map[string]interface{} `yaml:"inputs,omitempty"`
	Vars           map[string]interface{} `yaml:"vars,omitempty"`
	Artifacts      map[string]interface{} `yaml:"artifacts,omitempty"`
	When           cel.CELExpr            `yaml:"when,omitempty"` // Conditional execution
	Catch          []CatchClause          `yaml:"catch,omitempty" json:"catch,omitempty"`
	Internal       *NodeInternalMetadata  `yaml:"__c2j_internal,omitempty" json:"__c2j_internal,omitempty" jsonschema:"-"`
}

type NodeOp

type NodeOp struct {
	NodeMetadata `yaml:",inline"`
	OpData       `yaml:",inline"`
}

func (*NodeOp) GetMetadata

func (n *NodeOp) GetMetadata() NodeMetadata

func (NodeOp) JSONSchema

func (NodeOp) JSONSchema() *jsonschema.Schema

type NodeSequence

type NodeSequence struct {
	NodeMetadata `yaml:",inline"`
	SequenceData `yaml:",inline"`
}

func (*NodeSequence) GetMetadata

func (n *NodeSequence) GetMetadata() NodeMetadata

type NodeShared

type NodeShared struct {
	Shared string `yaml:"shared"`
}

func (*NodeShared) GetMetadata

func (n *NodeShared) GetMetadata() NodeMetadata

type NodeState

type NodeState struct {
	NodeMetadata     `yaml:",inline"`
	StateMachineData `yaml:",inline"`
}

func (*NodeState) GetMetadata

func (n *NodeState) GetMetadata() NodeMetadata

type NodeVisitor

type NodeVisitor interface {
	// Root node visitors - return (replacement, error)
	VisitRecipe(recipe *Recipe) (Recipe, error)
	VisitRecipeOp(node *RecipeOp, path []string) (*RecipeOp, error)
	VisitRecipeSequence(node *RecipeSequence, path []string) (*RecipeSequence, error)
	VisitRecipeState(node *RecipeState, path []string) (*RecipeState, error)
	VisitRecipeChildGroup(node *RecipeChildGroup, path []string) (*RecipeChildGroup, error)

	// Intermediate node visitors - return (replacement, error)
	VisitNodeOp(node *NodeOp, path []string) (Node, error)
	VisitNodeChildGroup(node *NodeChildGroup, path []string) (Node, error)
	VisitNodeInclude(node *NodeInclude, path []string) (Node, error)
	VisitNodeShared(node *NodeShared, path []string) (Node, error)
	VisitNodeSequence(node *NodeSequence, path []string) (Node, error)
	VisitNodeState(node *NodeState, path []string) (Node, error)

	// Control whether to traverse children of container nodes
	ShouldTraverseSequenceChildren(node *NodeSequence, path []string) bool
	ShouldTraverseStateChildren(node *NodeState, path []string) bool
}

NodeVisitor defines the interface for visiting and transforming recipe node trees

type NodeWalker

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

NodeWalker orchestrates the traversal of a recipe tree

func NewNodeWalker

func NewNodeWalker(visitor NodeVisitor) *NodeWalker

NewNodeWalker creates a new walker with the given visitor

func (*NodeWalker) Walk

func (w *NodeWalker) Walk(recipe Recipe) (Recipe, error)

Walk traverses the entire recipe tree

func (*NodeWalker) WalkNode

func (w *NodeWalker) WalkNode(node Node, path []string) (Node, error)

WalkNode recursively processes intermediate nodes

type OpData

type OpData struct {
	Op string `yaml:"op"`
}

type Recipe

type Recipe struct {
	RecipeImpl
}

func LoadInternalRecipeFromReader added in v0.0.29

func LoadInternalRecipeFromReader(r io.Reader) (*Recipe, error)

func LoadInternalRecipeFromString added in v0.0.29

func LoadInternalRecipeFromString(data []byte) (*Recipe, error)

func LoadRecipeFromReader

func LoadRecipeFromReader(r io.Reader) (*Recipe, error)

func LoadRecipeFromString

func LoadRecipeFromString(data []byte) (*Recipe, error)

func (Recipe) GetMetdata

func (r Recipe) GetMetdata() RecipeMetadata

func (Recipe) JSONSchema

func (Recipe) JSONSchema() *jsonschema.Schema

func (*Recipe) MarshalYAML

func (n *Recipe) MarshalYAML() (interface{}, error)

func (*Recipe) UnmarshalYAML

func (n *Recipe) UnmarshalYAML(node *yamlv3.Node) error

type RecipeChildGroup added in v0.0.24

type RecipeChildGroup struct {
	RecipeMetadata `yaml:",inline" refer:"true"`
	ChildGroup     ChildGroupData `yaml:"child_group" json:"child_group"`
}

func (*RecipeChildGroup) GetMetadata added in v0.0.24

func (r *RecipeChildGroup) GetMetadata() RecipeMetadata

type RecipeFile

type RecipeFile struct {
	// Core identity
	ID          string
	Version     string
	Description string

	// File paths
	BasePath string // Directory containing the recipe

	// Content
	Recipe Recipe

	// Metadata
	Hash         string // Canonical hash of recipe content
	LastModified time.Time
}

Recipe represents a discovered recipe with its metadata

type RecipeImpl

type RecipeImpl interface {
	GetMetadata() RecipeMetadata
	// contains filtered or unexported methods
}

type RecipeManifest

type RecipeManifest struct {
	Recipe struct {
		Name        string `yaml:"name"`
		Version     string `yaml:"version"`
		Description string `yaml:"description"`
		Files       struct {
			Workflow   string `yaml:"workflow"`
			Activities string `yaml:"activities"`
			Agents     string `yaml:"agents"`
		} `yaml:"files"`
	} `yaml:"recipe"`
}

RecipeManifest represents the recipe.yaml structure

type RecipeMetadata

type RecipeMetadata struct {
	Execution    *execution.Requirements `yaml:"execution,omitempty" json:"execution,omitempty"`
	Version      string                  `yaml:"version"`
	NodeMetadata `yaml:",inline"`
	Defs         map[string]Node        `yaml:"defs,omitempty"`         // Shared node definitions
	InputSchema  map[string]InputSchema `yaml:"input_schema,omitempty"` // Optional schema for inputs
	Extensions   ExtensionImports       `yaml:"extensions,omitempty"`
}

func (RecipeMetadata) ValidateInputShapeAndFillDefaults

func (n RecipeMetadata) ValidateInputShapeAndFillDefaults(data map[string]interface{}) (map[string]interface{}, error)

type RecipeOp

type RecipeOp struct {
	RecipeMetadata `yaml:",inline" refer:"true"`
	OpData         `yaml:",inline" refer:"true"`
}

func (*RecipeOp) GetMetadata

func (r *RecipeOp) GetMetadata() RecipeMetadata

type RecipeProvider

type RecipeProvider interface {
	GetRecipe(name string) (*Recipe, error)
}

type RecipeSequence

type RecipeSequence struct {
	RecipeMetadata `yaml:",inline" refer:"true"`
	SequenceData   `yaml:",inline" refer:"true"`
}

func (*RecipeSequence) GetMetadata

func (r *RecipeSequence) GetMetadata() RecipeMetadata

type RecipeSourceSnapshot added in v0.0.29

type RecipeSourceSnapshot struct {
	SourceKind        string `yaml:"source_kind,omitempty" json:"source_kind,omitempty"`
	SubmittedSelector string `yaml:"submitted_selector,omitempty" json:"submitted_selector,omitempty"`
	ResolvedSelector  string `yaml:"resolved_selector,omitempty" json:"resolved_selector,omitempty"`
	ResolvedCommit    string `yaml:"resolved_commit,omitempty" json:"resolved_commit,omitempty"`
	ArtifactName      string `yaml:"artifact_name,omitempty" json:"artifact_name,omitempty"`
	WasAlreadyPinned  bool   `yaml:"was_already_pinned,omitempty" json:"was_already_pinned,omitempty"`
}

type RecipeState

type RecipeState struct {
	RecipeMetadata   `yaml:",inline" refer:"true"`
	StateMachineData `yaml:",inline" refer:"true"`
}

func (*RecipeState) GetMetadata

func (r *RecipeState) GetMetadata() RecipeMetadata

type RetryPolicy

type RetryPolicy = jobdb.RetryPolicy

type RuntimeFailure added in v0.0.22

type RuntimeFailure struct {
	Kind      FailureKind                    `json:"kind"`
	Code      string                         `json:"code,omitempty"`
	Message   string                         `json:"message"`
	Retryable bool                           `json:"retryable"`
	Node      FailureNode                    `json:"node"`
	Timing    *FailureTiming                 `json:"timing,omitempty"`
	Task      *FailureTask                   `json:"task,omitempty"`
	Artifacts map[string]recipeartifacts.Ref `json:"artifacts,omitempty"`
	Attrs     map[string]interface{}         `json:"attrs,omitempty"`
	Cause     *RuntimeFailure                `json:"cause,omitempty"`
}

func (*RuntimeFailure) Clone added in v0.0.22

func (f *RuntimeFailure) Clone() *RuntimeFailure

type SequenceData

type SequenceData struct {
	Sequence NodeList               `yaml:"sequence"`
	Outputs  map[string]interface{} `yaml:"outputs,omitempty"`
}

type SharedNodeResolver

type SharedNodeResolver struct {
	BaseVisitor // Embed to get default implementations
	// contains filtered or unexported fields
}

SharedNodeResolver resolves SharedNode references to their definitions

func NewSharedNodeResolver

func NewSharedNodeResolver(defs map[string]Node) *SharedNodeResolver

NewSharedNodeResolver creates a resolver with the given definitions

func (*SharedNodeResolver) VisitNodeShared

func (r *SharedNodeResolver) VisitNodeShared(node *NodeShared, path []string) (Node, error)

VisitNodeShared resolves shared node references

type SingleStateMetadata

type SingleStateMetadata struct {
	Transitions []Transition `yaml:"transitions,omitempty" json:"transitions,omitempty"`
}

type State

type State struct {
	Node                `yaml:",inline"`
	SingleStateMetadata `yaml:",inline"`
}

State represents a state in a state machine A state is a node plus transition information

func (State) MarshalYAML

func (s State) MarshalYAML() (interface{}, error)

MarshalYAML customizes encoding so state-only fields (like transitions) are preserved alongside the inline node fields.

func (*State) UnmarshalYAML

func (s *State) UnmarshalYAML(node *yamlv3.Node) error

UnmarshalYAML customizes decoding so state-only fields (like transitions) don't get swallowed by the inline Node's UnmarshalYAML implementation.

type StateMachineData

type StateMachineData struct {
	States  *StateMap              `yaml:"state,omitempty"`
	Outputs map[string]interface{} `yaml:"outputs,omitempty"`
}

type StateMap

type StateMap struct {
	Initial InitialTransitions `yaml:"initial" validate:"required"` // State selector transitions (string is supported as shorthand)
	States  map[string]State   `yaml:"states"`                      // Inline the states
}

StateMap represents a state machine configuration

type Transition

type Transition struct {
	To      string                 `yaml:"to"`
	When    cel.CELExpr            `yaml:"when,omitempty"` // CEL expression
	Payload map[string]interface{} `yaml:"payload,omitempty"`
}

Transition represents a state transition

func (Transition) JSONSchema

func (Transition) JSONSchema() *jsonschema.Schema

func (*Transition) UnmarshalYAML

func (t *Transition) UnmarshalYAML(node *yamlv3.Node) error

type WorkerStatus

type WorkerStatus string

WorkerStatus represents the status of a recipe's worker

const (
	WorkerStatusRunning  WorkerStatus = "running"
	WorkerStatusStopped  WorkerStatus = "stopped"
	WorkerStatusFailed   WorkerStatus = "failed"
	WorkerStatusStarting WorkerStatus = "starting"
)

type WorkflowExecutionInfo

type WorkflowExecutionInfo struct {
	JobId string
}

WorkflowExecutionInfo contains job info

type WorkspaceSpec added in v0.0.54

type WorkspaceSpec struct {
	Cell string `yaml:"cell" json:"cell"`
	Ref  string `yaml:"ref,omitempty" json:"ref,omitempty"`
}

WorkspaceSpec starts an isolated, durable workspace for a node invocation.

func (WorkspaceSpec) JSONSchema added in v0.0.54

func (WorkspaceSpec) JSONSchema() *jsonschema.Schema

func (*WorkspaceSpec) UnmarshalYAML added in v0.0.54

func (s *WorkspaceSpec) UnmarshalYAML(n *yaml.Node) error

Jump to

Keyboard shortcuts

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