refactor: split workflows/tracker.py into package#95
Merged
pratyush618 merged 1 commit intomasterfrom May 1, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflows/tracker.py(875 lines) into aworkflows/tracker/packageWorkflowTrackerstays as the orchestrator; concern-specific helpers are free functions taking the tracker as the first argumenttracker.pyat 403 linesWhat moved where
tracker/tracker.py—WorkflowTrackerclass (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.py—enter_gate,on_gate_timeouttracker/sub_workflows.py—submit_sub_workflowtracker/fan_out.py—maybe_trigger_fan_out,expand_fan_out,handle_fan_out_child,handle_fan_out_child_failure,create_fan_in_jobtracker/types.py—_RunConfigdataclassTest plan
uv run ruff check py_src/uv run mypy py_src/taskito/ --no-incrementaluv run python -m pytest tests/python/test_workflow* -v— 75 passeduv run python -m pytest tests/python/ -v— 465 passed, 9 skippedWorkflowTrackerunchanged:register_wait,unregister_wait,register_run,resolve_gatefrom taskito.workflows.tracker import WorkflowTrackerkeeps working via package__init__.py