fix(pr view): fetch nameWithOwner in headRepository GraphQL query

Commit dd424d85f added NameWithOwner to PRRepository for agent-task
listings but didn't update the headRepository GraphQL query to fetch it.
This caused gh pr view --json headRepository to emit an empty
"nameWithOwner":"" field, breaking the pr-create-respects-simple-
pushdefault acceptance test.

Fetch nameWithOwner in the query and update the test assertion to expect
it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Kynan Ware 2026-03-25 12:43:08 -06:00
parent be4960a255
commit 5ed8cf0faa
2 changed files with 2 additions and 2 deletions

View file

@ -31,4 +31,4 @@ stdout https://${GH_HOST}/${ORG}/${REPO}/pull/1
# Assert that the PR was created with the correct head repository and refs
exec gh pr view --json headRefName,headRepository,baseRefName,isCrossRepository
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${REPO_ID}","name":"${REPO}"},"isCrossRepository":false}
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${REPO_ID}","name":"${REPO}","nameWithOwner":"${ORG}/${REPO}"},"isCrossRepository":false}

View file

@ -387,7 +387,7 @@ func IssueGraphQL(fields []string) string {
case "headRepositoryOwner":
q = append(q, `headRepositoryOwner{id,login,...on User{name}}`)
case "headRepository":
q = append(q, `headRepository{id,name}`)
q = append(q, `headRepository{id,name,nameWithOwner}`)
case "assignees":
q = append(q, `assignees(first:100){nodes{id,login,name,databaseId},totalCount}`)
case "assignedActors":