fix(formula): address code review findings
Fixes from self-review of formula parser and bd cook: 1. Atomicity: Add cleanup on failure in cookFormula - if labels/deps transaction fails, delete the already-created issues 2. Validation: Add recursive depends_on validation for child steps and validate priority ranges for children 3. Documentation: Mark unimplemented fields (Expand, ExpandVars, Condition, Gate) with TODO(future) comments 4. Thread safety: Add note that Parser is NOT thread-safe 5. Error messages: Track first definition location for duplicate ID errors (e.g., "duplicate id at steps[1], first defined at steps[0]") 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,10 @@ import (
|
||||
const FormulaExt = ".formula.yaml"
|
||||
|
||||
// Parser handles loading and resolving formulas.
|
||||
//
|
||||
// NOTE: Parser is NOT thread-safe. Create a new Parser per goroutine or
|
||||
// synchronize access externally. The cache and resolving maps have no
|
||||
// internal synchronization.
|
||||
type Parser struct {
|
||||
// searchPaths are directories to search for formulas (in order).
|
||||
searchPaths []string
|
||||
|
||||
Reference in New Issue
Block a user