Skip to content

tech-debt(constants): enforce StatusEnum in orchestration production code — dag_executor.py + variable_resolver.py still use raw strings #3544

@mrveiss

Description

@mrveiss

Summary

Follow-on from #3533 (StatusEnum enforcement in tests). The production files that the tests cover still assign raw status strings instead of using TaskStatus enum values.

Files to fix

orchestration/dag_executor.py:

  • Line 357: ctx.status = "failed"
  • Line 364: ctx.status = "failed"
  • Line 382: ctx.status = "failed"
  • Line 386: ctx.status = "completed" if ctx.error is None else "partially_completed"

orchestration/variable_resolver.py:

  • Line 78: status = "completed" if result["success"] else "failed"

Fix

Import TaskStatus from constants.status_enums and replace each raw string:

ctx.status = TaskStatus.FAILED.value
ctx.status = TaskStatus.COMPLETED.value if ctx.error is None else "partially_completed"

Note: "partially_completed" has no enum member yet — either add PARTIALLY_COMPLETED to TaskStatus or leave that one as a raw string with a comment.

Why

If a status value is renamed in the enum, production code using raw strings diverges silently. Tests (now using .value) would catch it, but the underlying production code would still be wrong.

Discovered during code review of PR #3537 / issue #3533.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions