Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fail the gate closed when no job results were supplied at all

[._.]/ Adam Eivye2bdac062cd2
diff --git a/scripts/ci-gate-report.js b/scripts/ci-gate-report.js
index 9e042dfd84..a6961e742a 100644
--- a/scripts/ci-gate-report.js
+++ b/scripts/ci-gate-report.js
@@ -121,9 +121,22 @@ export function summarizeGateResults(results, label = DEFAULT_LABEL, requireSucc
};
}
+ if (!results.length) {
+ // Fail closed. A green required check that examined nothing is worse
+ // than a red one: it is indistinguishable from a real pass.
+ return {
+ verdict: 'failure',
+ lines: [
+ `❌ ${label}: no job results were supplied, so nothing was checked.`,
+ "Every job in the gate's `needs:` list needs a CI_GATE_RESULT_<JOB>"
+ + " environment entry in .github/workflows/ci.yml.",
+ ],
+ };
+ }
+
return {
verdict: 'pass',
- lines: [`✅ ${label} passed: ${results.map(pair).join(', ') || 'no jobs selected'}`],
+ lines: [`✅ ${label} passed: ${results.map(pair).join(', ')}`],
};
}
diff --git a/scripts/ci-gate-report.test.js b/scripts/ci-gate-report.test.js
index 2d60a606fd..bd0b1b3e2b 100644
--- a/scripts/ci-gate-report.test.js
+++ b/scripts/ci-gate-report.test.js
@@ -97,6 +97,14 @@ describe('summarizeGateResults', () => {
expect(strict.lines).toContain('Failed jobs: gate=skipped');
});
+ it('fails when no job results were supplied at all', () => {
+ // A green required check that examined nothing is indistinguishable from
+ // a real pass, so an empty set must fail rather than pass vacuously.
+ const summary = summarizeGateResults([]);
+ expect(summary.verdict).toBe('failure');
+ expect(summary.lines.join('\n')).toContain('nothing was checked');
+ });
+
it('uses the supplied gate label so the two gates are distinguishable', () => {
const summary = summarizeGateResults(results({ gate: 'cancelled' }), 'Full CI Gate');
expect(summary.lines[0]).toContain('Full CI Gate');
diff --git a/scripts/pre-install-entrypoints.test.js b/scripts/pre-install-entrypoints.test.js
index 4841f59254..de81107713 100644
--- a/scripts/pre-install-entrypoints.test.js
+++ b/scripts/pre-install-entrypoints.test.js
@@ -139,7 +139,9 @@ describe('scripts that run from a sparse checkout of scripts/', () => {
const workflows = ['.github/workflows/ci.yml', '.github/workflows/ci-cancel-recovery.yml']
.map((rel) => readFileSync(join(REPO_ROOT, rel), 'utf8'))
.join('\n');
- const sparseJobs = workflows.split('sparse-checkout: scripts').length - 1;
+ // The `with:` key at the start of a line, not the literal anywhere: a
+ // comment mentioning it must neither inflate the count nor evade it.
+ const sparseJobs = (workflows.match(/^ +sparse-checkout: scripts$/gm) || []).length;
// ci.yml's two gate jobs both run ci-gate-report.js; the recovery workflow
// runs the other one.
expect(sparseJobs).toBe(3);