Skip to content

Commit 708767e

Browse files
only21milclaude
andcommitted
fix(ci): a change to the T3 Connect troubleshooting guide runs the server test that reads it
ci-changes.cjs treats everything under docs/ as inert, but ConnectReachability.test.ts checks that each troubleshooting section names a heading in docs/user/t3-connect-troubleshooting.md. A docs-only PR that renames one of those headings skipped the server tests, so main's own full run failed after it merged. The guide now maps to the server package, and check:changed runs that test when the guide changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 15fe283 commit 708767e

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎.github/scripts/ci-changes.cjs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const EXTRA_OWNERS = [
2727
[/^native\/browser-secret\//, ["@t3tools/desktop"]],
2828
[/^native\/kde-snap-shot\//, ["@t3tools/desktop"]],
2929
[/^native\/libghostty-vt\//, ["@t3tools/web"]],
30+
// apps/server/src/cloud/ConnectReachability.test.ts checks the guide's headings.
31+
[/^docs\/user\/t3-connect-troubleshooting\.md$/, ["t3"]],
3032
];
3133
const RUST = /^native\/(resource-monitor|kde-snap-shot|hyprland-snap-shot)\//;
3234

@@ -92,11 +94,11 @@ function readWorkspace() {
9294

9395
// [] means inert; null means unknown and requires every job.
9496
function ownersOf(file, packages) {
95-
if (INERT.some((pattern) => pattern.test(file))) return [];
97+
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
98+
if (INERT.some((pattern) => pattern.test(file))) return extra;
9699
// A manifest can change dependencies or versions other packages read.
97100
if (path.posix.basename(file) === "package.json") return null;
98101
if (RUNS_EVERYTHING.some((pattern) => pattern.test(file))) return null;
99-
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
100102
// scripts/build-desktop-artifact.test.ts reads the crates' sources.
101103
if (RUST.test(file)) return ["@t3tools/scripts", ...extra];
102104

‎scripts/check-changed.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
runSteps,
2222
type Step,
2323
} from "./check-changed.ts";
24+
import { decide, readWorkspace } from "../.github/scripts/ci-changes.cjs";
2425

2526
const GiB = 1024 ** 3;
2627

@@ -33,6 +34,14 @@ describe("check:changed", () => {
3334
assert.strictEqual(defaultConcurrency(1, 64 * GiB), 1);
3435
});
3536

37+
it("runs the server tests for the one guide they read and leaves other docs inert", () => {
38+
const packages = readWorkspace();
39+
assert.isTrue(
40+
decide(["docs/user/t3-connect-troubleshooting.md"], packages, false).outputs.test_server,
41+
);
42+
assert.deepStrictEqual(decide(["docs/user/install.md"], packages, false).affected, []);
43+
});
44+
3645
it.effect(
3746
"keeps weighted steps within the budget, in order, and serial steps one at a time",
3847
() =>

‎scripts/check-changed.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ const checkChanged = Effect.fn("checkChanged")(function* (input: {
312312
// It reads files other than the ones beside it, so no changed file selects it.
313313
if (affected.includes("t3")) tests.add("apps/server/src/provider/AgentContextBudget.test.ts");
314314

315+
if (files.includes("docs/user/t3-connect-troubleshooting.md")) {
316+
tests.add("apps/server/src/cloud/ConnectReachability.test.ts");
317+
}
318+
315319
// React Compiler coverage compiles every client source file, so run only the
316320
// changed files' cases, in one extra step: a -t filter in the main test step
317321
// would drop every other test. An app is skipped when the main step already

0 commit comments

Comments
 (0)