Skip to content

refactor: split workflows/tracker.py into package#95

Merged
pratyush618 merged 1 commit intomasterfrom
refactor/tracker-package-split
May 1, 2026
Merged

refactor: split workflows/tracker.py into package#95
pratyush618 merged 1 commit intomasterfrom
refactor/tracker-package-split

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

  • Convert flat workflows/tracker.py (875 lines) into a workflows/tracker/ package
  • WorkflowTracker stays as the orchestrator; concern-specific helpers are free functions taking the tracker as the first argument
  • Largest file in the new package: tracker.py at 403 lines

What moved where

  • tracker/tracker.pyWorkflowTracker class (init, listeners, register_run, _handle dispatcher, lifecycle, gate resolve, child workflow listener, _fetch_result, _compute_result_hash)
  • tracker/dag.py — DAG helpers (build_dag_maps, should_execute, skip_and_propagate, all_predecessors_terminal, get_predecessor_statuses, build_workflow_context, create_deferred_job_for_node, final_state_to_event, int_or)
  • tracker/gates.pyenter_gate, on_gate_timeout
  • tracker/sub_workflows.pysubmit_sub_workflow
  • tracker/fan_out.pymaybe_trigger_fan_out, expand_fan_out, handle_fan_out_child, handle_fan_out_child_failure, create_fan_in_job
  • tracker/types.py_RunConfig dataclass

Test plan

  • uv run ruff check py_src/
  • uv run mypy py_src/taskito/ --no-incremental
  • uv run python -m pytest tests/python/test_workflow* -v — 75 passed
  • uv run python -m pytest tests/python/ -v — 465 passed, 9 skipped
  • Public API of WorkflowTracker unchanged: register_wait, unregister_wait, register_run, resolve_gate
  • from taskito.workflows.tracker import WorkflowTracker keeps working via package __init__.py

Move dag/gate/sub-workflow/fan-out helpers out of the 875-line
WorkflowTracker class into focused modules. Tracker stays the
orchestrator; helpers are free functions taking the tracker as the
first argument. No behavior changes.
@pratyush618 pratyush618 merged commit cd2a06b into master May 1, 2026
19 checks passed
@pratyush618 pratyush618 deleted the refactor/tracker-package-split branch May 2, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant