Repository navigation
fix(switch): point Enterprise PR 404s at the API host setting - #4734
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
The remote branch of missing_enterprise_hostname also fires for an SSH alias on github.com, the #1790 setup the host selection comment above already calls out. ForgeKind::from_host classifies github-work as GitHub, so with origin = git@github-work:owner/repo.git and no forge.hostname, wt switch pr:<wrong number> now tells a github.com user to set an Enterprise API host. The 404 really is "no such PR", so the old hint was the right one there. Details are inline.
|
@worktrunk-bot please make this one hint, per
|
Semicolon-joined per writing-user-outputs, with gh auth login last as the command most readers need.
|
Done in 794cc67. The Enterprise 404 hint is now one line, with
CI, including |
When a GitHub Enterprise PR lookup has no selected API hostname, a 404 only points at
gh repo set-default. That can already be correct even thoughgh apiused its default host.For a 404 on an explicit Enterprise PR URL, when no API host was selected, the hint names the host for
gh auth loginand points toforge.hostnameif the API host differs. Short PR references keep the ordinary 404 hint because a Git remote can use an SSH alias. Host selection itself stays as in #4710 and #4722.Checked with the 107 switch PR integration tests, including the new URL, remote, and configured-host cases, and with rustfmt, all-target/all-feature Clippy, doctests, and documentation generation. The full pre-merge hook could not complete locally because
pre-commitandcargo instawere unavailable. The tests use a stubghand do not require an Enterprise account.Refs #4709
AI assistance was used for the patch and tests.
Review follow-up: the SSH alias and missing-login cases reproduced against the previous head. All 104 matching switch integration tests, all-target/all-feature Clippy, rustfmt, documentation generation, and doctests passed. The full local pre-merge hook still lacks
pre-commitandcargo insta.