@mutmutco/cli 4.5.56 → 4.5.57

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.
Files changed (2) hide show
  1. package/dist/main.cjs +46 -11
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -7130,12 +7130,37 @@ function extractOnBlock(yaml) {
7130
7130
  }
7131
7131
  return block.length ? block.join("\n") : null;
7132
7132
  }
7133
- function collectPullRequestWorkflowContexts(workflows) {
7133
+ function jobUsesWorkflow(job) {
7134
+ const match = job.body.match(/^\s+uses:\s*['"]?([^'"\s#]*\.github\/workflows\/[^'"\s#@]+\.ya?ml(?:@[^'"\s#]+)?)['"]?\s*(?:#.*)?$/m);
7135
+ return match ? match[1] : null;
7136
+ }
7137
+ function reusableWorkflowRefs(workflows) {
7138
+ const refs = /* @__PURE__ */ new Set();
7139
+ for (const wf of workflows) {
7140
+ if (!workflowTriggersPullRequest(wf.body)) continue;
7141
+ for (const job of parseWorkflowJobs(wf.body)) {
7142
+ const uses = jobUsesWorkflow(job);
7143
+ if (uses && jobReportsPullRequestCheck(job)) refs.add(uses);
7144
+ }
7145
+ }
7146
+ return [...refs];
7147
+ }
7148
+ function parseReusableWorkflowRef(uses) {
7149
+ const local = uses.match(/^\.\/(\.github\/workflows\/[^@]+)$/);
7150
+ if (local) return { path: local[1] };
7151
+ const remote = uses.match(/^([^/]+\/[^/]+)\/(\.github\/workflows\/[^@]+)@(.+)$/);
7152
+ return remote ? { repo: remote[1], path: remote[2], ref: remote[3] } : null;
7153
+ }
7154
+ function collectPullRequestWorkflowContexts(workflows, called = {}) {
7134
7155
  const contexts = /* @__PURE__ */ new Set();
7135
7156
  for (const wf of workflows) {
7136
7157
  if (!workflowTriggersPullRequest(wf.body)) continue;
7137
7158
  for (const job of parseWorkflowJobs(wf.body)) {
7138
- if (jobReportsPullRequestCheck(job)) contexts.add(job.id);
7159
+ if (!jobReportsPullRequestCheck(job)) continue;
7160
+ const uses = jobUsesWorkflow(job);
7161
+ const body = uses ? called[uses] : void 0;
7162
+ if (body) for (const inner of parseWorkflowJobs(body)) contexts.add(`${job.id} / ${inner.id}`);
7163
+ else contexts.add(job.id);
7139
7164
  }
7140
7165
  }
7141
7166
  return [...contexts].sort((a, b) => a.localeCompare(b));
@@ -17044,10 +17069,10 @@ var rollout_plan_default = {
17044
17069
  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)."
17045
17070
  },
17046
17071
  baseline: {
17047
- version: "4.5.56",
17048
- tag: "v4.5.56",
17049
- commit: "7502269d51cd",
17050
- npm: "@mutmutco/cli@4.5.56"
17072
+ version: "4.5.57",
17073
+ tag: "v4.5.57",
17074
+ commit: "d8aff7ba4689",
17075
+ npm: "@mutmutco/cli@4.5.57"
17051
17076
  },
17052
17077
  exitCriterion: "fleet-n-of-n",
17053
17078
  hubOnlyShortcut: "forbidden",
@@ -17064,14 +17089,14 @@ var rollout_plan_default = {
17064
17089
  repo: "mutmutco/mmi-hub",
17065
17090
  role: "canary",
17066
17091
  schedule: "train",
17067
- v3Target: "v4.5.56"
17092
+ v3Target: "v4.5.57"
17068
17093
  }
17069
17094
  ],
17070
17095
  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.",
17071
17096
  rollback: {
17072
17097
  independent: true,
17073
- mechanism: "npm dist-tag latest -> 4.5.56 and redeploy the Hub Lambda from tag v4.5.56 (7502269d51cd); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
17074
- v3Target: "v4.5.56 (@mutmutco/cli@4.5.56, tag commit 7502269d51cd \u2014 last known-good release carrying the repo-index v4-only contract)"
17098
+ mechanism: "npm dist-tag latest -> 4.5.57 and redeploy the Hub Lambda from tag v4.5.57 (d8aff7ba4689); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
17099
+ v3Target: "v4.5.57 (@mutmutco/cli@4.5.57, tag commit d8aff7ba4689 \u2014 last known-good release carrying the repo-index v4-only contract)"
17075
17100
  }
17076
17101
  },
17077
17102
  {
@@ -27279,7 +27304,17 @@ function gateWorkflowFiles(prWorkflowPaths) {
27279
27304
  }
27280
27305
  async function resolveEmittedPrContexts(deps, repo, branch) {
27281
27306
  const workflows = await resolveBranchWorkflows(deps, repo, branch);
27282
- return workflows === void 0 ? void 0 : collectPullRequestWorkflowContexts(workflows);
27307
+ return workflows === void 0 ? void 0 : collectPullRequestWorkflowContexts(workflows, await resolveCalledWorkflows(deps, repo, branch, workflows));
27308
+ }
27309
+ async function resolveCalledWorkflows(deps, repo, branch, workflows) {
27310
+ const called = {};
27311
+ for (const uses of reusableWorkflowRefs(workflows)) {
27312
+ const ref = parseReusableWorkflowRef(uses);
27313
+ if (!ref) continue;
27314
+ const body = await fetchFileContent(deps, ref.repo ?? repo, ref.ref ?? branch, ref.path);
27315
+ if (body) called[uses] = body;
27316
+ }
27317
+ return called;
27283
27318
  }
27284
27319
  async function resolveBranchWorkflows(deps, repo, branch) {
27285
27320
  const paths = await listWorkflowPaths(deps, repo, branch);
@@ -27527,7 +27562,7 @@ async function auditRepoCi(repo, deps) {
27527
27562
  };
27528
27563
  const getEmittedPrContexts = async () => {
27529
27564
  const workflows = await getBranchWorkflows();
27530
- return workflows === void 0 ? void 0 : collectPullRequestWorkflowContexts(workflows);
27565
+ return workflows === void 0 ? void 0 : collectPullRequestWorkflowContexts(workflows, await resolveCalledWorkflows(deps, repo, baseBranch, workflows));
27531
27566
  };
27532
27567
  const committedReferenceRaw = deployableGated ? await fetchFileContent(deps, repo, baseBranch, PRODUCT_RULESET_REF) : null;
27533
27568
  let authoritativeRuleset = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.5.56",
3
+ "version": "4.5.57",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",