Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(github): read github.com-<name> SSH aliases through github.com #22246

Mergedmatthias-scale(GitHub profile, opens in a new tab)merged 11 commits intomain fromrefs/pull/22246/headmerged by maria-rcks View on GitHub

Showing 4 changed files with 99 additions and 0 deletions (loading 2).

x
0 of 4 viewed, 4 left
96 additions and 0 deletionspackages/source-control-github/src/server/GitHubSourceControlProvider.test.tsModified
View file
@@ -288,6 +288,102 @@
assert.deepStrictEqual(paths, ["github.com repos/acme/web"]);
}).pipe(Effect.provide(layer));
});
+​
+ it.effect.each([
+ ["github", "git@github:acme/web.git"],
+ ["github.com-scale", "git@github.com-scale:acme/web.git"],
+ ["github.com-scale", "ssh://git@github.com-scale:22/acme/web.git"],
+ ] as const)("reads an SSH alias on %s through github.com (%s)", ([host, remoteUrl]) => {
+ const hosts: string[] = [];
+ const { layer } = harness({
+ remotes: remotesOutput(["origin", remoteUrl]),
+ api: {
+ rest: (input) =>
+ Effect.sync(() => {
+ hosts.push(`${input.host} ${input.path}`);
+ return restResponse({
+ full_name: "acme/web",
+ html_url: "https://github.com/acme/web",
+ ssh_url: "git@github.com:acme/web.git",
+ default_branch: "main",
+ });
+ }),
+ },
+ });
+ return Effect.gen(function* () {
+ const gh = yield* GitHubSourceControlProvider.make;
+ const resolveWebHost = gh.resolveRemoteWebHost;
+ assert.ok(resolveWebHost);