Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(github): API requests use the proxy git has for the host #48252

Openrtio(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/48252/headopened View on GitHub

Showing 5 changed files with 133 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 0 deletionsdocs/user/source-control.mdModified
View file
@@ -19,6 +19,8 @@
​
> Note: Git `push` and `clone` still require Git SSH/HTTPS credentials on the server, separate from API tokens.
​
+> Note: A GitHub Enterprise host that is only reachable through a proxy uses the proxy Git is configured with for it, for example `git config --global http.https://github.example.com.proxy socks5h://localhost:8080`. HTTP(S) and SOCKS5 proxies work; T3 Code rereads the setting within 5 minutes.
+​
> Note: With several `gt` servers and no `fj` login, `owner/repo` and newly published repositories go to `gt`'s default server (`gt config set default_host https://your-server`). With several `gt` accounts on one server, pick one with `gt auth switch <user> --host https://your-server`. If an SSH remote uses a different host name than the server's web address, run `gt config set ssh_host <ssh-host> --host https://your-server`.
​
## Start, clone, or publish a project
131 additions and 0 deletionspackages/source-control-github/src/server/GitHubHttpClient.test.tsAdded
View file
@@ -0,0 +1,131 @@
+import { describe, expect, it } from "@effect/vitest";
+// @effect-diagnostics-next-line nodeBuiltinImport:off -- A real server answers the proxied request.
+import * as NodeHttp from "node:http";
+import * as NodeNet from "node:net";
+import * as Effect from "effect/Effect";
+import * as Layer from "effect/Layer";
+import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/http";
+import { VcsProcessExitError } from "@t3tools/contracts";
+import * as TestSourceControlHost from "@t3tools/source-control-testing/TestSourceControlHost";
+​
+import * as GitHubHttpClient from "./GitHubHttpClient.ts";
+​
+const listen = (server: NodeNet.Server) =>
+ Effect.acquireRelease(
+ Effect.promise(
+ () =>
+ new Promise<number>((resolve, reject) => {