test(worker-bottomup): end-to-end Phase 7 migration test (#62)#271
Merged
charlie83Gs merged 3 commits intomainfrom Apr 20, 2026
Merged
test(worker-bottomup): end-to-end Phase 7 migration test (#62)#271charlie83Gs merged 3 commits intomainfrom
charlie83Gs merged 3 commits intomainfrom
Conversation
The durable wrapper that composes the Phase 7 primitives with per-hop commits — so a worker crash mid-plan leaves earlier audit rows and flipped graph state persisted, and the next dispatch resumes from the last applied ``to_version`` via the idempotent-replay path in ``run_hop`` (``success`` / ``skipped`` audit rows short-circuit). The executor helper (``kt_db.migration_executor.execute_migration``) is a single-session composition of the same primitives; this workflow deliberately doesn't call it because single-session has no durability between hops — exactly the property the workflow layer exists to add. The orchestration body lives in a framework-agnostic helper (``run_graph_migration``) so integration tests hit it against a real session factory without Hatchet infrastructure. 7 tests cover: single/multi-hop success (proving audit rows commit mid-plan via fresh reads), mid-plan failure with correct ``last_applied`` stamping, re-migrate resume via idempotent replay (completed hops NOT re-invoked), unknown plugin failing cleanly without touching graph state, already-at-target no-op, and target-ahead plan trimming. Registered on the orchestrator worker and ``worker-all``.
Stitches the planner (plan_auto_dispatch) and the workflow body (run_graph_migration) together against a real DB — the closest integration test we can build without a live Hatchet worker. Covers the full round-trip: plugin at v2 + noop migration → planner finds the out-of-date v1 graph → workflow helper advances it → audit row lands as 'success' → planner returns empty on re-plan → second dispatch is a no-op. 5 assertion phases in one test, mirroring the production dispatch sequence. Paired with: * test_auto_dispatch.py — planner alone * test_graph_migration_workflow.py — workflow body alone * test_startup_auto_dispatch.py — dispatch loop alone Those isolate each component; this test proves they compose.
# Conflicts: # services/worker-bottomup/src/kt_worker_bottomup/workflows/graph_migration.py # services/worker-bottomup/tests/integration/test_graph_migration_workflow.py
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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
Stitches the planner (`plan_auto_dispatch`) and the workflow body
(`run_graph_migration`) together against a real DB — the closest
integration test we can build without spinning up a live Hatchet worker.
Covers the full round-trip in one test, mirroring the production
dispatch sequence:
Relationship to other Phase 7 tests
Each file isolates one component; this one proves they work together.
Base branch
Based on `feat/graph-migration-workflow` (PR #267) since the test
imports `run_graph_migration` from that branch. Will rebase onto
`main` automatically once #267 merges.
Test plan
🤖 Generated with Claude Code