Summary
/land-and-deploy's fork-branch check (absorbed from #2725 in v1.78.0.0) resolves PR head ownership with:
gh pr view <N> --json headRepositoryOwner,headRepository,headRefName \
--jq '"\(.headRepositoryOwner.login)/\(.headRepository.name)\t\(.headRefName)"'
That fixed the empty-owner bug on gh 2.83 and is verified live for the common setups. The residual edge: when the local remote is an anonymous HTTPS URL (no owner segment inferable, or an ssh-vs-https shape mismatch against the composed owner/name), the string comparison between the composed head repo and the local remote can misread ownership — the skill could give fork guidance to a non-fork branch, or treat a fork branch as local.
Repro shape
- Clone via a mirror/proxy or credential-helper setup where
git remote get-url origin returns an anonymous HTTPS URL that does not textually contain owner/name in the expected position (e.g. a self-hosted mirror path, or https://github.com/OWNER/REPO vs the SSH remote form (ssh:// / scp-style) casing/format drift).
- Run
/land-and-deploy on a PR whose head repo IS the base repo.
- The ownership comparison misses and the skill walks the fork path (or vice versa).
Proposed fix
Resolve ownership canonically from the API instead of URL parsing: compare headRepository.nameWithOwner-composed identity against gh repo view --json nameWithOwner (the checkout's canonical repo), never against remote URL text. Touches the #2725 test pins, so it should be coordinated with that absorption's tests rather than hot-patched.
Why deferred
Decided at v1.78.0.0 ship time (wave PR #2752): the absorbed command is correct for every setup verified live; re-editing pinned community work at ship time for an unobserved edge adds churn. Filed instead with this repro shape.
Summary
/land-and-deploy's fork-branch check (absorbed from #2725 in v1.78.0.0) resolves PR head ownership with:That fixed the empty-owner bug on gh 2.83 and is verified live for the common setups. The residual edge: when the local remote is an anonymous HTTPS URL (no owner segment inferable, or an ssh-vs-https shape mismatch against the composed
owner/name), the string comparison between the composed head repo and the local remote can misread ownership — the skill could give fork guidance to a non-fork branch, or treat a fork branch as local.Repro shape
git remote get-url originreturns an anonymous HTTPS URL that does not textually containowner/namein the expected position (e.g. a self-hosted mirror path, orhttps://github.com/OWNER/REPOvs the SSH remote form (ssh:/// scp-style) casing/format drift)./land-and-deployon a PR whose head repo IS the base repo.Proposed fix
Resolve ownership canonically from the API instead of URL parsing: compare
headRepository.nameWithOwner-composed identity againstgh repo view --json nameWithOwner(the checkout's canonical repo), never against remote URL text. Touches the #2725 test pins, so it should be coordinated with that absorption's tests rather than hot-patched.Why deferred
Decided at v1.78.0.0 ship time (wave PR #2752): the absorbed command is correct for every setup verified live; re-editing pinned community work at ship time for an unobserved edge adds churn. Filed instead with this repro shape.