Skip to content

Commit 80c87b6

Browse files
donjorrsi-pr-agent
authored andcommitted
fix(upstream-fixes): adapt fork services to extracted source-control and host process APIs
Adapts to upstream e308522 (HostProcess), 58916b6 (injected home directory), and the source-control package extraction. Provider identity scrubbing now composes the upstream Effect, and attachment uploads run through SourceControlHost. Fork-Domain: upstream-fixes Fork-Tier: bugfix Fork-Upstreamable: no
1 parent fb52655 commit 80c87b6

48 files changed

Lines changed: 308 additions & 219 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/desktop/src/app/DesktopPreReadyPlatform.fork.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assert, describe, it } from "@effect/vitest";
2-
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
2+
import * as HostProcess from "@t3tools/shared/HostProcess";
33
import * as Effect from "effect/Effect";
44
import * as Layer from "effect/Layer";
55
import { beforeEach, vi } from "vite-plus/test";
@@ -40,7 +40,7 @@ import * as DesktopPreReadyPlatform from "./DesktopPreReadyPlatform.ts";
4040

4141
const buildLinuxOptions = DesktopPreReadyPlatform.DesktopPreReadyElectronOptions.pipe(
4242
Effect.provide(
43-
DesktopPreReadyPlatform.layer.pipe(Layer.provide(Layer.succeed(HostProcessPlatform, "linux"))),
43+
DesktopPreReadyPlatform.layer.pipe(Layer.provide(Layer.succeed(HostProcess.Platform, "linux"))),
4444
),
4545
);
4646

‎apps/desktop/src/electron/ElectronWindow.fork.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assert, describe, it } from "@effect/vitest";
2-
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
2+
import * as HostProcess from "@t3tools/shared/HostProcess";
33
import * as Effect from "effect/Effect";
44
import * as Layer from "effect/Layer";
55
import * as Option from "effect/Option";
@@ -27,7 +27,7 @@ import { HUB_WINDOW_IDENTITY, projectWindowIdentity } from "../window/WindowIden
2727
import { isWindowId, type WindowId } from "../window/WindowId.fork.ts";
2828
import { EnvironmentId, ProjectId } from "@t3tools/contracts";
2929
const TestLayer = ElectronWindow.layer.pipe(
30-
Layer.provide(Layer.succeed(HostProcessPlatform, "linux")),
30+
Layer.provide(Layer.succeed(HostProcess.Platform, "linux")),
3131
);
3232
function makeBrowserWindow(input: { readonly id: number; readonly destroyed: boolean }) {
3333
const listeners = new Map<string, () => void>();

‎apps/desktop/src/electron/WindowTargets.fork.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type DesktopAppActivationRequest,
77
type DesktopAppActivationResponse,
88
} from "@t3tools/contracts";
9-
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
9+
import * as HostProcess from "@t3tools/shared/HostProcess";
1010
import * as Deferred from "effect/Deferred";
1111
import * as Effect from "effect/Effect";
1212
import * as Fiber from "effect/Fiber";
@@ -114,7 +114,7 @@ function makeWindow(options: { readonly fullScreen?: boolean } = {}) {
114114
type FakeWindow = ReturnType<typeof makeWindow>;
115115

116116
const ElectronWindowLayer = ElectronWindow.layer.pipe(
117-
Layer.provide(Layer.succeed(HostProcessPlatform, "linux")),
117+
Layer.provide(Layer.succeed(HostProcess.Platform, "linux")),
118118
Layer.provide(NodeServices.layer),
119119
);
120120

‎apps/server/src/cloud/launcherRepoint.fork.test.ts‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as NodeServices from "@effect/platform-node/NodeServices";
22
import { expect, it } from "@effect/vitest";
3-
import {
4-
HostProcessArchitecture,
5-
HostProcessEnvironment,
6-
HostProcessPlatform,
7-
} from "@t3tools/shared/hostProcess";
3+
import * as HostProcess from "@t3tools/shared/HostProcess";
84
import * as Effect from "effect/Effect";
95
import * as FileSystem from "effect/FileSystem";
106
import * as Path from "effect/Path";
@@ -41,8 +37,8 @@ const repoint = (
4137
environment: NodeJS.ProcessEnv,
4238
) =>
4339
repointLaunchersFork(home.fs, home.path, home.baseDir, "1.1.0").pipe(
44-
Effect.provideService(HostProcessEnvironment, environment),
45-
Effect.provideService(HostProcessPlatform, "linux"),
40+
Effect.provideService(HostProcess.Environment, environment),
41+
Effect.provideService(HostProcess.Platform, "linux"),
4642
);
4743

4844
const runResult = (stdout: string) => ({
@@ -112,8 +108,8 @@ const makeSelfUpdate = Effect.fn("test.make_launcher_self_update")(function* (
112108
commit: () => Effect.die("unexpected desktop app update commit"),
113109
}),
114110
Effect.provideService(HttpClient.HttpClient, httpClient),
115-
Effect.provideService(HostProcessPlatform, "linux"),
116-
Effect.provideService(HostProcessArchitecture, "x64"),
111+
Effect.provideService(HostProcess.Platform, "linux"),
112+
Effect.provideService(HostProcess.Architecture, "x64"),
117113
Effect.provide(ServerConfig.layer({ ...config, mode: "web" })),
118114
);
119115
});
@@ -126,7 +122,7 @@ it.layer(NodeServices.layer)("launcher repoint on a client update", (it) => {
126122
const selfUpdate = yield* makeSelfUpdate(home, "ready");
127123
yield* selfUpdate
128124
.update({ targetVersion: "1.1.0" })
129-
.pipe(Effect.provideService(HostProcessEnvironment, { PATH: home.binDir }));
125+
.pipe(Effect.provideService(HostProcess.Environment, { PATH: home.binDir }));
130126
expect(yield* home.fs.readLink(home.launcher)).toBe(home.target("1.1.0"));
131127
}),
132128
);
@@ -138,7 +134,7 @@ it.layer(NodeServices.layer)("launcher repoint on a client update", (it) => {
138134
const selfUpdate = yield* makeSelfUpdate(home, "blocked");
139135
yield* selfUpdate
140136
.update({ targetVersion: "1.1.0" })
141-
.pipe(Effect.provideService(HostProcessEnvironment, { PATH: home.binDir }), Effect.flip);
137+
.pipe(Effect.provideService(HostProcess.Environment, { PATH: home.binDir }), Effect.flip);
142138
expect(yield* home.fs.readLink(home.launcher)).toBe(home.target("1.0.0"));
143139
}),
144140
);

‎apps/server/src/cloud/launcherRepoint.fork.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HostProcessEnvironment, HostProcessPlatform } from "@t3tools/shared/hostProcess";
1+
import * as HostProcess from "@t3tools/shared/HostProcess";
22
import * as Effect from "effect/Effect";
33
import * as FileSystem from "effect/FileSystem";
44
import * as Option from "effect/Option";
@@ -14,7 +14,7 @@ import { pinnedRuntimePaths, pinnedRuntimeVersionsDir } from "./pinnedRuntime.ts
1414
*/
1515
const launcherCandidates = Effect.gen(function* () {
1616
const path = yield* Path.Path;
17-
const environment = yield* HostProcessEnvironment;
17+
const environment = yield* HostProcess.Environment;
1818
const directories = [
1919
environment["T3CODE_INSTALL_BIN_DIR"],
2020
...(environment["PATH"] ?? "").split(":"),
@@ -33,7 +33,7 @@ const repointLaunchers = Effect.fn("cloud.server_self_update.repoint_launchers")
3333
targetVersion: string,
3434
) {
3535
const path = yield* Path.Path;
36-
const platform = yield* HostProcessPlatform;
36+
const platform = yield* HostProcess.Platform;
3737
// The boot service, and with it client updates, exists only on Linux and macOS.
3838
if (platform === "win32") return [];
3939
const versionsDir = pinnedRuntimeVersionsDir(path, baseDir);

‎apps/server/src/githubIssue/GitHubIssueService.fork.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as Option from "effect/Option";
88

99
import * as ProjectService from "../project/ProjectService.ts";
1010
import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolver.ts";
11-
import * as GitHubApi from "../sourceControl/GitHubApi.ts";
11+
import * as GitHubApi from "@t3tools/source-control-github/server/GitHubApi";
1212
import * as GitHubIssueService from "./GitHubIssueService.ts";
1313
import { SUB_ISSUE_REASONS_QUERY } from "./subIssueCloseReasons.fork.ts";
1414

‎apps/server/src/githubIssue/GitHubIssueService.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import * as Option from "effect/Option";
66

77
import * as ProjectService from "../project/ProjectService.ts";
88
import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolver.ts";
9-
import * as GitHubApi from "../sourceControl/GitHubApi.ts";
10-
import * as GitHubCredentials from "../sourceControl/GitHubCredentials.ts";
9+
import * as GitHubApi from "@t3tools/source-control-github/server/GitHubApi";
10+
import * as GitHubCredentials from "@t3tools/source-control-github/server/GitHubCredentials";
1111
import * as GitHubIssueService from "./GitHubIssueService.ts";
1212

1313
function project(input: {

‎apps/server/src/githubIssue/GitHubIssueService.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import * as Schema from "effect/Schema";
2626

2727
import * as ProjectService from "../project/ProjectService.ts";
2828
import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolver.ts";
29-
import * as GitHubApi from "../sourceControl/GitHubApi.ts";
29+
import * as GitHubApi from "@t3tools/source-control-github/server/GitHubApi";
3030
import {
3131
decodeParsedGitHubIssueDetail,
3232
decodeParsedGitHubIssueList,

‎apps/server/src/githubIssue/githubIssueWiring.fork.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
import { GitHubIssueOperationError } from "@t3tools/contracts";
1818

1919
import * as Orchestrator from "../orchestration-v2/Orchestrator.ts";
20-
import * as GitHubApi from "../sourceControl/GitHubApi.ts";
20+
import * as GitHubApi from "@t3tools/source-control-github/server/GitHubApi";
2121
import * as GitHubIssueService from "./GitHubIssueService.ts";
2222
import * as ThreadIssueSyncReactor from "./ThreadIssueSyncReactor.fork.ts";
2323
import { listLinkedIssueThreadsFork } from "./linkedThreads.fork.ts";

‎apps/server/src/githubIssue/subIssueCloseReasons.fork.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { GitHubSubIssue } from "@t3tools/contracts";
55
import * as Effect from "effect/Effect";
66
import * as Option from "effect/Option";
77

8-
import * as GitHubApi from "../sourceControl/GitHubApi.ts";
8+
import * as GitHubApi from "@t3tools/source-control-github/server/GitHubApi";
99
import { decodeGitHubSubIssueReasons } from "./gitHubIssueJson.ts";
1010

1111
// GitHub caps the `subIssues` connection at `first: 100`; asking for more fails the whole query.

0 commit comments

Comments
 (0)