@mutmutco/cli 4.6.48 → 4.6.49
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 +943 -384
- package/dist/runbook-sweep.cjs +36 -1
- package/package.json +1 -1
package/dist/runbook-sweep.cjs
CHANGED
|
@@ -7856,6 +7856,11 @@ function loadBootstrapSeeds(manifestJson) {
|
|
|
7856
7856
|
if (s.ownership !== "org" && s.ownership !== "repo") {
|
|
7857
7857
|
throw new Error(`invalid seed ownership '${s.ownership}' for ${s.target} (must be 'org' or 'repo')`);
|
|
7858
7858
|
}
|
|
7859
|
+
if (s.repos !== void 0) {
|
|
7860
|
+
if (!Array.isArray(s.repos) || s.repos.length === 0 || s.repos.some((r) => typeof r !== "string" || !r.trim() || r.includes("/"))) {
|
|
7861
|
+
throw new Error(`invalid repos scope for ${s.target} (needs a non-empty list of repo slugs, no owner prefix): ${JSON.stringify(s.repos)}`);
|
|
7862
|
+
}
|
|
7863
|
+
}
|
|
7859
7864
|
if (s.managedBlock) {
|
|
7860
7865
|
const block = s.managedBlock;
|
|
7861
7866
|
if (!block.source || !block.begin || !block.end || block.begin === block.end || /[\r\n]/.test(block.begin + block.end)) {
|
|
@@ -13034,11 +13039,41 @@ async function reverifyPersistedRunPhases(deps, path2, anchors, input) {
|
|
|
13034
13039
|
function alignmentPrNumbers(note) {
|
|
13035
13040
|
return [...new Set([...(note ?? "").matchAll(/\/pull\/(\d+)/g)].map((m) => Number.parseInt(m[1], 10)))];
|
|
13036
13041
|
}
|
|
13042
|
+
function alignmentHeadBranches(tag) {
|
|
13043
|
+
return [
|
|
13044
|
+
{ target: "development", head: `release-align/development/${tag}` },
|
|
13045
|
+
{ target: "rc", head: `release-align/rc/${tag}` }
|
|
13046
|
+
];
|
|
13047
|
+
}
|
|
13048
|
+
async function alignmentLegClosedByHead(deps, prior) {
|
|
13049
|
+
const found = [];
|
|
13050
|
+
for (const { target, head } of alignmentHeadBranches(prior.tag)) {
|
|
13051
|
+
let rows;
|
|
13052
|
+
try {
|
|
13053
|
+
rows = JSON.parse(await deps.run("gh", ["pr", "list", "--repo", prior.repo, "--head", head, "--state", "all", "--json", "number,state"]));
|
|
13054
|
+
} catch {
|
|
13055
|
+
return void 0;
|
|
13056
|
+
}
|
|
13057
|
+
if (!Array.isArray(rows)) return void 0;
|
|
13058
|
+
for (const row of rows) {
|
|
13059
|
+
if (typeof row?.number !== "number" || !Number.isInteger(row.number) || typeof row.state !== "string") return void 0;
|
|
13060
|
+
if (row.state !== "MERGED") return void 0;
|
|
13061
|
+
found.push({ target, head, number: row.number });
|
|
13062
|
+
}
|
|
13063
|
+
}
|
|
13064
|
+
if (!found.some((f) => f.target === "development")) return void 0;
|
|
13065
|
+
const named = found.map((f) => `#${f.number} (head \`${f.head}\`)`).join(", ");
|
|
13066
|
+
return {
|
|
13067
|
+
state: "complete",
|
|
13068
|
+
note: `alignment: already-merged \u2014 alignment PR ${named} merged on GitHub after the train returned; the leg named no PR, so the PR was found by its head branch; closed live at the next pre-flight (#10212)`,
|
|
13069
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
13070
|
+
};
|
|
13071
|
+
}
|
|
13037
13072
|
async function alignmentLegClosedLive(deps, prior) {
|
|
13038
13073
|
const leg = prior.phases.alignment;
|
|
13039
13074
|
if (leg.state !== "pending") return void 0;
|
|
13040
13075
|
const numbers = alignmentPrNumbers(leg.note);
|
|
13041
|
-
if (numbers.length === 0) return
|
|
13076
|
+
if (numbers.length === 0) return alignmentLegClosedByHead(deps, prior);
|
|
13042
13077
|
for (const n of numbers) {
|
|
13043
13078
|
let state = "";
|
|
13044
13079
|
try {
|
package/package.json
CHANGED