@mutmutco/cli 3.105.9 → 3.105.10
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 +45 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -20528,6 +20528,46 @@ async function cherryPickWithToleratedPaths(deps, sha, tolerated) {
|
|
|
20528
20528
|
return unmerged;
|
|
20529
20529
|
}
|
|
20530
20530
|
}
|
|
20531
|
+
function parseCherryPickBlockingPaths(message) {
|
|
20532
|
+
const m = /conflicted on untolerated path\(s\): ([^(]+)/.exec(message);
|
|
20533
|
+
if (!m) return [];
|
|
20534
|
+
return m[1].split(",").map((s) => s.trim()).filter(Boolean);
|
|
20535
|
+
}
|
|
20536
|
+
function formatHotfixBatchPreflightRefusal(failures, fromSpecs) {
|
|
20537
|
+
const lines = failures.map((f) => ` - ${f.label}: ${f.blocking.join(", ")}`);
|
|
20538
|
+
const batchFrom = fromSpecs.join(",");
|
|
20539
|
+
return `hotfix start batch preflight refused: ${failures.length} pick(s) would hard-stop on origin/main:
|
|
20540
|
+
${lines.join("\n")}
|
|
20541
|
+
Land ONE main-clean synthesis development PR for the whole batch (cut from origin/main, resolve every listed conflict for cherry-pick onto current origin/main, land to development \u2014 pattern #4467), then rerun \`mmi-cli hotfix start --from ${batchFrom}\` with the port merge SHA(s) \u2014 never hand-resolve onto main; never N serial main-clean ports (#3167).`;
|
|
20542
|
+
}
|
|
20543
|
+
async function preflightHotfixBatchPicks(deps, sources, pickTolerated) {
|
|
20544
|
+
if (sources.length === 0) return [];
|
|
20545
|
+
const startBranch = clean3(await deps.run("git", ["rev-parse", "--abbrev-ref", "HEAD"]));
|
|
20546
|
+
const preflightBranch = `__mmi_hotfix_preflight_${Date.now()}`;
|
|
20547
|
+
const failures = [];
|
|
20548
|
+
try {
|
|
20549
|
+
await deps.run("git", ["checkout", "-B", preflightBranch, "origin/main"]);
|
|
20550
|
+
for (const source of sources) {
|
|
20551
|
+
try {
|
|
20552
|
+
await cherryPickWithToleratedPaths(deps, source.sha, pickTolerated);
|
|
20553
|
+
} catch (e) {
|
|
20554
|
+
const message = e.message ?? String(e);
|
|
20555
|
+
const blocking = parseCherryPickBlockingPaths(message);
|
|
20556
|
+
failures.push({
|
|
20557
|
+
label: source.label,
|
|
20558
|
+
sha: source.sha,
|
|
20559
|
+
blocking: blocking.length > 0 ? blocking : [message.split("\n")[0] ?? message]
|
|
20560
|
+
});
|
|
20561
|
+
}
|
|
20562
|
+
}
|
|
20563
|
+
} finally {
|
|
20564
|
+
if (startBranch && startBranch !== "HEAD") {
|
|
20565
|
+
await deps.run("git", ["checkout", startBranch]).catch(() => void 0);
|
|
20566
|
+
}
|
|
20567
|
+
await deps.run("git", ["branch", "-D", preflightBranch]).catch(() => void 0);
|
|
20568
|
+
}
|
|
20569
|
+
return failures;
|
|
20570
|
+
}
|
|
20531
20571
|
async function restoreAfterFailedPort(deps, opts) {
|
|
20532
20572
|
const { startBranch, branch, created } = opts;
|
|
20533
20573
|
if (!startBranch || startBranch === "HEAD" || startBranch === branch) {
|
|
@@ -20667,7 +20707,7 @@ async function runHotfixStart(deps, options) {
|
|
|
20667
20707
|
}
|
|
20668
20708
|
const label = sources.map((s) => s.label).join(", ");
|
|
20669
20709
|
const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
|
|
20670
|
-
const pickTolerated = deployModel === "hub-serverless" ? [...foldPaths, ...HOTFIX_SKILL_TOLERATED_ROOTS] : foldPaths;
|
|
20710
|
+
const pickTolerated = deployModel === "hub-serverless" || deployModel === "registry-publish" ? [...foldPaths, ...HOTFIX_SKILL_TOLERATED_ROOTS] : foldPaths;
|
|
20671
20711
|
if (deployModel === "hub-serverless") {
|
|
20672
20712
|
await deps.run("node", ["scripts/release-distribution.mjs", "verify-deps"]);
|
|
20673
20713
|
}
|
|
@@ -20677,6 +20717,10 @@ async function runHotfixStart(deps, options) {
|
|
|
20677
20717
|
await deps.run("git", ["pull", "--ff-only", "origin", branch]);
|
|
20678
20718
|
notes.push(`branch ${branch} already on origin \u2014 reused (cherry-pick/bump assumed present; PR step resumes)`);
|
|
20679
20719
|
} else {
|
|
20720
|
+
const preflightFailures = await preflightHotfixBatchPicks(deps, sources, pickTolerated);
|
|
20721
|
+
if (preflightFailures.length > 0) {
|
|
20722
|
+
throw new Error(formatHotfixBatchPreflightRefusal(preflightFailures, specs));
|
|
20723
|
+
}
|
|
20680
20724
|
const startBranch = clean3(await deps.run("git", ["rev-parse", "--abbrev-ref", "HEAD"]));
|
|
20681
20725
|
const preexistingLocal = clean3(await deps.run("git", ["branch", "--list", branch]));
|
|
20682
20726
|
await deps.run("git", ["checkout", "-B", branch, "origin/main"]);
|
package/package.json
CHANGED