@futurelastic/colab-handbook 1.15.0-rc.4 → 1.15.0-rc.6

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/package.json CHANGED
@@ -33,5 +33,5 @@
33
33
  "engines": {
34
34
  "node": ">=18"
35
35
  },
36
- "version": "1.15.0-rc.4"
36
+ "version": "1.15.0-rc.6"
37
37
  }
package/tools/colab CHANGED
@@ -11764,6 +11764,12 @@ function classifyCiRunRaw(repoAbs, run, at) {
11764
11764
  const detail = n === 1 ? `1 run at ${at}: success` : `${n} runs at ${at}: all success`;
11765
11765
  return { ok: true, class: null, detail };
11766
11766
  }
11767
+ if (run.cancelledOnly) {
11768
+ // #628: one workflow's only run at this sha was cancelled — it verified nothing, and the other
11769
+ // workflows' success does not stand in for it. Name it so a human knows what to re-run.
11770
+ const c = run.cancelledOnly;
11771
+ return { ok: false, class: HUMAN_GATED, detail: `run for ${at}: workflow "${c.workflowName}" never finished here — its only run${c.databaseId ? ` (run ${c.databaseId})` : ''} was cancelled, so it verified nothing; re-run it (#628)` };
11772
+ }
11767
11773
  return { ok: false, class: HUMAN_GATED, detail: `run for ${at}: status=completed conclusion=${run.conclusion || 'none'}` };
11768
11774
  }
11769
11775
  if (run.status === 'none') {
package/tools/lib/git.js CHANGED
@@ -1304,6 +1304,22 @@ function summarizeRepoOwnedRuns(forSha, sha) {
1304
1304
  );
1305
1305
  if (notGreen) return { status: 'completed', conclusion: notGreen.conclusion, sha, createdAt: notGreen.createdAt || null, databaseId: notGreen.databaseId || null, runCount };
1306
1306
 
1307
+ // #628: a NAMED workflow whose head is `cancelled` has no run at this sha that ran to the end —
1308
+ // newestRunPerWorkflow never lets a cancelled row stand for a workflow that has a non-neutral
1309
+ // run (#92), so a cancelled head means cancelled is all it has. That workflow verified nothing,
1310
+ // and a sibling workflow's success must not carry the verdict for it. Measured: the only test
1311
+ // workflow at a trunk head hung and was cancelled, and the head read GREEN on a lint workflow's
1312
+ // success. Unnamed rows (older reads, hand-built fixtures) stay neutral exactly as before — they
1313
+ // cannot be told apart from a superseded straggler of a passing run, which is #92's case.
1314
+ const cancelledOnly = forSha.find((x) => x && x.workflowName && x.status === 'completed' && x.conclusion === 'cancelled');
1315
+ if (cancelledOnly) {
1316
+ return {
1317
+ status: 'completed', conclusion: 'cancelled', sha, createdAt: cancelledOnly.createdAt || null,
1318
+ databaseId: cancelledOnly.databaseId || null, runCount,
1319
+ cancelledOnly: { workflowName: cancelledOnly.workflowName, databaseId: cancelledOnly.databaseId || null },
1320
+ };
1321
+ }
1322
+
1307
1323
  // A green verdict is owed only when EVERY sibling at this sha has finished (#307). A row that is
1308
1324
  // still queued/in_progress has not passed — it has not run — so picking the first completed
1309
1325
  // success here would stamp `runCount` (the FULL sibling count) onto a verdict that inspected one
@@ -379,8 +379,8 @@ function wiring(fires) {
379
379
 
380
380
  /**
381
381
  * The combined run's verdict from every run row at the batch head (`{status, conclusion, attempt,
382
- * databaseId}`). Same all-runs rule as summarizeRunsForCommit: any finished not-green row (cancelled
383
- * aside) makes it red; any unfinished row keeps it pending; green needs every row finished and at
382
+ * databaseId, workflowName}`). Same all-runs rule as summarizeRunsForCommit: any finished not-green
383
+ * row (cancelled aside) makes it red; a named workflow with only cancelled rows makes it red (#629); any unfinished row keeps it pending; green needs every row finished and at
384
384
  * least one success. `attempt` is the highest run attempt seen — how many times it was re-run.
385
385
  * Unlike summarizeRunsForCommit it does NOT reduce to the newest run per workflow (#461): a batch
386
386
  * ref is built fresh and re-run in place (same run, higher `attempt`), so it carries no superseded
@@ -395,6 +395,18 @@ function combinedVerdict(rows) {
395
395
  const bad = list.find((r) => r.status === 'completed' && r.conclusion !== 'success' && r.conclusion !== 'cancelled');
396
396
  if (bad) return { state: 'red', attempt, runIds, why: `a run finished ${bad.conclusion}` };
397
397
  if (list.some((r) => r.status !== 'completed')) return { state: 'pending', attempt, runIds, why: 'a run is still in flight' };
398
+ // #629 (the batch-ref twin of #628): a NAMED workflow whose rows here are all cancelled verified
399
+ // nothing, and another workflow's success must not carry the verdict for it — measured shape: the
400
+ // test workflow hung and was cancelled, a lint workflow passed, and the batch read green. A
401
+ // batch ref is re-run in place (same run, higher attempt), so a cancelled row is never a
402
+ // superseded straggler beside a newer run of its workflow; a same-workflow success still clears
403
+ // it. Unnamed rows (batch-stats.js projections, older fixtures) stay neutral, as in #628.
404
+ const succeeded = new Set(list.filter((r) => r.conclusion === 'success' && r.workflowName).map((r) => r.workflowName));
405
+ const cancelledOnly = list.find((r) => r.workflowName && r.conclusion === 'cancelled' && !succeeded.has(r.workflowName));
406
+ if (cancelledOnly) {
407
+ const id = cancelledOnly.databaseId !== null && cancelledOnly.databaseId !== undefined ? ` (run ${cancelledOnly.databaseId})` : '';
408
+ return { state: 'red', attempt, runIds, why: `workflow "${cancelledOnly.workflowName}" never finished here — its only run${id} was cancelled, so it verified nothing; re-run it` };
409
+ }
398
410
  if (list.some((r) => r.conclusion === 'success')) return { state: 'green', attempt, runIds, why: `${list.length} run(s): all success` };
399
411
  return { state: 'red', attempt, runIds, why: 'every run was cancelled' };
400
412
  }