Skip to content

Conversation

tonytrg
Copy link
Contributor

@tonytrg tonytrg commented Oct 14, 2025

Fixes issues in GHES when subdomain isolation is enabled.

PR introduces:

  • raw api probe to detect subdomain isolation
    • changes url format for affected urls in func newGHESHost(hostname string) (apiHost, error)
  • changes the return message of get_file_contents to return better fallback message
    • better context for llm

Closes:

@tonytrg tonytrg force-pushed the tonytrg/fix-subdomain branch from f312b18 to e6fa90d Compare October 14, 2025 14:56
@tonytrg tonytrg marked this pull request as ready for review October 14, 2025 15:26
@tonytrg tonytrg requested a review from a team as a code owner October 14, 2025 15:26
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 15:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes URL parsing for GitHub Enterprise Server (GUES) instances with subdomain isolation enabled. The fix addresses issues where the server was incorrectly constructing URLs for raw content and upload APIs when subdomain isolation was configured.

  • Adds automatic detection of subdomain isolation by probing the raw subdomain endpoint
  • Updates URL construction logic to use subdomain-based URLs when isolation is detected
  • Improves error messages to provide better context when raw API calls fail

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/ghmcp/server.go Implements subdomain isolation detection and conditional URL formatting logic
pkg/github/repositories.go Captures raw API response codes and improves error messaging for better debugging context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nasxisbest
Copy link

nasxisbest commented Oct 14, 2025

Great work, thank you! Love the new feedback for LLMs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants