Skip to content

[Code Quality] Add Unwrap() to WorkflowValidationError to fix error chain traversal #45402

Description

@github-actions

Description

WorkflowValidationError is a custom error type in pkg/compiler/compiler_filters_validation.go that does not implement Unwrap(). This prevents errors.Is and errors.As from traversing the error chain, breaking standard Go error inspection patterns.

Additionally, compiler_orchestrator_engine.go line 245 uses fmt.Errorf without %w, silently dropping the wrapped error from the chain.

Suggested Changes

  • Add Unwrap() error method to WorkflowValidationError in compiler_filters_validation.go
  • Fix fmt.Errorf call at compiler_orchestrator_engine.go:245 to use %w verb
  • Verify existing tests still pass; add a test asserting errors.Is traversal works through WorkflowValidationError

Files Affected

  • pkg/compiler/compiler_filters_validation.go (add Unwrap() method)
  • pkg/compiler/compiler_orchestrator_engine.go line 245 (add %w)
  • pkg/compiler/compiler_filters_validation_test.go (add error chain test)

Success Criteria

  • errors.Is(wrappedErr, target) correctly traverses WorkflowValidationError
  • No fmt.Errorf calls without %w in compiler_orchestrator_engine.go
  • All existing tests pass

Source

Extracted from Daily Compiler Code Quality Report #45370

Priority

Medium — Broken error chains affect debugging and error handling correctness

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 205.3 AIC · ⌖ 5.26 AIC · ⊞ 7K ·

  • expires on Jul 14, 2026, 11:37 PM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions