@pushpalsdev/cli 1.0.70 → 1.0.72
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/pushpals-cli.js +44 -7
- package/package.json +1 -1
package/dist/pushpals-cli.js
CHANGED
|
@@ -2983,17 +2983,20 @@ async function resolveSourceControlManagerGitProbe(cwd, env, platform = process.
|
|
|
2983
2983
|
detail: candidates.join(", ") || "git"
|
|
2984
2984
|
};
|
|
2985
2985
|
}
|
|
2986
|
-
async function resolveWorkerpalDockerProbe(cwd, env, platform = process.platform) {
|
|
2987
|
-
const
|
|
2988
|
-
if (
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2986
|
+
async function resolveWorkerpalDockerProbe(cwd, env, platform = process.platform, runCommandWithEnvFn = runCommandWithEnv) {
|
|
2987
|
+
const preconfiguredDockerBinary = env.PUSHPALS_DOCKER_BIN_ABSOLUTE ?? env.PUSHPALS_DOCKER_BIN;
|
|
2988
|
+
if (preconfiguredDockerBinary) {
|
|
2989
|
+
applyResolvedDockerBinaryToRuntimeEnv(env, preconfiguredDockerBinary, platform);
|
|
2990
|
+
} else {
|
|
2991
|
+
const resolvedDockerBinary = await resolveCommandPath(platform === "win32" ? "docker.exe" : "docker", cwd, env);
|
|
2992
|
+
if (resolvedDockerBinary) {
|
|
2993
|
+
applyResolvedDockerBinaryToRuntimeEnv(env, resolvedDockerBinary, platform);
|
|
2994
|
+
}
|
|
2992
2995
|
}
|
|
2993
2996
|
const candidates = resolveRuntimeDockerExecutableCandidates(env, platform);
|
|
2994
2997
|
const failures = [];
|
|
2995
2998
|
for (const candidate of candidates) {
|
|
2996
|
-
const result = await
|
|
2999
|
+
const result = await runCommandWithEnvFn([candidate, "version", "--format", "{{.Server.Version}}"], cwd, env, DOCKER_VERSION_PROBE_TIMEOUT_MS);
|
|
2997
3000
|
if (result.ok) {
|
|
2998
3001
|
const version = result.stdout.trim();
|
|
2999
3002
|
return {
|
|
@@ -3068,6 +3071,13 @@ async function cleanupLingeringWorkerpalWarmContainers(opts) {
|
|
|
3068
3071
|
removed: 0
|
|
3069
3072
|
};
|
|
3070
3073
|
}
|
|
3074
|
+
if (isDockerCleanupTimeoutDetail(detail)) {
|
|
3075
|
+
return {
|
|
3076
|
+
ok: true,
|
|
3077
|
+
detail: `docker cleanup timed out; skipped WorkerPal warm-container cleanup: ${detail}`,
|
|
3078
|
+
removed: 0
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3071
3081
|
return {
|
|
3072
3082
|
ok: false,
|
|
3073
3083
|
detail: `failed to inspect lingering WorkerPal warm containers: ${detail}`,
|
|
@@ -3085,6 +3095,20 @@ async function cleanupLingeringWorkerpalWarmContainers(opts) {
|
|
|
3085
3095
|
const remove = await runCommandWithEnvFn([dockerExecutable, "rm", "-f", ...containerIds], opts.repoRoot, opts.env, commandTimeoutMs);
|
|
3086
3096
|
if (!remove.ok) {
|
|
3087
3097
|
const detail = remove.stderr || remove.stdout || `exit ${remove.exitCode}`;
|
|
3098
|
+
if (isDockerUnavailableDetail(detail)) {
|
|
3099
|
+
return {
|
|
3100
|
+
ok: true,
|
|
3101
|
+
detail: `docker unavailable; skipped WorkerPal warm-container cleanup: ${detail}`,
|
|
3102
|
+
removed: 0
|
|
3103
|
+
};
|
|
3104
|
+
}
|
|
3105
|
+
if (isDockerCleanupTimeoutDetail(detail)) {
|
|
3106
|
+
return {
|
|
3107
|
+
ok: true,
|
|
3108
|
+
detail: `docker cleanup timed out; skipped WorkerPal warm-container cleanup: ${detail}`,
|
|
3109
|
+
removed: 0
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3088
3112
|
return {
|
|
3089
3113
|
ok: false,
|
|
3090
3114
|
detail: `failed to remove lingering WorkerPal warm containers: ${detail}`,
|
|
@@ -3129,6 +3153,14 @@ async function cleanupLocalWorkerpalSandboxImage(opts) {
|
|
|
3129
3153
|
imageName
|
|
3130
3154
|
};
|
|
3131
3155
|
}
|
|
3156
|
+
if (isDockerCleanupTimeoutDetail(detail)) {
|
|
3157
|
+
return {
|
|
3158
|
+
ok: true,
|
|
3159
|
+
detail: `docker cleanup timed out; skipped WorkerPal sandbox image cleanup: ${detail}`,
|
|
3160
|
+
removed: false,
|
|
3161
|
+
imageName
|
|
3162
|
+
};
|
|
3163
|
+
}
|
|
3132
3164
|
return {
|
|
3133
3165
|
ok: false,
|
|
3134
3166
|
detail: `failed to remove local WorkerPal sandbox image ${imageName}: ${detail}`,
|
|
@@ -3228,6 +3260,9 @@ async function cleanupLingeringPushPalsGitWorktrees(opts) {
|
|
|
3228
3260
|
function isMissingDockerImageDetail(detail) {
|
|
3229
3261
|
return /\b(no such object|no such image|not found)\b/i.test(String(detail ?? ""));
|
|
3230
3262
|
}
|
|
3263
|
+
function isDockerCleanupTimeoutDetail(detail) {
|
|
3264
|
+
return /\btimed out after \d+ms\b/i.test(String(detail ?? ""));
|
|
3265
|
+
}
|
|
3231
3266
|
function isDockerUnavailableDetail(detail) {
|
|
3232
3267
|
const text = String(detail ?? "");
|
|
3233
3268
|
return /cannot connect to (the )?docker daemon/i.test(text) || /docker daemon is not running/i.test(text) || /failed to connect to the docker api/i.test(text) || /docker_engine/i.test(text) || /is the docker daemon running/i.test(text) || /docker(?:\.exe)?: command not found/i.test(text) || /spawn\s+docker(?:\.exe)?\s+ENOENT/i.test(text) || /docker(?:\.exe)?'?\s+is not recognized as an internal or external command/i.test(text);
|
|
@@ -5420,6 +5455,7 @@ export {
|
|
|
5420
5455
|
shutdownEmbeddedServiceManagerGracefully,
|
|
5421
5456
|
shouldRunEmbeddedRuntimeStartupPrechecks,
|
|
5422
5457
|
shouldRestartEmbeddedService,
|
|
5458
|
+
resolveWorkerpalDockerProbe,
|
|
5423
5459
|
resolveWorkerExecutionReadiness,
|
|
5424
5460
|
resolveWindowsWhereExecutableCandidatesForEnv,
|
|
5425
5461
|
resolveWindowsShellExecutableCandidatesForEnv,
|
|
@@ -5441,6 +5477,7 @@ export {
|
|
|
5441
5477
|
normalizeCliInteractiveMessage,
|
|
5442
5478
|
normalizeChildProcessEnv,
|
|
5443
5479
|
isDockerUnavailableDetail,
|
|
5480
|
+
isDockerCleanupTimeoutDetail,
|
|
5444
5481
|
isCliExitCommand,
|
|
5445
5482
|
injectMonitoringHubBootstrap,
|
|
5446
5483
|
formatWorkerExecutionReadinessLines,
|