History

Use typed exit codes in VCS process results

- Switch VCS process and git driver results to `ChildProcessSpawner.ExitCode` - Update status checks and fallback results to use the new typed exit code - Refresh tests to match the new result shape

Julius Marminge committed 6 months ago

Commit 0587d8a1 parent 68df27e9 files · +62 −41Browse files

Unified · Split

9 files
  1. apps/server/src/git/GitManager.test.ts +6 −2
  2. apps/server/src/server.test.ts +2 −1
  3. apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts +2 −3
  4. apps/server/src/sourceControl/SourceControlProviderRegistry.ts +1 −1
  5. apps/server/src/vcs/GitVcsDriver.test.ts +2 −1
  6. apps/server/src/vcs/GitVcsDriver.ts +2 −1
  7. apps/server/src/vcs/GitVcsDriverCore.ts +44 −29
  8. apps/server/src/vcs/VcsDriverRegistry.test.ts +2 −1
  9. apps/server/src/vcs/VcsProcess.ts +1 −2
apps/server/src/git/GitManager.test.ts+6−2
@@ -211,7 +211,11 @@ function runGit( · 210 unmodified lines
211 args: readonly string[],211 args: readonly string[],
212 allowNonZeroExit = false,212 allowNonZeroExit = false,
213): Effect.Effect<213): Effect.Effect<
214 { readonly code: number; readonly stdout: string; readonly stderr: string },214 {
215 readonly exitCode: GitVcsDriver.ExecuteGitResult["exitCode"];
216 readonly stdout: string;
217 readonly stderr: string;
218 },
215 GitCommandError,219 GitCommandError,
216 GitVcsDriver.GitVcsDriver220 GitVcsDriver.GitVcsDriver
217> {221> {
@@ -224,7 +228,7 @@ function runGit( · 6 unmodified lines
224 allowNonZeroExit,228 allowNonZeroExit,
225 });229 });
226 return {230 return {
227 code: result.code,231 exitCode: result.exitCode,
228 stdout: result.stdout,232 stdout: result.stdout,
229 stderr: result.stderr,233 stderr: result.stderr,
230 };234 };
apps/server/src/server.test.ts+2−1
@@ -39,6 +39,7 @@ import { · 38 unmodified lines
39 Path,39 Path,
40 Stream,40 Stream,
41} from "effect";41} from "effect";
42import { ChildProcessSpawner } from "effect/unstable/process";
42import {43import {
43 FetchHttpClient,44 FetchHttpClient,
44 HttpBody,45 HttpBody,
@@ -384,7 +385,7 @@ const buildAppUnderTest = (options?: { · 339 unmodified lines
384 },385 },
385 execute: () =>386 execute: () =>
386 Effect.succeed({387 Effect.succeed({
387 exitCode: 0,388 exitCode: ChildProcessSpawner.ExitCode(0),
388 stdout: "",389 stdout: "",
389 stderr: "",390 stderr: "",
390 stdoutTruncated: false,391 stdoutTruncated: false,
apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts+2−3
@@ -1,5 +1,6 @@
1import { assert, it } from "@effect/vitest";1import { assert, it } from "@effect/vitest";
2import { Effect, Layer } from "effect";2import { Effect, Layer } from "effect";
3import { ChildProcessSpawner } from "effect/unstable/process";
3 4
4import { GitHubCli } from "./GitHubCli.ts";5import { GitHubCli } from "./GitHubCli.ts";
5import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";6import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
@@ -8,9 +9,7 @@ import * as SourceControlProviderRegistry from "./SourceControlProviderRegistry. · 2 unmodified lines
8const processResult = (stdout: string) => ({9const processResult = (stdout: string) => ({
9 stdout,10 stdout,
10 stderr: "",11 stderr: "",
11 code: 0,12 exitCode: ChildProcessSpawner.ExitCode(0),
12 signal: null,
13 timedOut: false,
14 stdoutTruncated: false,13 stdoutTruncated: false,
15 stderrTruncated: false,14 stderrTruncated: false,
16});15});
apps/server/src/sourceControl/SourceControlProviderRegistry.ts+1−1
@@ -89,7 +89,7 @@ export const make = Effect.fn("makeSourceControlProviderRegistry")(function* () · 88 unmodified lines
89 })89 })
90 .pipe(90 .pipe(
91 Effect.map((result) =>91 Effect.map((result) =>
92 result.code === 0 ? firstRemoteUrlFromVerboseOutput(result.stdout) : null,92 result.exitCode === 0 ? firstRemoteUrlFromVerboseOutput(result.stdout) : null,
93 ),93 ),
94 Effect.mapError((error) => providerDetectionError("detectProvider", cwd, error)),94 Effect.mapError((error) => providerDetectionError("detectProvider", cwd, error)),
95 ));95 ));
apps/server/src/vcs/GitVcsDriver.test.ts+2−1
@@ -1,5 +1,6 @@
1import * as NodeServices from "@effect/platform-node/NodeServices";1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { Effect, FileSystem, Layer, Path, PlatformError } from "effect";2import { Effect, FileSystem, Layer, Path, PlatformError } from "effect";
3import { ChildProcessSpawner } from "effect/unstable/process";
3import { assert, it } from "@effect/vitest";4import { assert, it } from "@effect/vitest";
4 5
5import { GitCommandError } from "@t3tools/contracts";6import { GitCommandError } from "@t3tools/contracts";
@@ -85,7 +86,7 @@ it.effect("GitVcsDriver forwards execute env to the VCS process", () => { · 79 unmodified lines
85 Effect.sync(() => {86 Effect.sync(() => {
86 observedEnv = input.env;87 observedEnv = input.env;
87 return {88 return {
88 exitCode: 0,89 exitCode: ChildProcessSpawner.ExitCode(0),
89 stdout: "",90 stdout: "",
90 stderr: "",91 stderr: "",
91 stdoutTruncated: false,92 stdoutTruncated: false,
apps/server/src/vcs/GitVcsDriver.ts+2−1
@@ -1,4 +1,5 @@
1import { Context, DateTime, Effect, Layer, Option } from "effect";1import { Context, DateTime, Effect, Layer, Option } from "effect";
2import { ChildProcessSpawner } from "effect/unstable/process";
2 3
3import {4import {
4 GitCommandError,5 GitCommandError,
@@ -35,7 +36,7 @@ export interface ExecuteGitInput { · 30 unmodified lines
35}36}
36 37
37export interface ExecuteGitResult {38export interface ExecuteGitResult {
38 readonly code: number;39 readonly exitCode: ChildProcessSpawner.ExitCode;
39 readonly stdout: string;40 readonly stdout: string;
40 readonly stderr: string;41 readonly stderr: string;
41 readonly stdoutTruncated: boolean;42 readonly stdoutTruncated: boolean;
apps/server/src/vcs/GitVcsDriverCore.ts+44−29
@@ -448,7 +448,7 @@ const createTrace2Monitor = Effect.fn("createTrace2Monitor")(function* ( · 447 unmodified lines
448 448
449 if (event === "child_exit") {449 if (event === "child_exit") {
450 hookStartByChildKey.delete(childKey);450 hookStartByChildKey.delete(childKey);
451 const code = traceRecord.success.code;451 const code = traceRecord.success.exitCode;
452 const exitCode = typeof code === "number" && Number.isInteger(code) ? code : null;452 const exitCode = typeof code === "number" && Number.isInteger(code) ? code : null;
453 const now = yield* DateTime.now;453 const now = yield* DateTime.now;
454 const durationMs = started454 const durationMs = started
@@ -666,7 +666,6 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 211 unmodified lines
666 input.progress?.onStderrLine,666 input.progress?.onStderrLine,
667 ),667 ),
668 child.exitCode.pipe(668 child.exitCode.pipe(
669 Effect.map((value) => Number(value)),
670 Effect.mapError(toGitCommandError(commandInput, "failed to report exit code.")),669 Effect.mapError(toGitCommandError(commandInput, "failed to report exit code.")),
671 ),670 ),
672 input.stdin === undefined671 input.stdin === undefined
@@ -693,7 +692,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 20 unmodified lines
693 }692 }
694 693
695 return {694 return {
696 code: exitCode,695 exitCode,
697 stdout: stdout.text,696 stdout: stdout.text,
698 stderr: stderr.text,697 stderr: stderr.text,
699 stdoutTruncated: stdout.truncated,698 stdoutTruncated: stdout.truncated,
@@ -761,7 +760,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 61 unmodified lines
761 ...(options.progress ? { progress: options.progress } : {}),760 ...(options.progress ? { progress: options.progress } : {}),
762 }).pipe(761 }).pipe(
763 Effect.flatMap((result) => {762 Effect.flatMap((result) => {
764 if (options.allowNonZeroExit || result.code === 0) {763 if (options.allowNonZeroExit || result.exitCode === 0) {
765 return Effect.succeed(result);764 return Effect.succeed(result);
766 }765 }
767 const stderr = result.stderr.trim();766 const stderr = result.stderr.trim();
@@ -778,7 +777,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 10 unmodified lines
778 operation,777 operation,
779 cwd,778 cwd,
780 args,779 args,
781 `${commandLabel(args)} failed: code=${result.code ?? "null"}`,780 `${commandLabel(args)} failed: code=${result.exitCode ?? "null"}`,
782 ),781 ),
783 );782 );
784 }),783 }),
@@ -823,7 +822,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 38 unmodified lines
823 allowNonZeroExit: true,822 allowNonZeroExit: true,
824 timeoutMs: 5_000,823 timeoutMs: 5_000,
825 },824 },
826 ).pipe(Effect.map((result) => result.code === 0));825 ).pipe(Effect.map((result) => result.exitCode === 0));
827 826
828 const resolveAvailableBranchName = Effect.fn("resolveAvailableBranchName")(function* (827 const resolveAvailableBranchName = Effect.fn("resolveAvailableBranchName")(function* (
829 cwd: string,828 cwd: string,
@@ -939,7 +938,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 109 unmodified lines
939 { allowNonZeroExit: true },938 { allowNonZeroExit: true },
940 ).pipe(939 ).pipe(
941 Effect.map((result) => {940 Effect.map((result) => {
942 if (result.code !== 0) {941 if (result.exitCode !== 0) {
943 return null;942 return null;
944 }943 }
945 return parseDefaultBranchFromRemoteHeadRef(result.stdout, remoteName);944 return parseDefaultBranchFromRemoteHeadRef(result.stdout, remoteName);
@@ -958,12 +957,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 12 unmodified lines
958 {957 {
959 allowNonZeroExit: true,958 allowNonZeroExit: true,
960 },959 },
961 ).pipe(Effect.map((result) => result.code === 0));960 ).pipe(Effect.map((result) => result.exitCode === 0));
962 961
963 const originRemoteExists = (cwd: string): Effect.Effect<boolean, GitCommandError> =>962 const originRemoteExists = (cwd: string): Effect.Effect<boolean, GitCommandError> =>
964 executeGit("GitVcsDriver.originRemoteExists", cwd, ["remote", "get-url", "origin"], {963 executeGit("GitVcsDriver.originRemoteExists", cwd, ["remote", "get-url", "origin"], {
965 allowNonZeroExit: true,964 allowNonZeroExit: true,
966 }).pipe(Effect.map((result) => result.code === 0));965 }).pipe(Effect.map((result) => result.exitCode === 0));
967 966
968 const listRemoteNames = (cwd: string): Effect.Effect<ReadonlyArray<string>, GitCommandError> =>967 const listRemoteNames = (cwd: string): Effect.Effect<ReadonlyArray<string>, GitCommandError> =>
969 runGitStdout("GitVcsDriver.listRemoteNames", cwd, ["remote"]).pipe(968 runGitStdout("GitVcsDriver.listRemoteNames", cwd, ["remote"]).pipe(
@@ -1115,7 +1114,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 145 unmodified lines
1115 ["rev-list", "--count", `${baseRef}..HEAD`],1114 ["rev-list", "--count", `${baseRef}..HEAD`],
1116 { allowNonZeroExit: true },1115 { allowNonZeroExit: true },
1117 );1116 );
1118 if (result.code !== 0) {1117 if (result.exitCode !== 0) {
1119 return 0;1118 return 0;
1120 }1119 }
1121 1120
@@ -1140,7 +1139,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 18 unmodified lines
1140 );1139 );
1141 1140
1142 const branchLastCommit = new Map<string, number>();1141 const branchLastCommit = new Map<string, number>();
1143 if (branchRecency.code !== 0) {1142 if (branchRecency.exitCode !== 0) {
1144 return branchLastCommit;1143 return branchLastCommit;
1145 }1144 }
1146 1145
@@ -1173,7 +1172,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 26 unmodified lines
1173 return NON_REPOSITORY_STATUS_DETAILS;1172 return NON_REPOSITORY_STATUS_DETAILS;
1174 }1173 }
1175 1174
1176 if (statusResult.code !== 0) {1175 if (statusResult.exitCode !== 0) {
1177 const stderr = statusResult.stderr.trim();1176 const stderr = statusResult.stderr.trim();
1178 return yield* createGitCommandError(1177 return yield* createGitCommandError(
1179 "GitVcsDriver.statusDetails.status",1178 "GitVcsDriver.statusDetails.status",
@@ -1206,7 +1205,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 26 unmodified lines
1206 );1205 );
1207 const statusStdout = statusResult.stdout;1206 const statusStdout = statusResult.stdout;
1208 const defaultBranch =1207 const defaultBranch =
1209 defaultRefResult.code === 01208 defaultRefResult.exitCode === 0
1210 ? defaultRefResult.stdout.trim().replace(/^refs\/remotes\/origin\//, "")1209 ? defaultRefResult.stdout.trim().replace(/^refs\/remotes\/origin\//, "")
1211 : null;1210 : null;
1212 1211
@@ -1614,7 +1613,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 401 unmodified lines
1614 ).pipe(1613 ).pipe(
1615 Effect.catchIf(isMissingGitCwdError, () =>1614 Effect.catchIf(isMissingGitCwdError, () =>
1616 Effect.succeed({1615 Effect.succeed({
1617 code: 128,1616 exitCode: ChildProcessSpawner.ExitCode(128),
1618 stdout: "",1617 stdout: "",
1619 stderr: "fatal: not a git repository",1618 stderr: "fatal: not a git repository",
1620 stdoutTruncated: false,1619 stdoutTruncated: false,
@@ -1623,7 +1622,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 2 unmodified lines
1623 ),1622 ),
1624 );1623 );
1625 1624
1626 if (localBranchResult.code !== 0) {1625 if (localBranchResult.exitCode !== 0) {
1627 const stderr = localBranchResult.stderr.trim();1626 const stderr = localBranchResult.stderr.trim();
1628 if (stderr.toLowerCase().includes("not a git repository")) {1627 if (stderr.toLowerCase().includes("not a git repository")) {
1629 return {1628 return {
@@ -1654,7 +1653,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 24 unmodified lines
1654 Effect.catch((error) =>1653 Effect.catch((error) =>
1655 Effect.logWarning(1654 Effect.logWarning(
1656 `GitVcsDriver.listRefs: remote refName lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote refName list.`,1655 `GitVcsDriver.listRefs: remote refName lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote refName list.`,
1657 ).pipe(Effect.as({ code: 1, stdout: "", stderr: "" })),1656 ).pipe(
1657 Effect.as({
1658 exitCode: ChildProcessSpawner.ExitCode(1),
1659 stdout: "",
1660 stderr: "",
1661 stdoutTruncated: false,
1662 stderrTruncated: false,
1663 } satisfies ExecuteGitResult),
1664 ),
1658 ),1665 ),
1659 );1666 );
1660 1667
@@ -1670,7 +1677,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 9 unmodified lines
1670 Effect.catch((error) =>1677 Effect.catch((error) =>
1671 Effect.logWarning(1678 Effect.logWarning(
1672 `GitVcsDriver.listRefs: remote name lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote name list.`,1679 `GitVcsDriver.listRefs: remote name lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote name list.`,
1673 ).pipe(Effect.as({ code: 1, stdout: "", stderr: "" })),1680 ).pipe(
1681 Effect.as({
1682 exitCode: ChildProcessSpawner.ExitCode(1),
1683 stdout: "",
1684 stderr: "",
1685 stdoutTruncated: false,
1686 stderrTruncated: false,
1687 } satisfies ExecuteGitResult),
1688 ),
1674 ),1689 ),
1675 );1690 );
1676 1691
@@ -1703,25 +1718,25 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 26 unmodified lines
1703 );1718 );
1704 1719
1705 const remoteNames =1720 const remoteNames =
1706 remoteNamesResult.code === 0 ? parseRemoteNames(remoteNamesResult.stdout) : [];1721 remoteNamesResult.exitCode === 0 ? parseRemoteNames(remoteNamesResult.stdout) : [];
1707 if (remoteBranchResult.code !== 0 && remoteBranchResult.stderr.trim().length > 0) {1722 if (remoteBranchResult.exitCode !== 0 && remoteBranchResult.stderr.trim().length > 0) {
1708 yield* Effect.logWarning(1723 yield* Effect.logWarning(
1709 `GitVcsDriver.listRefs: remote refName lookup returned code ${remoteBranchResult.code} for ${input.cwd}: ${remoteBranchResult.stderr.trim()}. Falling back to an empty remote refName list.`,1724 `GitVcsDriver.listRefs: remote refName lookup returned code ${remoteBranchResult.exitCode} for ${input.cwd}: ${remoteBranchResult.stderr.trim()}. Falling back to an empty remote refName list.`,
1710 );1725 );
1711 }1726 }
1712 if (remoteNamesResult.code !== 0 && remoteNamesResult.stderr.trim().length > 0) {1727 if (remoteNamesResult.exitCode !== 0 && remoteNamesResult.stderr.trim().length > 0) {
1713 yield* Effect.logWarning(1728 yield* Effect.logWarning(
1714 `GitVcsDriver.listRefs: remote name lookup returned code ${remoteNamesResult.code} for ${input.cwd}: ${remoteNamesResult.stderr.trim()}. Falling back to an empty remote name list.`,1729 `GitVcsDriver.listRefs: remote name lookup returned code ${remoteNamesResult.exitCode} for ${input.cwd}: ${remoteNamesResult.stderr.trim()}. Falling back to an empty remote name list.`,
1715 );1730 );
1716 }1731 }
1717 1732
1718 const defaultBranch =1733 const defaultBranch =
1719 defaultRef.code === 01734 defaultRef.exitCode === 0
1720 ? defaultRef.stdout.trim().replace(/^refs\/remotes\/origin\//, "")1735 ? defaultRef.stdout.trim().replace(/^refs\/remotes\/origin\//, "")
1721 : null;1736 : null;
1722 1737
1723 const worktreeMap = new Map<string, string>();1738 const worktreeMap = new Map<string, string>();
1724 if (worktreeList.code === 0) {1739 if (worktreeList.exitCode === 0) {
1725 let currentPath: string | null = null;1740 let currentPath: string | null = null;
1726 for (const line of worktreeList.stdout.split("\n")) {1741 for (const line of worktreeList.stdout.split("\n")) {
1727 if (line.startsWith("worktree ")) {1742 if (line.startsWith("worktree ")) {
@@ -1762,7 +1777,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 34 unmodified lines
1762 });1777 });
1763 1778
1764 const remoteBranches =1779 const remoteBranches =
1765 remoteBranchResult.code === 01780 remoteBranchResult.exitCode === 0
1766 ? remoteBranchResult.stdout1781 ? remoteBranchResult.stdout
1767 .split("\n")1782 .split("\n")
1768 .map(parseBranchLine)1783 .map(parseBranchLine)
@@ -1943,7 +1958,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 174 unmodified lines
1943 timeoutMs: 5_000,1958 timeoutMs: 5_000,
1944 allowNonZeroExit: true,1959 allowNonZeroExit: true,
1945 },1960 },
1946 ).pipe(Effect.map((result) => result.code === 0)),1961 ).pipe(Effect.map((result) => result.exitCode === 0)),
1947 executeGit(1962 executeGit(
1948 "GitVcsDriver.switchRef.remoteExists",1963 "GitVcsDriver.switchRef.remoteExists",
1949 input.cwd,1964 input.cwd,
@@ -1952,7 +1967,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 2 unmodified lines
1952 timeoutMs: 5_000,1967 timeoutMs: 5_000,
1953 allowNonZeroExit: true,1968 allowNonZeroExit: true,
1954 },1969 },
1955 ).pipe(Effect.map((result) => result.code === 0)),1970 ).pipe(Effect.map((result) => result.exitCode === 0)),
1956 ],1971 ],
1957 { concurrency: "unbounded" },1972 { concurrency: "unbounded" },
1958 );1973 );
@@ -1968,7 +1983,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 9 unmodified lines
1968 },1983 },
1969 ).pipe(1984 ).pipe(
1970 Effect.map((result) =>1985 Effect.map((result) =>
1971 result.code === 01986 result.exitCode === 0
1972 ? parseTrackingBranchByUpstreamRef(result.stdout, input.refName)1987 ? parseTrackingBranchByUpstreamRef(result.stdout, input.refName)
1973 : null,1988 : null,
1974 ),1989 ),
@@ -1986,7 +2001,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* · 11 unmodified lines
1986 timeoutMs: 5_000,2001 timeoutMs: 5_000,
1987 allowNonZeroExit: true,2002 allowNonZeroExit: true,
1988 },2003 },
1989 ).pipe(Effect.map((result) => result.code === 0))2004 ).pipe(Effect.map((result) => result.exitCode === 0))
1990 : false;2005 : false;
1991 2006
1992 const checkoutArgs = localInputExists2007 const checkoutArgs = localInputExists
apps/server/src/vcs/VcsDriverRegistry.test.ts+2−1
@@ -1,5 +1,6 @@
1import { assert, it } from "@effect/vitest";1import { assert, it } from "@effect/vitest";
2import { Effect, Layer } from "effect";2import { Effect, Layer } from "effect";
3import { ChildProcessSpawner } from "effect/unstable/process";
3import { describe } from "vitest";4import { describe } from "vitest";
4 5
5import { VcsProcess, type VcsProcessInput, type VcsProcessOutput } from "./VcsProcess.ts";6import { VcsProcess, type VcsProcessInput, type VcsProcessOutput } from "./VcsProcess.ts";
@@ -7,7 +8,7 @@ import { VcsProjectConfig } from "./VcsProjectConfig.ts"; · 1 unmodified line
7import { VcsDriverRegistry, make as makeVcsDriverRegistry } from "./VcsDriverRegistry.ts";8import { VcsDriverRegistry, make as makeVcsDriverRegistry } from "./VcsDriverRegistry.ts";
8 9
9const processOutput = (stdout: string): VcsProcessOutput => ({10const processOutput = (stdout: string): VcsProcessOutput => ({
10 exitCode: 0,11 exitCode: ChildProcessSpawner.ExitCode(0),
11 stdout,12 stdout,
12 stderr: "",13 stderr: "",
13 stdoutTruncated: false,14 stdoutTruncated: false,
apps/server/src/vcs/VcsProcess.ts+1−2
@@ -23,7 +23,7 @@ export interface VcsProcessInput { · 22 unmodified lines
23}23}
24 24
25export interface VcsProcessOutput {25export interface VcsProcessOutput {
26 readonly exitCode: number;26 readonly exitCode: ChildProcessSpawner.ExitCode;
27 readonly stdout: string;27 readonly stdout: string;
28 readonly stderr: string;28 readonly stderr: string;
29 readonly stdoutTruncated: boolean;29 readonly stdoutTruncated: boolean;
@@ -147,7 +147,6 @@ export const make = Effect.fn("makeVcsProcess")(function* () { · 117 unmodified lines
147 input.truncateOutputAtMaxBytes ?? false,147 input.truncateOutputAtMaxBytes ?? false,
148 ),148 ),
149 child.exitCode.pipe(149 child.exitCode.pipe(
150 Effect.map((value) => Number(value)),
151 Effect.mapError(150 Effect.mapError(
152 (cause) =>151 (cause) =>
153 new VcsOutputDecodeError({152 new VcsOutputDecodeError({

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t