registry

package
v2.22.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandResolution

func CommandResolution(ctx context.Context, s ir.Step) cmnvalue.CommandContext

CommandResolution returns command execution facts for command field resolution.

func IsExecutorRegistered

func IsExecutorRegistered(executorType string) bool

IsExecutorRegistered reports whether an executor type has registered metadata.

func RegisterExecutorCapabilities

func RegisterExecutorCapabilities(executorType string, caps ExecutorCapabilities)

RegisterExecutorCapabilities registers capabilities for an executor type.

func RegisterExecutorConfigSchema

func RegisterExecutorConfigSchema(executorType string, schema *jsonschema.Schema)

RegisterExecutorConfigSchema registers a JSON schema for an executor config. The schema is used to validate executor config at DAG parse time.

func RegisterStepValidator

func RegisterStepValidator(executorType string, validator StepValidator)

RegisterStepValidator registers a validator for an executor type.

func ScriptResolution

func ScriptResolution(ctx context.Context, s ir.Step) cmnvalue.CommandContext

ScriptResolution returns command execution facts for script field resolution.

func StepConfigWarnings

func StepConfigWarnings(s ir.Step) []string

StepConfigWarnings returns the configuration warnings the step's executor reports.

func UnregisterExecutorCapabilities

func UnregisterExecutorCapabilities(executorType string)

UnregisterExecutorCapabilities removes capabilities for an executor type.

func UnregisterStepValidator

func UnregisterStepValidator(executorType string)

UnregisterStepValidator removes the validator for an executor type.

func ValidateExecutorConfig

func ValidateExecutorConfig(executorType string, config map[string]any) error

ValidateExecutorConfig validates config against the registered schema. Returns nil if no schema is registered (backward compatible).

func ValidateStep

func ValidateStep(step ir.Step) error

ValidateStep runs the registered validator, if any.

Types

type ExecutorCapabilities

type ExecutorCapabilities struct {
	// Command indicates whether the executor supports the command field.
	Command bool
	// MultipleCommands indicates whether the executor supports multiple commands.
	MultipleCommands bool
	// Script indicates whether the executor supports the script field.
	Script bool
	// Shell indicates whether the executor uses shell/shellArgs/shellPackages.
	Shell bool
	// Stdin indicates whether the executor supports the stdin field for piping
	// a file's contents to the command's standard input.
	Stdin bool
	// Container indicates whether the executor supports step-level container config.
	Container bool
	// SubDAG indicates whether the executor can execute sub-DAGs.
	SubDAG bool
	// WorkerSelector indicates whether the executor supports worker selection.
	WorkerSelector bool
	// LLM indicates whether the executor supports the llm field.
	LLM bool
	// Messages indicates whether the executor takes the messages field and
	// requires at least one message when an llm config is present.
	Messages bool
	// CommandContext returns command execution facts for command field resolution.
	CommandContext func(ctx context.Context, step ir.Step) cmnvalue.CommandContext
	// ScriptContext returns command execution facts for script field resolution.
	ScriptContext func(ctx context.Context, step ir.Step) cmnvalue.CommandContext
	// DryRunCheck reports what a dry run can tell will fail on this host, such
	// as a file the step reads that does not exist, without running the step.
	// It receives the declared step with its with fields resolved as far as a
	// dry run can; a value that still holds a reference, such as a step
	// output, is left as written and the check must skip it. The error's text
	// is shown as a warning and never fails the dry run; several problems can
	// be joined into one error.
	DryRunCheck func(ctx context.Context, step ir.Step) error
	// ConfigWarnings reports settings in the step's configuration that are
	// valid but likely give results the author does not expect. Loading the
	// DAG shows each message as a warning. It also receives steps that fail
	// validation and need not report what validation already does.
	ConfigWarnings func(step ir.Step) []string
}

ExecutorCapabilities defines what an executor can do.

func ExecutorCapabilitiesFor

func ExecutorCapabilitiesFor(executorType string) ExecutorCapabilities

ExecutorCapabilitiesFor returns the registered capabilities for an executor type.

type StepValidator

type StepValidator func(step ir.Step) error

StepValidator validates an executor's step configuration.

Jump to

Keyboard shortcuts

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