@rubytech/taskmaster 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build-info.json
CHANGED
|
@@ -138,7 +138,8 @@ export const updateHandlers = {
|
|
|
138
138
|
},
|
|
139
139
|
onStepComplete: (step) => {
|
|
140
140
|
const ok = step.exitCode === 0 || step.exitCode === null;
|
|
141
|
-
|
|
141
|
+
const logFn = ok ? log.info.bind(log) : log.error.bind(log);
|
|
142
|
+
logFn(`update step ${step.index + 1}/${step.total}: ${step.name} ${ok ? "ok" : `FAILED (exit ${step.exitCode})`} (${step.durationMs}ms)`);
|
|
142
143
|
context.broadcast("update.progress", {
|
|
143
144
|
phase: "step-done",
|
|
144
145
|
name: step.name,
|
|
@@ -176,7 +177,7 @@ export const updateHandlers = {
|
|
|
176
177
|
log.info(`software update completed (${result.mode}, ${result.durationMs}ms)`);
|
|
177
178
|
}
|
|
178
179
|
else {
|
|
179
|
-
log.
|
|
180
|
+
log.error(`software update ${result.status}: ${result.reason ?? "unknown"} (${result.mode}, ${result.durationMs}ms)`);
|
|
180
181
|
}
|
|
181
182
|
const payload = {
|
|
182
183
|
kind: "update",
|
|
@@ -8,7 +8,6 @@ import { detectGlobalInstallManagerForRoot, globalInstallArgs } from "./update-g
|
|
|
8
8
|
import { trimLogTail } from "./restart-sentinel.js";
|
|
9
9
|
const DEFAULT_TIMEOUT_MS = 20 * 60_000;
|
|
10
10
|
const MAX_LOG_CHARS = 8000;
|
|
11
|
-
const PREFLIGHT_MAX_COMMITS = 10;
|
|
12
11
|
const START_DIRS = ["cwd", "argv1", "process"];
|
|
13
12
|
/**
|
|
14
13
|
* Build an augmented PATH that includes common binary locations.
|
|
@@ -278,7 +277,9 @@ export async function runGatewayUpdate(opts = {}) {
|
|
|
278
277
|
const channel = opts.channel ?? "dev";
|
|
279
278
|
const branch = channel === "dev" ? await readBranchName(runCommand, gitRoot, timeoutMs) : null;
|
|
280
279
|
const needsCheckoutMain = channel === "dev" && branch !== DEV_BRANCH;
|
|
281
|
-
|
|
280
|
+
// Steps: clean check + [checkout main] + upstream check + fetch + rebase/checkout
|
|
281
|
+
// + install + build + ui:build + restore control-ui + doctor + rev-parse
|
|
282
|
+
gitTotalSteps = channel === "dev" ? (needsCheckoutMain ? 10 : 9) : 9;
|
|
282
283
|
const statusCheck = await runStep(step("clean check", ["git", "-C", gitRoot, "status", "--porcelain", "-uno", "--", ":!dist/control-ui/"], gitRoot));
|
|
283
284
|
steps.push(statusCheck);
|
|
284
285
|
const hasUncommittedChanges = statusCheck.stdoutTail && statusCheck.stdoutTail.trim().length > 0;
|
|
@@ -332,110 +333,7 @@ export async function runGatewayUpdate(opts = {}) {
|
|
|
332
333
|
}
|
|
333
334
|
const fetchStep = await runStep(step("git fetch", ["git", "-C", gitRoot, "fetch", "--all", "--prune", "--tags"], gitRoot));
|
|
334
335
|
steps.push(fetchStep);
|
|
335
|
-
const
|
|
336
|
-
steps.push(upstreamShaStep);
|
|
337
|
-
const upstreamSha = upstreamShaStep.stdoutTail?.trim();
|
|
338
|
-
if (!upstreamShaStep.stdoutTail || !upstreamSha) {
|
|
339
|
-
return {
|
|
340
|
-
status: "error",
|
|
341
|
-
mode: "git",
|
|
342
|
-
root: gitRoot,
|
|
343
|
-
reason: "no-upstream-sha",
|
|
344
|
-
before: { sha: beforeSha, version: beforeVersion },
|
|
345
|
-
steps,
|
|
346
|
-
durationMs: Date.now() - startedAt,
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
const revListStep = await runStep(step("git rev-list", ["git", "-C", gitRoot, "rev-list", `--max-count=${PREFLIGHT_MAX_COMMITS}`, upstreamSha], gitRoot));
|
|
350
|
-
steps.push(revListStep);
|
|
351
|
-
if (revListStep.exitCode !== 0) {
|
|
352
|
-
return {
|
|
353
|
-
status: "error",
|
|
354
|
-
mode: "git",
|
|
355
|
-
root: gitRoot,
|
|
356
|
-
reason: "preflight-revlist-failed",
|
|
357
|
-
before: { sha: beforeSha, version: beforeVersion },
|
|
358
|
-
steps,
|
|
359
|
-
durationMs: Date.now() - startedAt,
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
const candidates = (revListStep.stdoutTail ?? "")
|
|
363
|
-
.split("\n")
|
|
364
|
-
.map((line) => line.trim())
|
|
365
|
-
.filter(Boolean);
|
|
366
|
-
if (candidates.length === 0) {
|
|
367
|
-
return {
|
|
368
|
-
status: "error",
|
|
369
|
-
mode: "git",
|
|
370
|
-
root: gitRoot,
|
|
371
|
-
reason: "preflight-no-candidates",
|
|
372
|
-
before: { sha: beforeSha, version: beforeVersion },
|
|
373
|
-
steps,
|
|
374
|
-
durationMs: Date.now() - startedAt,
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
const manager = await detectPackageManager(gitRoot);
|
|
378
|
-
const preflightRoot = await fs.mkdtemp(path.join(os.tmpdir(), "taskmaster-update-preflight-"));
|
|
379
|
-
const worktreeDir = path.join(preflightRoot, "worktree");
|
|
380
|
-
const worktreeStep = await runStep(step("preflight worktree", ["git", "-C", gitRoot, "worktree", "add", "--detach", worktreeDir, upstreamSha], gitRoot));
|
|
381
|
-
steps.push(worktreeStep);
|
|
382
|
-
if (worktreeStep.exitCode !== 0) {
|
|
383
|
-
await fs.rm(preflightRoot, { recursive: true, force: true }).catch(() => { });
|
|
384
|
-
return {
|
|
385
|
-
status: "error",
|
|
386
|
-
mode: "git",
|
|
387
|
-
root: gitRoot,
|
|
388
|
-
reason: "preflight-worktree-failed",
|
|
389
|
-
before: { sha: beforeSha, version: beforeVersion },
|
|
390
|
-
steps,
|
|
391
|
-
durationMs: Date.now() - startedAt,
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
let selectedSha = null;
|
|
395
|
-
try {
|
|
396
|
-
for (const sha of candidates) {
|
|
397
|
-
const shortSha = sha.slice(0, 8);
|
|
398
|
-
const checkoutStep = await runStep(step(`preflight checkout (${shortSha})`, ["git", "-C", worktreeDir, "checkout", "--detach", sha], worktreeDir));
|
|
399
|
-
steps.push(checkoutStep);
|
|
400
|
-
if (checkoutStep.exitCode !== 0)
|
|
401
|
-
continue;
|
|
402
|
-
const depsStep = await runStep(step(`preflight deps install (${shortSha})`, managerInstallArgs(manager), worktreeDir));
|
|
403
|
-
steps.push(depsStep);
|
|
404
|
-
if (depsStep.exitCode !== 0)
|
|
405
|
-
continue;
|
|
406
|
-
const lintStep = await runStep(step(`preflight lint (${shortSha})`, managerScriptArgs(manager, "lint"), worktreeDir));
|
|
407
|
-
steps.push(lintStep);
|
|
408
|
-
if (lintStep.exitCode !== 0)
|
|
409
|
-
continue;
|
|
410
|
-
const buildStep = await runStep(step(`preflight build (${shortSha})`, managerScriptArgs(manager, "build"), worktreeDir));
|
|
411
|
-
steps.push(buildStep);
|
|
412
|
-
if (buildStep.exitCode !== 0)
|
|
413
|
-
continue;
|
|
414
|
-
selectedSha = sha;
|
|
415
|
-
break;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
finally {
|
|
419
|
-
const removeStep = await runStep(step("preflight cleanup", ["git", "-C", gitRoot, "worktree", "remove", "--force", worktreeDir], gitRoot));
|
|
420
|
-
steps.push(removeStep);
|
|
421
|
-
await runCommand(["git", "-C", gitRoot, "worktree", "prune"], {
|
|
422
|
-
cwd: gitRoot,
|
|
423
|
-
timeoutMs,
|
|
424
|
-
}).catch(() => null);
|
|
425
|
-
await fs.rm(preflightRoot, { recursive: true, force: true }).catch(() => { });
|
|
426
|
-
}
|
|
427
|
-
if (!selectedSha) {
|
|
428
|
-
return {
|
|
429
|
-
status: "error",
|
|
430
|
-
mode: "git",
|
|
431
|
-
root: gitRoot,
|
|
432
|
-
reason: "preflight-no-good-commit",
|
|
433
|
-
before: { sha: beforeSha, version: beforeVersion },
|
|
434
|
-
steps,
|
|
435
|
-
durationMs: Date.now() - startedAt,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
const rebaseStep = await runStep(step("git rebase", ["git", "-C", gitRoot, "rebase", selectedSha], gitRoot));
|
|
336
|
+
const rebaseStep = await runStep(step("git rebase", ["git", "-C", gitRoot, "rebase", "@{upstream}"], gitRoot));
|
|
439
337
|
steps.push(rebaseStep);
|
|
440
338
|
if (rebaseStep.exitCode !== 0) {
|
|
441
339
|
const abortResult = await runCommand(["git", "-C", gitRoot, "rebase", "--abort"], {
|