feat(kanban): prevent child task dispatch when parent is not done#19743
Closed
SimbaKingjoe wants to merge 1 commit into
Closed
feat(kanban): prevent child task dispatch when parent is not done#19743SimbaKingjoe wants to merge 1 commit into
SimbaKingjoe wants to merge 1 commit into
Conversation
Add parent dependency guard to _set_status_direct so dragging a task to the ready column is rejected (409) when its parents are not all done. Previously the guard only existed in recompute_ready, allowing direct status writes via the dashboard API to bypass the dependency engine. Root cause: after reclaiming stale workers, both T3 and T4 were set to ready via dashboard status writes in quick succession, causing the writer to be spawned while the analyst was blocked — upstream work wasn't done yet.
Contributor
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.
What does this PR do?
Prevents child Kanban tasks from being dispatched before their parent tasks are done. Adds a parent dependency guard to the
_set_status_directfunction so that manually setting a task's status to "ready" via the dashboard API (drag-drop or explicit PATCH) is rejected with 409 when the task's parents are not all completed.Previously, the dependency guard only existed in
recompute_ready(which handles auto-promotion fromtodo→ready). Direct status writes via the dashboard API bypassed this check entirely, allowing the dispatcher to spawn a child task whose upstream work hadn't finished yet.Root cause example: After a dispatcher tick reclaimed stale workers and promoted tasks via
recompute_ready, subsequent dashboard status writes set both a child and its grandchild to "ready" in quick succession. The writer (grandchild) was spawned and ran while the analyst (child) was blocked — upstream research wasn't complete.Related Issue
Fixes #19746
Type of Change
Changes Made
plugins/kanban/dashboard/plugin_api.py— Added parent dependency check in_set_status_direct(): when transitioning to "ready", verify all parents are "done". ReturnsFalse(409) if not.tests/plugins/test_kanban_dashboard_plugin.py— Updatedtest_board_progress_rollupto complete the parent (triggerrecompute_ready) instead of manually forcing children to "ready". Rewrotetest_patch_drag_drop_move_todo_to_readyto verify both the rejection case (parent not done → 409) and the acceptance case (parent done → auto-promoted to ready).How to Test
parents=[parent_id]. Child starts astodo.PATCH /api/plugins/kanban/tasks/{child_id}with{"status":"ready"}→ expect 409 ConflictPATCH /api/plugins/kanban/tasks/{parent_id}with{"status":"done"}readybyrecompute_readypytest tests/plugins/test_kanban_dashboard_plugin.py -v— all 42 tests passChecklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping