Skip to content

Commit 7dad948

Browse files
committed
fix: preserve worker routing prerequisites
1 parent 2bd42f6 commit 7dad948

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

‎scripts/check-changed.mts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,17 @@ export function shouldDelegateChangedCheckToCrabbox(
271271
return false;
272272
}
273273
const result = options.result;
274-
if (result?.paths.length === 0) {
274+
if (!result) {
275+
return true;
276+
}
277+
if (result.paths.length === 0) {
275278
return false;
276279
}
277280
if (isOpenEndedTruthyValue(env.OPENCLAW_TESTBOX)) {
278281
return true;
279282
}
280283
if (isDedicatedLinuxWorker(env, options)) {
281-
return false;
282-
}
283-
if (!result) {
284-
return true;
284+
return !changedCheckLocalDependenciesReady(options.cwd ?? process.cwd());
285285
}
286286
// Release metadata plans diff the supplied commits after classification. A missing
287287
// ref needs the hydrated remote checkout even when the explicit path itself is cheap.

‎test/scripts/changed-lanes.test.ts‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,32 @@ describe("scripts/changed-lanes", () => {
12421242
});
12431243

12441244
it("runs trusted changed gates on a dedicated Linux worker", () => {
1245+
const dir = makeTempRepoRoot(tempDirs, "openclaw-check-changed-worker-route-");
12451246
const result = detectChangedLanes(["src/config/config.ts"]);
1246-
const detectedWorker = { platform: "linux" as const, result, virtualized: true };
1247+
const detectedWorker = {
1248+
cwd: dir,
1249+
interactive: false,
1250+
platform: "linux" as const,
1251+
result,
1252+
virtualized: true,
1253+
};
1254+
1255+
expect(
1256+
shouldDelegateChangedCheckToCrabbox(
1257+
[],
1258+
{},
1259+
{
1260+
interactive: false,
1261+
platform: "linux",
1262+
virtualized: true,
1263+
},
1264+
),
1265+
).toBe(true);
1266+
expect(shouldDelegateChangedCheckToCrabbox([], {}, detectedWorker)).toBe(true);
1267+
1268+
writeRepoFile(dir, "node_modules/.modules.yaml", "layoutVersion: 5\n");
1269+
writeRepoFile(dir, "node_modules/.bin/oxfmt", "#!/bin/sh\n");
1270+
writeRepoFile(dir, "node_modules/typescript/package.json", '{"name":"typescript"}\n');
12471271

12481272
expect(shouldDelegateChangedCheckToCrabbox([], {}, detectedWorker)).toBe(false);
12491273
expect(

0 commit comments

Comments
 (0)