Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(vcs): resolve SSH aliases before classifying GitHub hosts #7186

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

Showing 14 changed files with 92 additions and 4 deletions (loading 11).

x
0 of 14 viewed, 14 left
40 additions and 4 deletionsapps/server/src/project/RepositoryIdentityResolver.tsModified
View file
@@ -3,6 +3,7 @@
detectSourceControlProviderFromGitRemoteUrl,
normalizeGitRemoteUrl,
} from "@t3tools/shared/git";
+import { parseSshResolveOutput } from "@t3tools/ssh/command";
import * as Cache from "effect/Cache";
import * as Context from "effect/Context";
import * as Duration from "effect/Duration";
@@ -11,6 +12,7 @@
import * as Layer from "effect/Layer";
​
import * as ProcessRunner from "../processRunner.ts";
+import { resolveGitRemoteForSourceControl } from "../sourceControl/resolveGitRemoteForSourceControl.ts";
​
const DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY = 512;
const DEFAULT_POSITIVE_CACHE_TTL = Duration.minutes(1);
@@ -60,13 +62,39 @@
return remoteName && remoteUrl ? { remoteName, remoteUrl } : null;
​
+// This layer is provided in many tests without NodeServices. Resolve HostName
+// through ProcessRunner so SSH Effect services do not leak onto the service.
+function resolveSshHostnameWithProcessRunner(
+ processRunner: ProcessRunner.ProcessRunner["Service"],
+): (alias: string) => Effect.Effect<string | null> {
+ return (alias) =>
+ processRunner
+ .run({