Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions core/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,14 @@ func NewNodeInstance(nodeType string, parent NodeBaseInterface, parentId string,
// Pass 'validate' to the factory function
node, errs = factoryEntry.FactoryFn(nil, parent, parentId, nodeDef, validate, opts)
if len(errs) > 0 {
// If the factory failed to produce a node (or found errors), return them.
return nil, errs
if node == nil || !validate {
// factory failed to produce a node, or we're not in validation mode.
return nil, errs
}
// factory produced a valid node but found validation errors (eg group
// with sub-graph errors). We continue here so the parent graph
// at least can continue to register the node and report. All the
// validation errors are returned anyway, so nothing is lost.
}
} else {
return nil, []error{CreateErr(nil, nil, "unknown node type '%v'", nodeType)}
Expand Down Expand Up @@ -658,7 +664,7 @@ func NewNodeInstance(nodeType string, parent NodeBaseInterface, parentId string,
node.SetNodeType(nodeType)
node.SetName(factoryEntry.Name)
node.SetParent(parent)
return node, nil
return node, errs
}

func GlobFilter(path string, pattern []string) (bool, error) {
Expand Down
7 changes: 5 additions & 2 deletions nodes/group@v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@ func init() {
}
}

if len(collectedErrors) > 0 {
return nil, collectedErrors
if len(collectedErrors) > 0 && !validate {
// Return the collected errors instead of nil to prevent cascading
// validation errors where the group node is never registered in the
// parent graph, causing some ghost errors about missing nodes
return group, collectedErrors
}

return group, nil
Expand Down
Loading