@futurelastic/colab-handbook 1.12.0-rc.23 → 1.12.0-rc.25

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/audit/audit.mjs CHANGED
@@ -1660,6 +1660,13 @@ function auditRepo(target, ctx) {
1660
1660
  checkReleaseRunner(src, workflows, warn);
1661
1661
 
1662
1662
  const runbook = cfg && "runbook" in cfg ? cfg.runbook : null;
1663
+ // #454: on route deploy-tag-fast the release workflow's own `deploy` job ships the final (a tag
1664
+ // pushed with GITHUB_TOKEN starts no `push: tags` run, so it cannot be a deploy-*.yml). A cutter
1665
+ // that deploys what it tagged IS the in-repo path to production — it is not an external deployer,
1666
+ // and owes no runbook. One whose deploy step is still the placeholder counts too: the path is in
1667
+ // the repo, unfinished, and checkFastRouteDeploy above already fails it by name.
1668
+ const fastDeployers = (fastRouteCutters({ readFile: (p) => src.readFile(p), workflows, cfg }) || {}).deploying || [];
1669
+ const inRepoDeploy = deployWorkflows.length > 0 || fastDeployers.length > 0;
1663
1670
 
1664
1671
  // ---- gate contract, dispatched by axis of record (#144) ------------------
1665
1672
  // `authority` is null only when project.yml itself did not parse (already failed above,
@@ -1680,12 +1687,14 @@ function auditRepo(target, ctx) {
1680
1687
  // runbook documents that path. A deploy: tag repo whose own
1681
1688
  // CI holds the deploy job keeps its deploy-*.yml and needs no
1682
1689
  // runbook — the workflow already commits the answer.
1683
- const externalTagDeploy = deploy === "tag" && !deployWorkflows.length;
1690
+ // So does a deploy-tag-fast repo whose release workflow
1691
+ // deploys the final it cut (#454).
1692
+ const externalTagDeploy = deploy === "tag" && !inRepoDeploy;
1684
1693
  if (deploy === "manual") {
1685
1694
  checkRunbook(src, runbook, fail, warn, "deploy: manual");
1686
1695
  } else if (externalTagDeploy) {
1687
1696
  checkRunbook(src, runbook, fail, warn, "deploy: tag deployed outside CI (an external GitOps poller)");
1688
- } else if (!deployWorkflows.length) {
1697
+ } else if (!inRepoDeploy) {
1689
1698
  fail("tier A but no .github/workflows/deploy-*.yml — the path to production is not in the repo (use deploy: manual + runbook: if it ships by hand, or deploy: tag + runbook: when a GitOps poller deploys the tag from outside CI)");
1690
1699
  }
1691
1700
  if (production === null || production === "") fail("tier A but production is null — set the live URL, or drop to tier B");
@@ -1761,7 +1770,7 @@ function auditRepo(target, ctx) {
1761
1770
  // construction (CONVENTIONS.md §2: no mechanism rule applies to it, not even trunk shape).
1762
1771
  // A `runbook`-kind entry defers to `checkRunbook` here (this file can read the repo and tell
1763
1772
  // "missing" from "unreadable via the API"); every other entry is a ready `fail` message.
1764
- const shapeCtx = { trunk, hasProduction, deploy, hasDeployWorkflow: deployWorkflows.length > 0, deployWorkflowNames: deployWorkflows };
1773
+ const shapeCtx = { trunk, hasProduction, deploy, hasDeployWorkflow: inRepoDeploy, deployWorkflowNames: [...deployWorkflows, ...fastDeployers] };
1765
1774
  for (const entry of evaluateExposure(exp, shapeCtx)) {
1766
1775
  if (entry.kind === "runbook") checkRunbook(src, runbook, fail, warn, entry.why);
1767
1776
  else fail(entry.message);
@@ -2587,18 +2596,27 @@ function checkReleaseAuto(src, workflows, cfg, warn) {
2587
2596
  // release.rollback: auto is the operator's statement of that, which is why the grant is required.
2588
2597
  const FAST_DEPLOY_CONSUMER = /outputs\.(final|deploy-tag)\b|\.final\s*\/\/|jq -r '\.final\b/;
2589
2598
  const FAST_DEPLOY_UNEDITED = /the deploy step of release-auto\.yml was never edited/;
2590
- function fastRouteDeployFindings({ readFile, workflows, cfg }) {
2599
+ // The cutters and, of those, the ones that deploy the final the cut produced. Null when the effective
2600
+ // route does not finalize on a green head (not the fast route). Shared by the findings below and by
2601
+ // the deploy-presence rule (#454), which counts a deploying cutter as the in-repo deploy path.
2602
+ function fastRouteCutters({ readFile, workflows, cfg }) {
2591
2603
  const effective = cfg ? releasePolicy.evaluateRelease(cfg).effective : null;
2592
- if (!effective || effective.finalize !== "on-green-head") return [];
2604
+ if (!effective || effective.finalize !== "on-green-head") return null;
2593
2605
  const cutters = (workflows || []).filter((wf) => {
2594
2606
  const t = readFile(`.github/workflows/${wf}`);
2595
2607
  return t && /\brelease\s+cut\s+--auto\b/.test(t);
2596
2608
  });
2609
+ const deploying = cutters.filter((wf) => FAST_DEPLOY_CONSUMER.test(readFile(`.github/workflows/${wf}`)));
2610
+ return { cutters, deploying };
2611
+ }
2612
+ function fastRouteDeployFindings({ readFile, workflows, cfg }) {
2613
+ const found = fastRouteCutters({ readFile, workflows, cfg });
2614
+ if (!found) return [];
2615
+ const { cutters, deploying } = found;
2597
2616
  if (!cutters.length) {
2598
2617
  return ["route: deploy-tag-fast but no workflow runs `colab release cut --auto` — nothing tags or deploys a final; copy templates/release-auto.yml (CONVENTIONS.md §6, A final on every green head)"];
2599
2618
  }
2600
2619
  const out = [];
2601
- const deploying = cutters.filter((wf) => FAST_DEPLOY_CONSUMER.test(readFile(`.github/workflows/${wf}`)));
2602
2620
  if (!deploying.length) {
2603
2621
  out.push(`route: deploy-tag-fast, but ${cutters.join(", ")} runs \`colab release cut --auto\` and deploys nothing from its result — a tag pushed with GITHUB_TOKEN starts no \`push: tags\` run, so the final would never deploy; deploy in the same run (templates/release-auto.yml, job \`deploy\`)`);
2604
2622
  }
package/package.json CHANGED
@@ -27,5 +27,5 @@
27
27
  "engines": {
28
28
  "node": ">=18"
29
29
  },
30
- "version": "1.12.0-rc.23"
30
+ "version": "1.12.0-rc.25"
31
31
  }
@@ -584,12 +584,17 @@ jobs:
584
584
  run: |
585
585
  set -uo pipefail
586
586
  VERSION="${TAG#v}"
587
+ # Boundary-aware, the same rule as deploy-container-run.mjs `reportsVersion` (#459): the
588
+ # version (optionally `v`-prefixed) must not touch a digit or `.` before it, nor a digit or
589
+ # `.`+digit after it — so 1.2.1 never matches 1.2.10, 11.2.1 or 1.2.1.4. A substring
590
+ # `case` match accepted all three. grep is line-based; a newline is neither, so it agrees.
591
+ PATTERN="(^|[^0-9.])v?${VERSION//./\\.}([^0-9.]|\\.([^0-9]|\$)|\$)"
587
592
  DEADLINE=$(( $(date +%s) + HEALTH_TIMEOUT_SECONDS ))
588
593
  while :; do
589
594
  BODY="$(curl -fsS --max-time 10 "$HEALTH_URL" 2> /dev/null || true)"
590
- case "$BODY" in
591
- *"$VERSION"*) echo "$HEALTH_URL reports $VERSION — $TAG is live" | tee -a "$GITHUB_STEP_SUMMARY"; exit 0 ;;
592
- esac
595
+ if printf '%s\n' "$BODY" | grep -Eq -- "$PATTERN"; then
596
+ echo "$HEALTH_URL reports $VERSION — $TAG is live" | tee -a "$GITHUB_STEP_SUMMARY"; exit 0
597
+ fi
593
598
  if [ "$(date +%s)" -ge "$DEADLINE" ]; then
594
599
  echo "::error::$HEALTH_URL did not report $VERSION within ${HEALTH_TIMEOUT_SECONDS}s — the deploy's own rollback should have restored the previous version; $TAG stays tagged"
595
600
  exit 1