feat: add validation for default condition branch position and enhance branch connection handling

This commit is contained in:
mlogclub
2026-06-27 17:00:41 +08:00
parent f85fb6d406
commit 2143bfa06b
6 changed files with 432 additions and 110 deletions
@@ -310,6 +310,9 @@ func (v *definitionValidator) validateConditions() {
if branch.Condition != nil {
v.addError(branchField+".condition", "default condition branch must not define a condition")
}
if branchIndex != len(config.Branches)-1 {
v.addError(branchField, "default condition branch must be last")
}
continue
}
v.validateCondition(branchField+".condition", strings.TrimSpace(node.ID), branch.Condition)