MCPcopy Index your code
hub / github.com/github/github-mcp-server / getRESTClient

Function getRESTClient

e2e/e2e_test.go:64–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func getRESTClient(t *testing.T) *gogithub.Client {
65 // Get token and ensure Docker image is built
66 token := getE2EToken(t)
67
68 // Create a new GitHub client with the token
69 ghClient := gogithub.NewClient(nil).WithAuthToken(token)
70
71 if host := getE2EHost(); host != "" && host != "https://github.com" {
72 var err error
73 // Currently this works for GHEC because the API is exposed at the api subdomain and the path prefix
74 // but it would be preferable to extract the host parsing from the main server logic, and use it here.
75 ghClient, err = ghClient.WithEnterpriseURLs(host, host)
76 require.NoError(t, err, "expected to create GitHub client with host")
77 }
78
79 return ghClient
80}
81
82// waitForRateLimit checks the current rate limit and waits if necessary.
83// It ensures we have at least minRateLimitRemaining requests available before proceeding.

Callers 9

waitForRateLimitFunction · 0.85
TestGetMeFunction · 0.85
TestTagsFunction · 0.85
TestFileDeletionFunction · 0.85
TestDirectoryDeletionFunction · 0.85
TestAssignCopilotToIssueFunction · 0.85

Calls 2

getE2ETokenFunction · 0.85
getE2EHostFunction · 0.85

Tested by

no test coverage detected