Repository navigation
fix(mcp): accept GitHub Enterprise Cloud pull request URLs - #23521
vkpdeveloper wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This focused bug fix reuses the existing GitHub host classification to accept GitHub Enterprise Cloud pull-request URLs in established parsing and MCP flows. It preserves rejection of unrelated hosts and adds targeted coverage, with no product-default, schema, deployment, or static-analysis changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
GitHub Enterprise URL parsing tests packages/source-control-github/src/shared/definition.test.ts |
Tests cover lowercase and uppercase ghe.com hosts, host and repository normalization, and reference-autolink conversion. |
MCP handler tests and URL guidance apps/server/src/mcp/toolkits/pullRequests/tools.ts, apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts |
The invalid-URL message names host, repository, and number. Handler tests cover link, unlink, watch, and unwatch with a ghe.com URL, and verify that an FTP URL records no command. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested labels: bugfix
Suggested reviewers: juliusmarminge, maria-rcks
Merge Risk: 
Minimal · up to 46963
-
The change adds Enterprise URL coverage and clearer error guidance. No merge-blocking risk was identified.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#16070requires Enterprise-hosted pull-request URL support and a fallback that nameshost,repository, andnumber. At the reviewed head, the GitHub provider parses pull-request paths on Enterprise hosts and converts Enterprise issue autolinks. The added handler tests cover link, unlink, watch, and unwatch with*.ghe.comURLs.PullRequestUrlInvalidErrornow names all three explicit fields. No coding requirement remains unmet.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#16070. The diff adds Enterprise URL regression tests for the affected handlers and GitHub provider, and updates the invalid-URL guidance. These changes directly support Enterprise pull-request URL handling and do not add unrelated behavior.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Note Written by Verified in a real dev environmentVerified the current production change at On Nearby behavior passed through real MCP calls: the GitHub URL for this PR linked and displayed its title/number in the app; watch returned Blacksmith Not verifiedAuthenticated GitHub Enterprise Cloud access, a real Enterprise PR, and external watch notifications: no Enterprise account or PR was available. Current main already contains the Enterprise URL parser; the production diff in this head only improves the invalid-URL guidance, alongside regression tests. The old Enterprise parsing failure therefore cannot be reproduced on current main. Native Electron, iOS/Android, and remote/tunnel clients were not exercised on this Linux web pass. |



Problem
link_pull_request(and unlink/watch/unwatch) reject GitHub Enterprise Cloud URLs such ashttps://acme.ghe.com/owner/repo/pull/9.changeRequestUrl.tshas its own GitHub host check that misses*.ghe.com, althoughsourceControl.tsalready recognises it. The error message also doesn't mention thehostfield.Change
sourceControl.tsand use it inchangeRequestUrl.tsfor PR URLs and autolinks.host,repositoryandnumberwhen a URL isn't recognised./pull/path alone doesn't prove the host is GitHub.Scope and approval
Fixes #16070 (triaged bug).
Verification
changeRequestUrl.test.tsandhandlers.test.ts: all 7 fail without the fix (parse returns null, every tool raisesPullRequestUrlInvalidError) and pass with the fix.vp run check:changedpasses. 101 tests pass across the related shared and MCP test files.Code by gpt-6.1-sol (xhigh) in Codex CLI. PR description written with Claude Code (Opus 5.5).
🤖 Generated with Claude Code