Skip to content

[Code Quality] Complete typed step migration and remove deprecated map[string]any functions #13788

@github-actions

Description

@github-actions

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]any usage 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions