@futurelastic/colab-handbook 1.14.1-rc.3 → 1.14.1-rc.4

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.14.1-rc.3"
36
+ "version": "1.14.1-rc.4"
37
37
  }
package/tools/colab CHANGED
@@ -1439,7 +1439,8 @@ function measureCandidateConditions(repoAbs, { sha, lastFinal, at, readRuns, iss
1439
1439
  suite = { ok: false, detail: `gh not usable (${why}) — cannot confirm the suite ran at ${at}` };
1440
1440
  switches = { ok: false, unread: true, detail: `gh not usable (${why}) — the colab:switch markers cannot be read` };
1441
1441
  } else {
1442
- const rows = readRuns();
1442
+ // #616: a workflow whose every run at the sha was skipped did not run — not counted either way.
1443
+ const rows = releaseCut.withoutSkippedOnlyWorkflows(readRuns());
1443
1444
  const run = git.summarizeRunsForCommit(rows, sha);
1444
1445
  if (!run) ci = { ok: false, detail: `gh run list failed — cannot confirm CI at ${at}` };
1445
1446
  else { const v = classifyCiRun(repoAbs, run, at); ci = { ok: v.ok, detail: v.detail }; }
@@ -2128,7 +2129,7 @@ function cmdReleaseFinalize(argv) {
2128
2129
  const d = releaseFinalize.deployOnlyFailures(rawRows, (id) => git.ghRunJobs(repoAbs, id));
2129
2130
  if (d.failures.length) {
2130
2131
  const at = `${cand.tag}@${shortSha(cand.sha)}`;
2131
- const lenRows = releaseCut.withoutOwnWorkflow(d.rows); // #425, as readRuns does
2132
+ const lenRows = releaseCut.withoutSkippedOnlyWorkflows(releaseCut.withoutOwnWorkflow(d.rows)); // #425 + #616, as the first read does
2132
2133
  const run = git.summarizeRunsForCommit(lenRows, cand.sha);
2133
2134
  const ci = run ? (({ ok, detail }) => ({ ok, detail }))(classifyCiRun(repoAbs, run, at)) : { ok: false, detail: `gh run list failed — cannot confirm CI at ${at}` };
2134
2135
  deployReport = { failures: d.failures, ci, suite: releaseCut.fullSuiteVerdict(lenRows, at), cutRun: releaseFinalize.cutRunVerdict(d.rows, cutRunOpts) };
@@ -655,12 +655,11 @@ function handoffTrackingBody(version) {
655
655
  function fullSuiteVerdict(rows, at) {
656
656
  if (rows === null || rows === undefined) return { ok: false, detail: `gh run list failed — cannot confirm the suite ran at ${at}` };
657
657
  if (!rows.length) return { ok: false, detail: `no workflow run at ${at} — the suite never ran on this commit` };
658
- const byWorkflow = new Map();
659
- for (const r of rows) {
660
- const name = r.workflowName || '(unnamed workflow)';
661
- if (!byWorkflow.has(name)) byWorkflow.set(name, []);
662
- byWorkflow.get(name).push(r);
663
- }
658
+ const byWorkflow = groupByWorkflow(rows);
659
+ const skippedOnly = [];
660
+ for (const [name, runs] of byWorkflow) if (isSkippedOnly(runs)) { skippedOnly.push(name); byWorkflow.delete(name); }
661
+ // #616: a workflow whose every run was skipped did not run — it vouches for nothing and fails nothing.
662
+ if (!byWorkflow.size) return { ok: false, detail: `no workflow ran at ${at} — every run was skipped (${skippedOnly.join(', ')})` };
664
663
  const missing = [];
665
664
  for (const [name, runs] of byWorkflow) {
666
665
  if (!runs.some((r) => r.status === 'completed' && r.conclusion === 'success')) {
@@ -668,7 +667,41 @@ function fullSuiteVerdict(rows, at) {
668
667
  }
669
668
  }
670
669
  if (missing.length) return { ok: false, detail: `no successful run at ${at} for: ${missing.join('; ')}` };
671
- return { ok: true, detail: `${byWorkflow.size} workflow(s) at ${at}, each with a successful run` };
670
+ const note = skippedOnly.length ? ` (not run, skipped: ${skippedOnly.join(', ')})` : '';
671
+ return { ok: true, detail: `${byWorkflow.size} workflow(s) at ${at}, each with a successful run${note}` };
672
+ }
673
+
674
+ function groupByWorkflow(rows) {
675
+ const byWorkflow = new Map();
676
+ for (const r of rows) {
677
+ const name = (r && r.workflowName) || '(unnamed workflow)';
678
+ if (!byWorkflow.has(name)) byWorkflow.set(name, []);
679
+ byWorkflow.get(name).push(r);
680
+ }
681
+ return byWorkflow;
682
+ }
683
+
684
+ /** Every run of the workflow finished and concluded `skipped` — it executed nothing (#514, #616). */
685
+ function isSkippedOnly(runs) {
686
+ return runs.length > 0 && runs.every((r) => r && r.status === 'completed' && r.conclusion === 'skipped');
687
+ }
688
+
689
+ /**
690
+ * #616: the run rows minus every workflow whose runs at the sha were ALL `skipped` — an opt-in
691
+ * workflow gated off by an `if:` (a scheduled load profile waiting for its runner) records a skipped
692
+ * run on every tick, and one landing on the candidate's commit made ci-green read
693
+ * "conclusion=skipped" and refused every finalize older than one schedule period. Release-only on
694
+ * purpose: the ship gate (git.summarizeRunsForCommit, #514) keeps reading an all-skipped workflow
695
+ * as not-green, so this filter is applied by the release callers, never inside git.js.
696
+ * A workflow with a skipped run AND any other run keeps all its rows (skipped + failure stays red;
697
+ * cancelled-only is untouched and still fails full-suite). null passes through.
698
+ */
699
+ function withoutSkippedOnlyWorkflows(rows) {
700
+ if (!Array.isArray(rows)) return rows;
701
+ const drop = new Set();
702
+ for (const [name, runs] of groupByWorkflow(rows)) if (isSkippedOnly(runs)) drop.add(name);
703
+ if (!drop.size) return rows;
704
+ return rows.filter((r) => !drop.has((r && r.workflowName) || '(unnamed workflow)'));
672
705
  }
673
706
 
674
707
  /**
@@ -1152,7 +1185,7 @@ module.exports = {
1152
1185
  isFastRoute, isLibraryRoute, decideManifestVersion, spacingVerdict, holdsVerdict, migrationHandoff,
1153
1186
  parseVersion, formatVersion, candidateNumbers, nextCandidateNumber, decideVersion,
1154
1187
  parseGuardOutput, exportsDiff, switchRemovalsSince, autoSignals, parseMigrationSection, decideAutoVersion, cadenceVerdict,
1155
- fullSuiteVerdict, withoutOwnWorkflow, isMigrationPath, schemaVerdict,
1188
+ fullSuiteVerdict, withoutOwnWorkflow, withoutSkippedOnlyWorkflows, isMigrationPath, schemaVerdict,
1156
1189
  parseSwitchMarkers, switchVerdict,
1157
1190
  promotionVerdict, decide, tagMessage, versionSourceOf,
1158
1191
  DOWNSTREAM_EVENTS, headCandidateVerdict, prereleaseArgs, finalReleaseArgs, handoffTrackingBody,