@mutmutco/cli 3.48.0 → 3.48.1
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 +24 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -14506,6 +14506,24 @@ async function deriveHotfixVersion(deps) {
|
|
|
14506
14506
|
function hotfixBranch(tag) {
|
|
14507
14507
|
return `hotfix/${tag}`;
|
|
14508
14508
|
}
|
|
14509
|
+
async function restoreAfterFailedPort(deps, opts) {
|
|
14510
|
+
const { startBranch, branch, created } = opts;
|
|
14511
|
+
if (!startBranch || startBranch === "HEAD" || startBranch === branch) {
|
|
14512
|
+
return `Local state left as-is (could not determine the branch to return to).`;
|
|
14513
|
+
}
|
|
14514
|
+
try {
|
|
14515
|
+
await deps.run("git", ["checkout", startBranch]);
|
|
14516
|
+
} catch {
|
|
14517
|
+
return `Could NOT return to ${startBranch} \u2014 the checkout is still on ${branch} (origin/main content); switch back before editing anything.`;
|
|
14518
|
+
}
|
|
14519
|
+
if (!created) return `Returned to ${startBranch}; the pre-existing local ${branch} was left in place.`;
|
|
14520
|
+
try {
|
|
14521
|
+
await deps.run("git", ["branch", "-D", branch]);
|
|
14522
|
+
return `Returned to ${startBranch} and removed the local ${branch}.`;
|
|
14523
|
+
} catch {
|
|
14524
|
+
return `Returned to ${startBranch}; the local ${branch} could not be removed \u2014 delete it by hand.`;
|
|
14525
|
+
}
|
|
14526
|
+
}
|
|
14509
14527
|
async function resolveHotfixDeployModel(deps, ctx) {
|
|
14510
14528
|
const load = await loadProjectMeta(deps, ctx);
|
|
14511
14529
|
const meta = requireProjectMetaForTrain(load, ctx.repo);
|
|
@@ -14604,12 +14622,17 @@ async function runHotfixStart(deps, options) {
|
|
|
14604
14622
|
await deps.run("git", ["pull", "--ff-only", "origin", branch]);
|
|
14605
14623
|
notes.push(`branch ${branch} already on origin \u2014 reused (cherry-pick/bump assumed present; PR step resumes)`);
|
|
14606
14624
|
} else {
|
|
14625
|
+
const startBranch = clean3(await deps.run("git", ["rev-parse", "--abbrev-ref", "HEAD"]));
|
|
14626
|
+
const preexistingLocal = clean3(await deps.run("git", ["branch", "--list", branch]));
|
|
14607
14627
|
await deps.run("git", ["checkout", "-B", branch, "origin/main"]);
|
|
14608
14628
|
try {
|
|
14609
14629
|
await deps.run("git", ["cherry-pick", "-x", sha]);
|
|
14610
14630
|
} catch (e) {
|
|
14611
14631
|
await deps.run("git", ["cherry-pick", "--abort"]);
|
|
14612
|
-
|
|
14632
|
+
const recovery = await restoreAfterFailedPort(deps, { startBranch, branch, created: !preexistingLocal });
|
|
14633
|
+
throw new Error(
|
|
14634
|
+
`cherry-pick of ${label} onto ${branch} conflicted \u2014 aborted; nothing was pushed. Land the conflict resolution on development through a normal PR, then rerun \`mmi-cli hotfix start --from <that PR's merge sha>\` \u2014 never hand-resolve the port onto main. ${recovery} (${e.message ?? e})`
|
|
14635
|
+
);
|
|
14613
14636
|
}
|
|
14614
14637
|
notes.push(`cherry-picked ${label} onto ${branch} (from origin/main, -x trailer recorded)`);
|
|
14615
14638
|
if (deployModel === "hub-serverless") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutmutco/cli",
|
|
3
|
-
"version": "3.48.
|
|
3
|
+
"version": "3.48.1",
|
|
4
4
|
"description": "MMI Future CLI — the org dev toolbox (board, registry, keyless secrets, release train, bootstrap, doctor) and the cross-IDE engine the plugin's session-start hook drives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|