Skip to content

Commit 27b6f2b

Browse files
committed
Merge remote-tracking branch 'origin/main' into t3/check-git-provider-speed-merge
# Conflicts: # packages/source-control-azure-devops/src/server/AzureDevOpsPullRequestProvider.test.ts # packages/source-control-bitbucket/src/server/BitbucketPullRequestProvider.test.ts # packages/source-control-github/src/server/gitHubConditionalChecks.test.ts # packages/source-control-gitlab/src/server/GitLabPullRequestProvider.test.ts
2 parents 3f844a6 + 8cd561e commit 27b6f2b

1,915 files changed

Lines changed: 6497 additions & 258906 deletions

File tree

Some content is hidden

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

‎.github/scripts/check-nightly-release.test.cjs‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ for (const releaseChannel of ["stable", "nightly"]) {
6161
);
6262
assert.equal(calls.length, 0);
6363
});
64-
65-
test(`allows a manual ${releaseChannel} release from main`, async () => {
66-
const { options, calls } = releaseSourceFixture();
67-
await assertReleaseSource({ ...options, releaseChannel });
68-
assert.equal(calls[0].basehead, "candidate...main");
69-
});
7064
}
7165

7266
for (const comparisonStatus of ["behind", "diverged"]) {
@@ -79,13 +73,6 @@ for (const comparisonStatus of ["behind", "diverged"]) {
7973
});
8074
}
8175

82-
test("accepts a release commit already contained in main", async () => {
83-
for (const comparisonStatus of ["ahead", "identical"]) {
84-
const { options } = releaseSourceFixture({ comparisonStatus, eventName: "push" });
85-
await assertCommitOnDefaultBranch({ ...options, sha: "release-commit" });
86-
}
87-
});
88-
8976
function fixture({ releases = [nightly(7)], comparisonStatus = "ahead" } = {}) {
9077
const calls = [];
9178
return {
@@ -119,26 +106,6 @@ test("releases the first nightly when no nightly is published", async () => {
119106
assert.equal(await shouldReleaseNightly(options), true);
120107
});
121108

122-
test("waits six hours after publication, including manual nightlies", async () => {
123-
for (const age of [0, 3, 6 - 1 / 3600]) {
124-
const { options, calls } = fixture({ releases: [nightly(age)] });
125-
assert.equal(await shouldReleaseNightly(options), false);
126-
assert.equal(calls.length, 0);
127-
}
128-
});
129-
130-
test("releases new commits at six hours and after an idle period", async () => {
131-
for (const age of [6, 7, 24]) {
132-
const { options } = fixture({ releases: [nightly(age)] });
133-
assert.equal(await shouldReleaseNightly(options), true);
134-
}
135-
});
136-
137-
test("skips unchanged commits after the gap", async () => {
138-
const { options } = fixture({ comparisonStatus: "identical" });
139-
assert.equal(await shouldReleaseNightly(options), false);
140-
});
141-
142109
test("uses publication time, not release order or the tagged commit date", async () => {
143110
const { options } = fixture({
144111
releases: [nightly(10), nightly(1), nightly(20, { tag_name: "nightly-v0.9.0" })],
@@ -153,13 +120,6 @@ test("ignores stable releases and drafts when checking the gap", async () => {
153120
assert.equal(await shouldReleaseNightly(options), true);
154121
});
155122

156-
test("compares against the published tag, including legacy nightly tags", async () => {
157-
const tag = "nightly-v0.9.0";
158-
const { options, calls } = fixture({ releases: [nightly(7, { tag_name: tag })] });
159-
assert.equal(await shouldReleaseNightly(options), true);
160-
assert.equal(calls[0].basehead, `${tag}...new`);
161-
});
162-
163123
test("fails instead of releasing when GitHub cannot supply release state", async () => {
164124
const { options } = fixture();
165125
options.github.paginate = async () => {
@@ -211,8 +171,3 @@ test("stable releases derive the version from legacy nightly tags", async () =>
211171
});
212172
assert.equal((await resolveLatestNightlyCommit(options)).version, "0.9.0");
213173
});
214-
215-
test("stable releases fail without a published nightly", async () => {
216-
const { options } = nightlyCommitFixture({ releases: [nightly(0, { tag_name: "v1.0.0" })] });
217-
await assert.rejects(resolveLatestNightlyCommit(options), /No published nightly/);
218-
});

‎.github/scripts/thread-transfer-report.test.cjs‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const assert = require("node:assert/strict");
22
const test = require("node:test");
33

44
const {
5-
renderComment,
65
resolve,
76
upsertCommentForCurrentHead,
87
validateResult,
@@ -53,39 +52,6 @@ test("validates the fixed artifact schema", () => {
5352
);
5453
});
5554

56-
test("renders baseline, impact, ceiling, and ceiling changes", () => {
57-
const baseline = result();
58-
const current = result({ measuredTurnWebSocketWireBytes: 260_000 });
59-
current.providers.codex.ceiling = {
60-
...current.providers.codex.ceiling,
61-
measuredTurnWebSocketWireBytes: 330_000,
62-
};
63-
const comment = renderComment({
64-
current,
65-
baseline,
66-
currentRun: {
67-
sha: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
68-
conclusion: "success",
69-
url: "https://github.com/pingdotgg/t3code/actions/runs/2",
70-
},
71-
baselineRun: {
72-
sha: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
73-
matchesBase: true,
74-
url: "https://github.com/pingdotgg/t3code/actions/runs/1",
75-
},
76-
});
77-
78-
assert.match(comment, /Main baseline \| This PR \| Impact \| PR ceiling/);
79-
assert.match(comment, /\+9\.8 KiB \(\+4\.0%\)/);
80-
assert.match(comment, /This PR changes transfer ceilings/);
81-
assert.match(comment, /312\.5 KiB → 322\.3 KiB/);
82-
assert.match(comment, /<!-- t3-thread-transfer-report -->/);
83-
assert.match(
84-
comment,
85-
/<!-- t3-thread-transfer-result-sha:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -->/,
86-
);
87-
});
88-
8955
test("resolves a fallback PR with a redacted head repo and exact main baseline", async () => {
9056
const outputs = {};
9157
const listWorkflowRunArtifacts = () => {};
@@ -373,21 +339,3 @@ test("preserves a successful result when a same-SHA rerun has no artifact", asyn
373339
assert.equal(published, true);
374340
assert.equal(updatedComment, false);
375341
});
376-
377-
test("accepts V2 without comparing it to the V1 scenario", () => {
378-
const current = result();
379-
current.scenario.id = "thread-transfer-v2";
380-
current.providers.codex.ceiling = { ...current.providers.codex.ceiling, totalWireBytes: 3000000 };
381-
assert.equal(validateResult(current), current);
382-
const comment = renderComment({
383-
current,
384-
baseline: result(),
385-
currentRun: { sha: "bbbbbbbb", conclusion: "success", url: "https://example.com/current" },
386-
baselineRun: { sha: "aaaaaaaa", matchesBase: true, url: "https://example.com/baseline" },
387-
});
388-
assert.match(comment, /fixture changed/);
389-
assert.doesNotMatch(comment, /This PR changes transfer ceilings/);
390-
assert.doesNotMatch(comment, /[+-]\d+\.\d+%/);
391-
current.scenario.id = "unrecognized";
392-
assert.throws(() => validateResult(current), /not supported/);
393-
});

‎apps/desktop/src/app/DesktopApp.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const handleFatalStartupError = Effect.fn("desktop.startup.handleFatalStartupErr
147147
const fatalStartupCause = <E>(stage: string, cause: Cause.Cause<E>) =>
148148
handleFatalStartupError(stage, Cause.pretty(cause)).pipe(Effect.andThen(Effect.failCause(cause)));
149149

150-
export const stopAllPoolInstances = Effect.fn("desktop.app.stopAllPoolInstances")(
150+
const stopAllPoolInstances = Effect.fn("desktop.app.stopAllPoolInstances")(
151151
function* (): Effect.fn.Return<void, never, DesktopBackendPool.DesktopBackendPool> {
152152
const pool = yield* DesktopBackendPool.DesktopBackendPool;
153153
const instances = yield* pool.list;

‎apps/desktop/src/app/DesktopAppActivation.test.ts‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -81,46 +81,6 @@ function exchange(address: string, payload: DesktopAppActivationRequest) {
8181
}
8282

8383
describe("desktop app control server", () => {
84-
it.effect("roundtrips a request and removes its socket on shutdown", () =>
85-
Effect.gen(function* () {
86-
const platform = yield* HostProcess.Platform;
87-
const userId = yield* HostProcess.UserId;
88-
yield* Effect.promise(async () => {
89-
const root = await NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3-app-control-test-"));
90-
const target = makeTarget(NodePath.join(root, "userdata"), platform, userId);
91-
const received: DesktopAppActivationRequest[] = [];
92-
const server = await startDesktopAppControlServer({
93-
...target,
94-
userId,
95-
handle: async (input) => {
96-
received.push(input);
97-
return {
98-
version: 1,
99-
requestId: input.requestId,
100-
ok: true,
101-
projectId: ProjectId.make("project-1"),
102-
threadId: ThreadId.make("thread-1"),
103-
};
104-
},
105-
cancel: () => undefined,
106-
onReclaimError: () => undefined,
107-
});
108-
openServers.push(server);
109-
110-
const response = await exchange(target.address, request("request-1", platform));
111-
112-
expect(received).toHaveLength(1);
113-
expect(response).toMatchObject({ ok: true, requestId: "request-1" });
114-
await server.close();
115-
openServers.splice(openServers.indexOf(server), 1);
116-
if (target.directory !== null) {
117-
await expect(NodeFSP.stat(target.address)).rejects.toMatchObject({ code: "ENOENT" });
118-
}
119-
await NodeFSP.rm(root, { recursive: true, force: true });
120-
});
121-
}),
122-
);
123-
12484
it.effect("cancels a queued request when the client disconnects", () =>
12585
Effect.gen(function* () {
12686
const platform = yield* HostProcess.Platform;

‎apps/desktop/src/app/DesktopAppActivationBroker.test.ts‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@ describe("DesktopAppActivationBroker", () => {
7474
broker.close();
7575
});
7676

77-
it("removes a queued request when its CLI connection closes", async () => {
78-
const send = vi.fn();
79-
const broker = new DesktopAppActivationBroker({ requestTimeoutMs: 1_000, activate: vi.fn() });
80-
81-
const response = broker.request(request);
82-
broker.cancel(request.requestId);
83-
broker.registerRenderer(send);
84-
85-
await expect(response).resolves.toMatchObject({ ok: false, code: "renderer-unavailable" });
86-
expect(send).not.toHaveBeenCalled();
87-
broker.close();
88-
});
89-
9077
it("never sends a canceled request that was queued behind another request", async () => {
9178
const send = vi.fn();
9279
const broker = new DesktopAppActivationBroker({ requestTimeoutMs: 1_000, activate: vi.fn() });
@@ -112,19 +99,4 @@ describe("DesktopAppActivationBroker", () => {
11299
expect(send).toHaveBeenCalledTimes(1);
113100
broker.close();
114101
});
115-
116-
it("times out a request without polling", async () => {
117-
vi.useFakeTimers();
118-
try {
119-
const broker = new DesktopAppActivationBroker({ requestTimeoutMs: 1_000, activate: vi.fn() });
120-
const response = broker.request(request);
121-
122-
await vi.advanceTimersByTimeAsync(1_000);
123-
124-
await expect(response).resolves.toMatchObject({ ok: false, code: "request-timeout" });
125-
broker.close();
126-
} finally {
127-
vi.useRealTimers();
128-
}
129-
});
130102
});

‎apps/desktop/src/app/DesktopAppIdentity.test.ts‎

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import * as DesktopAppIdentity from "./DesktopAppIdentity.ts";
1414
import * as DesktopAssets from "./DesktopAssets.ts";
1515
import * as DesktopConfig from "./DesktopConfig.ts";
1616
import * as DesktopEnvironment from "./DesktopEnvironment.ts";
17-
import * as DesktopUserData from "./DesktopUserData.ts";
1817

1918
const defaultEnvironmentInput = {
2019
dirname: "/repo/apps/desktop/dist-electron",
@@ -176,66 +175,6 @@ describe("DesktopAppIdentity", () => {
176175
),
177176
);
178177

179-
it.effect("preserves failures while inspecting the legacy userData path", () => {
180-
const legacyPath = "/Users/alice/Library/Application Support/T3 Code (Dev)";
181-
const cause = PlatformError.systemError({
182-
_tag: "PermissionDenied",
183-
module: "FileSystem",
184-
method: "exists",
185-
description: "permission denied",
186-
pathOrDescriptor: legacyPath,
187-
});
188-
189-
return withIdentity(
190-
Effect.gen(function* () {
191-
const identity = yield* DesktopAppIdentity.DesktopAppIdentity;
192-
const error = yield* identity.resolveUserDataPath.pipe(Effect.flip);
193-
194-
assert.instanceOf(error, DesktopUserData.DesktopUserDataInitializationError);
195-
assert.equal(error.resourcePath, legacyPath);
196-
assert.strictEqual(error.cause, cause);
197-
assert.equal(
198-
error.message,
199-
`Could not initialize Electron user data during inspect at ${legacyPath} (PermissionDenied).`,
200-
);
201-
}),
202-
{
203-
legacyPathProbeError: cause,
204-
environment: { env: { VITE_DEV_SERVER_URL: "http://localhost:5173" } },
205-
},
206-
);
207-
});
208-
209-
it.effect("configures app identity from the environment commit override", () => {
210-
const calls: ElectronAppCalls = {
211-
setAboutPanelOptions: [],
212-
setDockIcon: [],
213-
setName: [],
214-
};
215-
216-
return withIdentity(
217-
Effect.gen(function* () {
218-
const identity = yield* DesktopAppIdentity.DesktopAppIdentity;
219-
yield* identity.configure;
220-
221-
assert.deepEqual(calls.setName, ["T3 Code Beta"]);
222-
assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Beta)");
223-
assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3");
224-
assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab");
225-
assert.deepEqual(calls.setDockIcon, []);
226-
}),
227-
{
228-
calls,
229-
environment: {
230-
env: {
231-
T3CODE_COMMIT_HASH: "0123456789abcdef",
232-
},
233-
},
234-
pngIconPath: Option.some("/icon.png"),
235-
},
236-
);
237-
});
238-
239178
it.effect.each([
240179
{ stage: "Beta", environment: {} },
241180
{
@@ -267,26 +206,4 @@ describe("DesktopAppIdentity", () => {
267206
{ calls, environment },
268207
);
269208
});
270-
271-
it.effect("sets the dock icon only when running unpackaged", () => {
272-
const calls: ElectronAppCalls = {
273-
setAboutPanelOptions: [],
274-
setDockIcon: [],
275-
setName: [],
276-
};
277-
278-
return withIdentity(
279-
Effect.gen(function* () {
280-
const identity = yield* DesktopAppIdentity.DesktopAppIdentity;
281-
yield* identity.configure;
282-
283-
assert.deepEqual(calls.setDockIcon, ["/icon.png"]);
284-
}),
285-
{
286-
calls,
287-
environment: { isPackaged: false },
288-
pngIconPath: Option.some("/icon.png"),
289-
},
290-
);
291-
});
292209
});

0 commit comments

Comments
 (0)