Skip to content

Commit b1f43f6

Browse files
only21milclaude
andcommitted
Merge main (05696c6) into r6/s06-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 parents 04ac632 + 05696c6 commit b1f43f6

2,846 files changed

Lines changed: 118305 additions & 282026 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.

‎.gitattributes‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Batch files need CRLF for cmd.exe to parse them reliably.
44
*.cmd text eol=crlf
55
*.bat text eol=crlf
6-
# GitHub's GraphQL schema and the operations graphqlgen writes from it.
6+
# GitHub's and Expo's GraphQL schemas and the operations graphqlgen writes from them.
77
packages/source-control-github/schema/** linguist-generated
8+
apps/server/schema/** linguist-generated
89
**/*.graphql.ts linguist-generated

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,34 @@ runs:
1818
path: ~/.vite-plus
1919
key: vite-plus-home-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}
2020

21+
- name: Setup Vite+
22+
uses: voidzero-dev/setup-vp@v1
23+
with:
24+
node-version-file: package.json
25+
cache: false
26+
run-install: false
27+
28+
- name: Resolve pnpm store path
29+
id: pnpm_store
30+
shell: bash
31+
run: |
32+
store_path="$(vp pm cache dir)"
33+
echo "path=$store_path" >> "$GITHUB_OUTPUT"
34+
35+
# setup-vp's shared cache key ignores install filters. Keep full installs in a
36+
# separate namespace, including fallback restores.
2137
# The pnpm store stays a cache tarball on the runner's own disk. A store on a
2238
# Blacksmith sticky disk mounts in under a second, but pnpm then copies every
2339
# package across filesystems instead of hard-linking it: install took 28-49s
2440
# against 9s plus an 11s restore.
25-
- name: Setup Vite+
26-
uses: voidzero-dev/setup-vp@v1
41+
- name: Cache full pnpm store
42+
uses: actions/cache@v6
2743
with:
28-
node-version-file: package.json
29-
cache: true
30-
run-install: true
44+
path: ${{ steps.pnpm_store.outputs.path }}
45+
key: pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
46+
restore-keys: |
47+
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
48+
49+
- name: Install dependencies
50+
shell: bash
51+
run: vp install

‎.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/ci-changes.cjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const EXTRA_OWNERS = [
3636
// scripts/build-desktop-artifact.ts reads the GNOME extension manifest.
3737
[/^apps\/desktop\/gnome-extension\//, ["@t3tools/scripts"]],
3838
[/^native\/browser-secret\//, ["@t3tools/desktop"]],
39+
[/^native\/kde-snap-shot\//, ["@t3tools/desktop"]],
3940
[/^native\/libghostty-vt\//, ["@t3tools/web"]],
4041
];
4142
const RUST = /^native\/(resource-monitor|kde-snap-shot|hyprland-snap-shot)\//;
@@ -112,10 +113,10 @@ function ownersOf(file, packages) {
112113
// A manifest can change dependencies or versions other packages read.
113114
if (path.posix.basename(file) === "package.json") return null;
114115
if (RUNS_EVERYTHING.some((pattern) => pattern.test(file))) return null;
116+
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
115117
// scripts/build-desktop-artifact.test.ts reads the crates' sources.
116-
if (RUST.test(file)) return ["@t3tools/scripts"];
118+
if (RUST.test(file)) return ["@t3tools/scripts", ...extra];
117119

118-
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
119120
const owner = packages
120121
.filter((pkg) => file.startsWith(`${pkg.dir}/`))
121122
.sort((a, b) => b.dir.length - a.dir.length)[0];

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,26 @@ async function resolve({ github, context, core }) {
244244

245245
let pullNumber = source.pull_requests?.[0]?.number;
246246
if (!pullNumber) {
247-
const associated = await github.paginate(
248-
github.rest.repos.listPullRequestsAssociatedWithCommit,
249-
{ owner, repo, commit_sha: source.head_sha, per_page: 100 },
250-
);
247+
let associated;
248+
try {
249+
associated = await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, {
250+
owner,
251+
repo,
252+
commit_sha: source.head_sha,
253+
per_page: 100,
254+
});
255+
} catch (error) {
256+
// A force-pushed or deleted PR head can disappear before this workflow runs.
257+
if (
258+
error.status === 422 &&
259+
error.response?.data?.message === `No commit found for SHA: ${source.head_sha}`
260+
) {
261+
core.info(`Skipping CI result for unavailable commit ${source.head_sha}.`);
262+
core.setOutput("publish", "false");
263+
return;
264+
}
265+
throw error;
266+
}
251267
const matchingPulls = associated.filter(
252268
(pull) =>
253269
pull.state === "open" &&

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

Lines changed: 41 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 = () => {};
@@ -216,6 +182,47 @@ test("does not guess when a fallback commit belongs to multiple PRs", async () =
216182
assert.equal(fetchedPull, false);
217183
});
218184

185+
test("skips a missing PR commit but preserves other lookup failures", async () => {
186+
for (const [status, message, shouldSkip] of [
187+
[422, "No commit found for SHA: old-head", true],
188+
[422, "Validation Failed", false],
189+
[403, "API rate limit exceeded", false],
190+
]) {
191+
const outputs = {};
192+
const error = Object.assign(new Error(message), {
193+
status,
194+
response: { data: { message } },
195+
});
196+
const run = resolve({
197+
github: {
198+
paginate: async () => {
199+
throw error;
200+
},
201+
rest: { repos: { listPullRequestsAssociatedWithCommit: () => {} } },
202+
},
203+
context: {
204+
repo: { owner: "pingdotgg", repo: "t3code" },
205+
payload: {
206+
workflow_run: { event: "pull_request", head_sha: "old-head", pull_requests: [] },
207+
},
208+
},
209+
core: {
210+
info: () => {},
211+
setOutput: (key, value) => {
212+
outputs[key] = value;
213+
},
214+
},
215+
});
216+
if (shouldSkip) {
217+
await run;
218+
assert.equal(outputs.publish, "false");
219+
} else {
220+
await assert.rejects(run, (caught) => caught === error);
221+
assert.deepEqual(outputs, {});
222+
}
223+
}
224+
});
225+
219226
test("does not report a passing run that skipped the server tests", async () => {
220227
const outputs = {};
221228
const listWorkflowRunArtifacts = () => {};
@@ -332,21 +339,3 @@ test("preserves a successful result when a same-SHA rerun has no artifact", asyn
332339
assert.equal(published, true);
333340
assert.equal(updatedComment, false);
334341
});
335-
336-
test("accepts V2 without comparing it to the V1 scenario", () => {
337-
const current = result();
338-
current.scenario.id = "thread-transfer-v2";
339-
current.providers.codex.ceiling = { ...current.providers.codex.ceiling, totalWireBytes: 3000000 };
340-
assert.equal(validateResult(current), current);
341-
const comment = renderComment({
342-
current,
343-
baseline: result(),
344-
currentRun: { sha: "bbbbbbbb", conclusion: "success", url: "https://example.com/current" },
345-
baselineRun: { sha: "aaaaaaaa", matchesBase: true, url: "https://example.com/baseline" },
346-
});
347-
assert.match(comment, /fixture changed/);
348-
assert.doesNotMatch(comment, /This PR changes transfer ceilings/);
349-
assert.doesNotMatch(comment, /[+-]\d+\.\d+%/);
350-
current.scenario.id = "unrecognized";
351-
assert.throws(() => validateResult(current), /not supported/);
352-
});

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
- name: Check generated GitHub GraphQL operations
9494
run: vp run --filter @t3tools/source-control-github generate --check
9595

96+
- name: Check generated Expo GraphQL operations
97+
run: vp run --filter t3 generate --check
98+
9699
- name: Check
97100
run: vp check
98101

@@ -249,6 +252,7 @@ jobs:
249252
250253
# The web suite is the largest outside the server. In the shared Test job it
251254
# started last and ran alone for about 40s after everything else finished.
255+
# release.yml mirrors this test, test_web, and test_server split.
252256
test_web:
253257
name: Test Web
254258
needs: changes
@@ -482,8 +486,6 @@ jobs:
482486
!/apps/mobile/modules/t3-terminal/Vendor/**/*.a
483487
sparse-checkout-cone-mode: false
484488

485-
# A full install: a filtered one that misses the cache first saves its
486-
# partial store under the shared lockfile key for every later job.
487489
- name: Setup Vite+
488490
uses: ./.github/actions/setup-ci-deps
489491

‎.github/workflows/cursor-hygiene-webhook.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Forward to Cursor hygiene
33
on:
44
push:
55
branches: [main]
6-
pull_request:
6+
# Use trusted workflow code and repository secrets for fork PRs.
7+
# Keep this job payload-only: never check out or run PR code.
8+
pull_request_target:
79
types: [opened, reopened, ready_for_review]
810
issues:
911
types: [opened, closed, reopened]
@@ -34,7 +36,7 @@ jobs:
3436
--output /dev/null --write-out '%{http_code}' \
3537
-H "Authorization: $AUTH" \
3638
-H "Content-Type: application/json" \
37-
-H "X-GitHub-Event: ${{ github.event_name }}" \
39+
-H "X-GitHub-Event: ${{ github.event_name == 'pull_request_target' && 'pull_request' || github.event_name }}" \
3840
-H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \
3941
--data-binary @"${{ github.event_path }}") || curl_status=$?
4042
if [ "$curl_status" -eq 0 ]; then

‎.github/workflows/deploy-relay.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
RELAY_TUNNEL_ZONE_NAME: ${{ vars.RELAY_TUNNEL_ZONE_NAME }}
4242
RELAY_TUNNEL_CLEANUP_MODE: ${{ vars.RELAY_TUNNEL_CLEANUP_MODE }}
4343
RELAY_LEGACY_TUNNEL_CLEANUP_MODE: ${{ vars.RELAY_LEGACY_TUNNEL_CLEANUP_MODE }}
44+
RELAY_ALERT_NOTIFIER_ID: ${{ vars.RELAY_ALERT_NOTIFIER_ID }}
45+
RELAY_WARNING_NOTIFIER_ID: ${{ vars.RELAY_WARNING_NOTIFIER_ID }}
4446
CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
4547
CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
4648
APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}

0 commit comments

Comments
 (0)