@mutmutco/cli 4.5.191 → 4.5.193
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/main.cjs +52 -10
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -19193,10 +19193,10 @@ var rollout_plan_default = {
|
|
|
19193
19193
|
note: "The v4.0.0 stamp happens at cut time (D6e #4463); until then the candidate is the origin/development head artifacts (built cli/dist + npm pack), identity proven by dist content hash (D6a)."
|
|
19194
19194
|
},
|
|
19195
19195
|
baseline: {
|
|
19196
|
-
version: "4.5.
|
|
19197
|
-
tag: "v4.5.
|
|
19198
|
-
commit: "
|
|
19199
|
-
npm: "@mutmutco/cli@4.5.
|
|
19196
|
+
version: "4.5.193",
|
|
19197
|
+
tag: "v4.5.193",
|
|
19198
|
+
commit: "8a9085b5492f",
|
|
19199
|
+
npm: "@mutmutco/cli@4.5.193"
|
|
19200
19200
|
},
|
|
19201
19201
|
exitCriterion: "fleet-n-of-n",
|
|
19202
19202
|
hubOnlyShortcut: "forbidden",
|
|
@@ -19213,14 +19213,14 @@ var rollout_plan_default = {
|
|
|
19213
19213
|
repo: "mutmutco/mmi-hub",
|
|
19214
19214
|
role: "canary",
|
|
19215
19215
|
schedule: "train",
|
|
19216
|
-
v3Target: "v4.5.
|
|
19216
|
+
v3Target: "v4.5.193"
|
|
19217
19217
|
}
|
|
19218
19218
|
],
|
|
19219
19219
|
rollbackTrigger: "Any red inside the post-contract soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a pre-v4 client admitted instead of receiving actionable HTTP 426, or npm consumer install/doctor failure on the v4-only dist.",
|
|
19220
19220
|
rollback: {
|
|
19221
19221
|
independent: true,
|
|
19222
|
-
mechanism: "npm dist-tag latest -> 4.5.
|
|
19223
|
-
v3Target: "v4.5.
|
|
19222
|
+
mechanism: "npm dist-tag latest -> 4.5.193 and redeploy the Hub Lambda from tag v4.5.193 (8a9085b5492f); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
19223
|
+
v3Target: "v4.5.193 (@mutmutco/cli@4.5.193, tag commit 8a9085b5492f \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
19224
19224
|
}
|
|
19225
19225
|
},
|
|
19226
19226
|
{
|
|
@@ -33363,15 +33363,49 @@ function planRemoteScript(dests) {
|
|
|
33363
33363
|
lines2.push(`if [ -f '${d}' ]; then printf '%s %s %s\\n' "$(md5sum < '${d}' | cut -d' ' -f1)" "$(stat -c %a '${d}')" '${d}'; else printf 'MISSING - %s\\n' '${d}'; fi`);
|
|
33364
33364
|
}
|
|
33365
33365
|
lines2.push(`for f in ${ALERT_DIR}/*; do [ -f "$f" ] && printf 'ALERT %s %s\\n' "$(basename "$f")" "$(head -c 300 "$f" | tr '\\n' ' ')"; done; true`);
|
|
33366
|
+
lines2.push(`if command -v needrestart >/dev/null 2>&1 && nr_out=$(needrestart -b -r l 2>/dev/null); then printf 'PENDING_RESTART_STATUS ok\\n'; printf '%s\\n' "$nr_out" | sed -n 's/^NEEDRESTART-SVC:[[:space:]]*/PENDING_RESTART /p'; else printf 'PENDING_RESTART_STATUS unavailable\\n'; fi; true`);
|
|
33366
33367
|
return `${lines2.join("\n")}
|
|
33367
33368
|
`;
|
|
33368
33369
|
}
|
|
33369
33370
|
var ALERT_DIR = "/var/lib/mmi-control/alerts";
|
|
33371
|
+
var SUPPRESSED_RUNNER_PRIVATE_KEY_GLOB = "*/.local/share/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs/snapshots/*/fs/etc/ssl/private/ssl-cert-snakeoil.key";
|
|
33372
|
+
var SUPPRESSED_RUNNER_PRIVATE_KEY_RE = new RegExp(
|
|
33373
|
+
`^${SUPPRESSED_RUNNER_PRIVATE_KEY_GLOB.split("*").map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(".*")}$`
|
|
33374
|
+
);
|
|
33375
|
+
function isSuppressedRunnerPrivateKeyPath(p) {
|
|
33376
|
+
return SUPPRESSED_RUNNER_PRIVATE_KEY_RE.test(p.trim());
|
|
33377
|
+
}
|
|
33370
33378
|
function parseAlerts(output) {
|
|
33371
33379
|
const out = [];
|
|
33372
33380
|
for (const line of output.split("\n")) {
|
|
33373
33381
|
const m = /^ALERT ([A-Za-z0-9._-]+) ?(.*)$/.exec(line.trim());
|
|
33374
|
-
if (m)
|
|
33382
|
+
if (!m) continue;
|
|
33383
|
+
const name = m[1];
|
|
33384
|
+
let message2 = m[2].trim();
|
|
33385
|
+
if (name === "runner-private-key") {
|
|
33386
|
+
const pm = /^(\d+)( private key file\(s\) readable by every CI job on this box \(#7535\): )(.+)$/.exec(message2);
|
|
33387
|
+
if (pm) {
|
|
33388
|
+
const kept = pm[3].trim().split(/\s+/).filter((p) => p && !isSuppressedRunnerPrivateKeyPath(p));
|
|
33389
|
+
if (kept.length === 0) continue;
|
|
33390
|
+
message2 = `${kept.length}${pm[2]}${kept.join(" ")}`;
|
|
33391
|
+
}
|
|
33392
|
+
}
|
|
33393
|
+
out.push({ name, message: message2 });
|
|
33394
|
+
}
|
|
33395
|
+
return out;
|
|
33396
|
+
}
|
|
33397
|
+
function parsePendingRestartStatus(output) {
|
|
33398
|
+
for (const line of output.split("\n")) {
|
|
33399
|
+
if (line.trim() === "PENDING_RESTART_STATUS ok") return "ok";
|
|
33400
|
+
if (line.trim() === "PENDING_RESTART_STATUS unavailable") return "unavailable";
|
|
33401
|
+
}
|
|
33402
|
+
return "unavailable";
|
|
33403
|
+
}
|
|
33404
|
+
function parsePendingRestarts(output) {
|
|
33405
|
+
const out = [];
|
|
33406
|
+
for (const line of output.split("\n")) {
|
|
33407
|
+
const m = /^PENDING_RESTART ([A-Za-z0-9@_.:-]+)$/.exec(line.trim());
|
|
33408
|
+
if (m && !out.includes(m[1])) out.push(m[1]);
|
|
33375
33409
|
}
|
|
33376
33410
|
return out;
|
|
33377
33411
|
}
|
|
@@ -35240,9 +35274,17 @@ ${SSH_RECIPE_AGENT_NOTE}`);
|
|
|
35240
35274
|
const drift = results.filter((r) => r.status !== "in-sync").length;
|
|
35241
35275
|
const unread = results.some((r) => r.status === "unread");
|
|
35242
35276
|
const alerts = parseAlerts(output);
|
|
35243
|
-
const
|
|
35277
|
+
const pendingRestartsStatus = parsePendingRestartStatus(output);
|
|
35278
|
+
const pendingRestarts = parsePendingRestarts(output);
|
|
35279
|
+
const payload = { box: found.box.name, ref: o.ref, mode: o.apply ? "apply" : "plan", files: results, drift, alerts, pendingRestartsStatus, pendingRestarts, ok: drift === 0 && alerts.length === 0 };
|
|
35244
35280
|
if (o.json) console.log(JSON.stringify(payload, null, 2));
|
|
35245
|
-
else
|
|
35281
|
+
else {
|
|
35282
|
+
console.log([
|
|
35283
|
+
formatControl(payload.mode, found.box.name, results),
|
|
35284
|
+
...alerts.map((a) => `ALERT ${a.name}: ${a.message}`),
|
|
35285
|
+
...pendingRestartsStatus === "unavailable" ? ["PENDING_RESTART: unavailable (needrestart probe missing or failed)"] : pendingRestarts.length ? [`PENDING_RESTART: ${pendingRestarts.join(", ")}`] : []
|
|
35286
|
+
].join("\n"));
|
|
35287
|
+
}
|
|
35246
35288
|
process.exitCode = unread ? 2 : drift || alerts.length ? 1 : 0;
|
|
35247
35289
|
} catch (e) {
|
|
35248
35290
|
if (o.json) console.log(JSON.stringify({ box: name, ref: o.ref, ok: false, error: e.message }, null, 2));
|
package/package.json
CHANGED