Repository navigation
Commit fff9965
committed
Refactor: Extract shared completion check loop logic to reduce duplication
The completion check loop logic (~155 lines) was duplicated between worker
steps (runStepLifecycle) and subworkflow steps (runSubworkflowStepLifecycle).
Both blocks handled: CHECKING status transition, running the check, convergence
guards, infrastructure failure detection, iteration limits, etc.
This creates maintenance risk where bug fixes would need to be applied to both
copies. The refactoring extracts the shared logic into runCompletionCheckLoop()
helper method that accepts an optional pre/post-check callback for output
collection (the only difference between the two paths).
The helper returns a union type indicating the outcome, allowing callers to
handle terminal states (succeeded/failed/incomplete/aborted) or continue
the iteration loop.1 parent 655fb7f commit fff9965
1 file changed
Lines changed: 196 additions & 308 deletions
0 commit comments