mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
active_task_owns_branch did an unscoped WHERE branch_name = ? — a cross-project branch_name collision (UUID-derived 8-char prefixes, theoretical) made the internal-PR reviewer skip the WRONG project's PR (project A's leftover PR skipped because project B happened to have an active task with the same branch). Pass project_id (in scope at the orchestrator call site) and add TaskTable.project_id == project_id to the WHERE. Correct for single-project tasks and MegaTask multi-repo batches alike: each root-subtask carries its own project_id matching its own repo, so a branch on project A's repo is owned only by a task whose project_id == A.