mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(gateway): root PR base resolves the project's env ladder, not literal master
A parentless root's PR base / merge target now resolves through resolve_parent_branch to the project's panel-configured head rung — submit_root passed a hardcoded 'master', which on a main-default repo made _ensure_base_on_remote silently create a spurious master branch and land the assembled root PR there. Literal master survives only as the no-project string-derivation fallback.
This commit is contained in:
@@ -363,6 +363,7 @@ async def test_runner_forwards_actor_agent_id_to_create_root_pr() -> None:
|
||||
task_svc.submit_for_review = AsyncMock(
|
||||
return_value=MagicMock(status="awaiting_pr_review")
|
||||
)
|
||||
task_svc.project_default_branch_for_task = AsyncMock(return_value="main")
|
||||
git_svc = AsyncMock()
|
||||
git_svc.create_pr = AsyncMock(return_value={"pr_number": 7})
|
||||
runner = VerbRunner(task_service=task_svc, git_service=git_svc)
|
||||
@@ -381,6 +382,9 @@ async def test_runner_forwards_actor_agent_id_to_create_root_pr() -> None:
|
||||
|
||||
assert git_svc.create_pr.call_args.kwargs.get("is_root_pr") is True
|
||||
assert git_svc.create_pr.call_args.kwargs.get("actor_agent_id") == agent.id
|
||||
assert git_svc.create_pr.call_args.kwargs.get("parent") == "main", (
|
||||
"root PR base must be the project's head rung, not a literal master"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user