Documentation
¶
Index ¶
- func ExpressionUsesOrderArtifacts(expression string) (bool, error)
- func ExpressionUsesOrderAssignees(expression string) (bool, error)
- func ExpressionUsesOrderComments(expression string) (bool, error)
- func ExpressionUsesOrderKey(expression string) (bool, error)
- func ExpressionUsesOrderPullRequests(expression string) (bool, error)
- func ExpressionUsesOrderSpec(expression string) (bool, error)
- func ExpressionUsesOrderURL(expression string) (bool, error)
- func ParseReferencedNodes(expression string) ([]string, error)
- func ValidateBareExpression(raw string, knownNodeNames map[string]struct{}) error
- func ValidateCanvasExpressions(reg *registry.Registry, nodes []models.Node) map[string][]ExpressionError
- func ValidateExpression(raw string, knownNodeNames map[string]struct{}) error
- func ValidateExpressionWithExtraEnv(raw string, knownNodeNames map[string]struct{}, extraEnv map[string]any) error
- type ExpressionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpressionUsesOrderArtifacts ¶
ExpressionUsesOrderArtifacts reports whether the expression accesses order().artifacts or task().artifacts (dot or bracket), including nested uses like none(order().artifacts, …). Used to lazy-load artifacts only when needed.
func ExpressionUsesOrderComments ¶
ExpressionUsesOrderComments reports whether the expression accesses order().comments or task().comments (dot or bracket), including nested uses like len(order().comments). Used to lazy-load comments only when needed.
func ExpressionUsesOrderKey ¶
ExpressionUsesOrderKey reports whether the expression accesses order().key or task().key (dot or bracket). Used to resolve the work order display key (e.g. "SUPER-70") only when needed, since it costs an extra lookup of the factory that owns the order.
func ExpressionUsesOrderSpec ¶
ExpressionUsesOrderSpec reports whether the expression accesses order().spec or task().spec (dot or bracket). Used to load the refinement spec only when the implement prompt asks for it.
func ExpressionUsesOrderURL ¶
ExpressionUsesOrderURL reports whether the expression accesses order().url or task().url (dot or bracket). Used to resolve the work order permalink only when needed, since it costs an extra lookup of the factory that owns the order.
func ParseReferencedNodes ¶
ParseReferencedNodes returns the names referenced via $['Name'] inside the given expression body, in source order.
func ValidateBareExpression ¶
ValidateBareExpression checks the same expression body but skips the strict compile-time identifier resolution. Use it for FieldTypeExpression values without {{ }} framing: at runtime those flow through as literal strings unless a component explicitly evaluates them, so identifiers like "default" or "ok" are valid literal payloads, while obvious syntax errors and unknown node references still need to be caught.
func ValidateCanvasExpressions ¶
func ValidateCanvasExpressions(reg *registry.Registry, nodes []models.Node) map[string][]ExpressionError
ValidateCanvasExpressions runs static expression validation across every node's configuration. Errors are returned per node ID; an empty result means nothing failed.
func ValidateExpression ¶
ValidateExpression checks a {{ ... }} placeholder body for syntax errors, unknown node references, function arity mistakes, and unresolved identifiers. Returns nil for a valid expression.
func ValidateExpressionWithExtraEnv ¶ added in v0.23.0
func ValidateExpressionWithExtraEnv(raw string, knownNodeNames map[string]struct{}, extraEnv map[string]any) error
ValidateExpressionWithExtraEnv validates an expression body using the default stub environment plus additional top-level variables provided in extraEnv.
Types ¶
type ExpressionError ¶
type ExpressionError struct {
NodeID string
NodeName string
FieldPath string
Expression string
Err error
}
ExpressionError describes a single static validation failure for one expression inside a node's configuration.
func (*ExpressionError) Error ¶
func (e *ExpressionError) Error() string