@futurelastic/colab-handbook 1.20.4-rc.1 → 1.20.4-rc.2

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/package.json +1 -1
  2. package/tools/colab +22 -6
package/package.json CHANGED
@@ -33,5 +33,5 @@
33
33
  "engines": {
34
34
  "node": ">=18"
35
35
  },
36
- "version": "1.20.4-rc.1"
36
+ "version": "1.20.4-rc.2"
37
37
  }
package/tools/colab CHANGED
@@ -11967,13 +11967,13 @@ function descriptorHolds(doc) {
11967
11967
  * caller can build the --dry --json `ciGrant`/`ciCure` payloads from the SAME verdicts the prose
11968
11968
  * detail string was built from — see ciGrantPayload/ciCurePayload, below.
11969
11969
  */
11970
- function shipCiCheck(repoAbs, gh, target, trunk, grantThunk, cureThunk, branch = null) {
11970
+ function shipCiCheck(repoAbs, gh, target, trunk, grantThunk, cureThunk, branch = null, docsOnlyThunk = null) {
11971
11971
  const name = `${target === trunk ? 'trunk' : 'line'} CI green`;
11972
11972
  const r = readCiVerdict(repoAbs, gh, target, trunk);
11973
11973
  // #678: on a forge the engine map names, the verdict is final — the #482 no-workflow door counts
11974
11974
  // `.github/workflows` and reads the branch through gh, neither of which describes a forge's CI.
11975
11975
  if (forgeCi(repoAbs)) return { name, ...r.verdict, grantVerdict: null, cureVerdict: null };
11976
- const nw = noWorkflowTrunkDoor(repoAbs, r, target, trunk, branch);
11976
+ const nw = noWorkflowTrunkDoor(repoAbs, r, target, trunk, branch, docsOnlyThunk);
11977
11977
  if (nw) return { name, ...nw, grantVerdict: null, cureVerdict: null };
11978
11978
  if (r.final) return { name, ...r.verdict, grantVerdict: null, cureVerdict: null };
11979
11979
  return applyRedTrunkExemptions({ name, ...r.verdict }, target, trunk, r.run.sha, grantThunk, cureThunk);
@@ -11991,14 +11991,27 @@ function shipCiCheck(repoAbs, gh, target, trunk, grantThunk, cureThunk, branch =
11991
11991
  * real gap (CI not wired, or never started) and still blocks exactly as before. Runs ahead of the
11992
11992
  * #413 grace window too: a run that can never exist is not worth waiting ten minutes for. Returns null when
11993
11993
  * the door does not apply, or a `{ok, class, detail}` verdict when it does.
11994
+ *
11995
+ * #711: a DOCS-ONLY candidate (#606's measurement, secret check included — `docsOnlyThunk` returns
11996
+ * shipDocsOnlyCi's shape, called lazily, only once the trunk is known to have no workflow) passes here
11997
+ * without a run of its own: #606 already ruled that run not required, and a docs-only branch on a
11998
+ * no-workflow trunk can never draw one. Only for a branch on the remote (the same precondition as the
11999
+ * branch-run read). A failed secret check, or a branch that is not docs-only, falls through to the
12000
+ * branch's own run as before.
11994
12001
  */
11995
- function noWorkflowTrunkDoor(repoAbs, r, target, trunk, branch) {
12002
+ function noWorkflowTrunkDoor(repoAbs, r, target, trunk, branch, docsOnlyThunk = null) {
11996
12003
  if (target !== trunk || !branch || !r.run || r.run.status !== 'none' || !r.run.sha || r.verdict.ok) return null;
11997
12004
  if (trunkWorkflowFiles(repoAbs, r.run.sha) !== 0) return null;
11998
12005
  const at = `${trunk}@${shortSha(r.run.sha)}`;
11999
12006
  const own = git.ghRunForSha(repoAbs, branch);
12000
12007
  // Branch not on the remote, or its runs unreadable: nothing to decide with — the prior verdict stands.
12008
+ // #711 keeps this precondition: the docs-only pass below is for a pushed candidate only.
12001
12009
  if (!own) return null;
12010
+ const dc = docsOnlyThunk ? docsOnlyThunk() : null;
12011
+ if (dc && dc.applies && dc.scan && dc.scan.ok) {
12012
+ return { ok: true, class: null,
12013
+ detail: `none — ${at} has no repo-owned workflow, so nothing there can be red (#482); no workflow on trunk; docs-only branch, CI not required (${dc.files} files, secret check clean — #606)${excludedRunsNote(r.run)}` };
12014
+ }
12002
12015
  const ownAt = own.sha ? `${branch}@${shortSha(own.sha)}` : branch;
12003
12016
  if (own && own.status === 'completed' && own.conclusion === 'success') {
12004
12017
  const n = own.runCount == null ? 1 : own.runCount;
@@ -13206,7 +13219,8 @@ function cmdShipDryJson(opts) {
13206
13219
  const gh = isGhUsable(repoAbs);
13207
13220
  const ciResultJson = shipCiCheck(repoAbs, gh, target, trunk,
13208
13221
  (redSha) => shipCiGrants(repoAbs, gh, sess.issues, sess.branch, trunk, redSha),
13209
- (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch);
13222
+ (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch,
13223
+ () => shipDocsOnlyCi(repoAbs, doc, target, sess.branch)); // #711: the #482 door learns the #606 measurement
13210
13224
  ciGrantPayloadVal = ciGrantPayload(ciResultJson);
13211
13225
  ciCurePayloadVal = ciCurePayload(ciResultJson);
13212
13226
  checks.push({ name: ciResultJson.name, ok: ciResultJson.ok, class: ciResultJson.class, detail: ciResultJson.detail });
@@ -14516,7 +14530,8 @@ function cmdShip(argv) {
14516
14530
  // ordinary green-trunk ship makes zero extra `gh` reads for a door nobody needs.
14517
14531
  const ciResult = shipCiCheck(repoAbs, gh, target, trunk,
14518
14532
  (redSha) => shipCiGrants(repoAbs, gh, sess.issues, sess.branch, trunk, redSha),
14519
- (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch);
14533
+ (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch,
14534
+ () => shipDocsOnlyCi(repoAbs, doc, target, sess.branch)); // #711: the #482 door learns the #606 measurement
14520
14535
  const ciOk = ciResult.ok;
14521
14536
  checks.push([ciResult.ok ? '✓' : '✗', ciResult.name, ciResult.detail]);
14522
14537
 
@@ -15058,7 +15073,8 @@ function cmdShip(argv) {
15058
15073
  if (gh || forgeCi(repoAbs)) { // #678: a forge's CI is re-read at B1 exactly as GitHub's is
15059
15074
  const measureB1 = () => shipCiCheck(repoAbs, gh, target, trunk,
15060
15075
  (redSha) => shipCiGrants(repoAbs, gh, sess.issues, sess.branch, trunk, redSha),
15061
- (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch);
15076
+ (redSha) => shipCiCure(repoAbs, gh, target, trunk, redSha, sess.branch), sess.branch,
15077
+ () => shipDocsOnlyCi(repoAbs, doc, target, sess.branch)); // #711, same door as the table row
15062
15078
  let ciResultB1 = measureB1();
15063
15079
  // #538: the table admitted this branch through a door (cure or grant) at red sha X, and B1 —
15064
15080
  // seconds later, at the SAME red sha — refused. Nothing the door judges moved (trunk's head is