Skip to content

fix(shared): accept Enterprise Cloud pull request URLs - #16092

Closed
rahul05ranjan wants to merge 1 commit into
pingdotgg:mainfrom
rahul05ranjan:fix/github-enterprise-cloud-pr-urls
Closed

rahul05ranjan wants to merge 1 commit into
pingdotgg:mainfrom
rahul05ranjan:fix/github-enterprise-cloud-pr-urls

Conversation

@rahul05ranjan

Copy link
Copy Markdown

Problem

A PR URL such as https://my-awesome-company.ghe.com/platform/api/pull/9 is rejected by link_pull_request, even though the same PR can be linked by passing its host, repository and number separately. The other PR tools share the same URL parser.

Change

Recognize ghe.com and its subdomains alongside the existing GitHub host patterns. PR parsing and issue-reference conversion now use the same hostname check, so links, sibling PR URLs and autolinks agree on Enterprise Cloud URLs.

Scope and approval

Fixes #16070. This is a small fix to the existing GitHub URL support, using the domain identified in the triage. It does not infer GitHub from an arbitrary hostname or change remote discovery.

Verification

The URL-parser test file passes all 33 tests. The three new Enterprise Cloud regressions fail on the original code and pass with this change; the domain-guard case also passes. A direct Node check confirms the reported URL parses correctly.

I ran these with an existing Vitest 4.1.5 installation, aliasing vite-plus/test to Vitest. Focused ESLint checks, formatting at the repository's 100-column width, and git diff --check pass. I could not complete the repository's Vite+ install because its package downloads stalled, so its own runner and typecheck remain unverified locally.

Model/harness: GPT-6 / Codex.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 5, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 8f7f5b3

Macroscope's review found this PR approvable — This is a focused, backward-compatible fix that extends existing pull-request URL parsing to GitHub Enterprise Cloud hosts. It includes targeted regression coverage and does not alter schemas, deployment, defaults, or security-sensitive behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 622b7539-e369-4a74-9436-169372c590a4
📥 Commits

Reviewing files that changed from the base of the PR and between 1604ccc and 8f7f5b3.

📒 Files selected for processing (2)
  • packages/shared/src/changeRequestUrl.test.ts
  • packages/shared/src/changeRequestUrl.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

GitHub pull-request parsing and issue-reference candidate conversion now accept hosts under ghe.com. Tests cover pull-request URLs with trailing paths and query strings, issue-autolink conversion, sibling URL generation, and rejection of invalid hostnames.

Changes

GitHub Enterprise Cloud URL support

Layer / File(s) Summary
Host recognition and URL handling
packages/shared/src/changeRequestUrl.ts, packages/shared/src/changeRequestUrl.test.ts
A shared host predicate recognizes hosts under github.com and ghe.com. Pull-request parsing and issue-reference candidate conversion use it. Tests cover GHE URL handling and reject notghe.com and ghe.com.example.test.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: 🔵 Low · up to 8f7f5

Custom-host Enterprise Server users cannot link a PR using the full URL, but can use the separate host, repository, and number fields. The limitation is bounded; the change is mergeable with owner awareness.

Architecture Summary

Architecture risk: 🟡 Medium · up to 8f7f5

The change affects 1 system.

Changed systems: packages/shared

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/shared (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/shared/src/changeRequestUrl.test.ts: Added test expectations for parsing a GitHub Enterprise Cloud PR URL with a trailing /files segment and query string, converting an issue autolink to a PR candidate, and building a sibling PR URL.
  • observed — Modified behavior in packages/shared/src/changeRequestUrl.test.ts: Added test expectations that notghe.com and ghe.com.example.test hosts return null for PR parsing and issue-autolink conversion.
  • observed — Modified behavior in packages/shared/src/changeRequestUrl.ts: Added isGitHubHost, which recognizes hosts covered by github.com or ghe.com using isHostOf.
  • observed — Modified behavior in packages/shared/src/changeRequestUrl.ts: GitHub pull-request parsing now uses isGitHubHost, adding ghe.com hosts to the hosts accepted alongside the previously recognized GitHub forms.

Reliability and maintainability

  • inferred — Risk-relevant change factors for packages/shared: blast_radius_1; direct_dependents_1
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #16070 requires link_pull_request to accept URLs for any reachable GitHub host. The change adds *.ghe.com and reuses that check for parsing and autolink conversion. It does not accept a GitH… Extend URL recognition to cover reachable GitHub Enterprise hosts beyond *.ghe.com and hosts with a github label, or otherwise meet the issue’s stated acceptance criteria for unsupported hosts.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the change: accepting Enterprise Cloud pull-request URLs.
Description check ✅ Passed The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the fix, links the triaged issue, and reports focused test results and checks that remai…
Out of Scope Changes check ✅ Passed The hostname predicate and its tests directly support issue #16070. PR parsing, issue-reference conversion, sibling URL generation, and hostname rejection tests remain within that scope.
Full details: Linked Issues check

Explanation

Issue #16070 requires link_pull_request to accept URLs for any reachable GitHub host. The change adds *.ghe.com and reuses that check for parsing and autolink conversion. It does not accept a GitHub Enterprise host with an unrelated custom domain and no github hostname label. The *.ghe.com tests do not cover that requirement. The issue’s fallback applies only if support is limited to github.com; this change is not limited to github.com.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one appears to have been created with an older model (gpt-6). If this change is really important, we recommend rebuilding the PR with a newer model if possible.

@maria-rcks maria-rcks closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: link_pull_request rejects a PR URL on a GitHub Enterprise host

2 participants