-
Notifications
You must be signed in to change notification settings - Fork 235
Description
Description
Complete migration from deprecated map[string]any step manipulation functions to type-safe alternatives. The codebase has 1,074 usages of map[string]any across 184 files (42% of codebase), with typed alternatives already existing but marked deprecated.
Problem
Type assertions in step manipulation create runtime panic risks. Functions like ApplyActionPinToStep and ApplyActionPinsToSteps are marked deprecated but still in use. This prevents refactoring and reduces type safety.
Suggested Changes
Files to Update
pkg/workflow/action_pins.go:306-412(deprecated functions)- All call sites using deprecated functions
Migration Path
// ❌ CURRENT (deprecated)
func ApplyActionPinToStep(stepMap map[string]any, data *WorkflowData) map[string]any {
step, err := MapToStep(stepMap)
if err != nil {
return stepMap // Silently fails
}
pinnedStep := ApplyActionPinToTypedStep(step, data)
if pinnedStep == nil {
return stepMap
}
return pinnedStep.ToMap() // Converting back and forth
}
// ✅ ALREADY EXISTS - Typed version
func ApplyActionPinToTypedStep(step *WorkflowStep, data *WorkflowData) *WorkflowStep {
// Type-safe implementation
}Success Criteria
- Identify all usages of
ApplyActionPinToStep(deprecated) - Migrate call sites to use
ApplyActionPinToTypedStep - Identify all usages of
ApplyActionPinsToSteps(deprecated) - Migrate call sites to use
ApplyActionPinsToTypedSteps - Remove deprecated functions from
action_pins.go - Update all tests to use typed versions
- Verify no compilation errors
Benefits
- Eliminates runtime type assertion failures
- Improves compile-time type safety
- Removes deprecated code paths
- Reduces
map[string]anyusage by ~20 instances - Clearer API contracts
Impact
Foundational improvement for broader type safety initiative. Removes deprecated code and establishes pattern for future typing improvements.
Source
Extracted from Typist Analysis Discussion #12238
Priority
Medium - Removes deprecated code, improves type safety
Estimated Effort
Medium (2-3 days)
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 18, 2026, 9:08 PM UTC