Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): fail on empty curated vendor roots during real checkouts

Steven Enamakel16c4d8c3ba9b
diff --git a/scripts/__tests__/storage-bypass-debt.test.mjs b/scripts/__tests__/storage-bypass-debt.test.mjs
index 4f1fc70a13..2ca13ad51b 100644
--- a/scripts/__tests__/storage-bypass-debt.test.mjs
+++ b/scripts/__tests__/storage-bypass-debt.test.mjs
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { mkdtempSync, rmSync, mkdirSync } from "node:fs";
+import { mkdtempSync, rmSync, mkdirSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { execFileSync } from "node:child_process";
@@ -180,8 +180,12 @@ test("present but empty curated vendor directories cannot appear as debt shrinka
try {
execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
mkdirSync(join(root, "crates"));
- // Only the first curated root is reached: it exists but has no Rust source.
- mkdirSync(join(root, CURATED_VENDOR_ROOTS[0]), { recursive: true });
+ for (const path of CURATED_VENDOR_ROOTS) {
+ if (path.endsWith(".rs")) {
+ mkdirSync(join(root, path, ".."), { recursive: true });
+ writeFileSync(join(root, path), "// no writer\n");
+ } else mkdirSync(join(root, path), { recursive: true });
+ }
await assert.rejects(collectFindings(root), /Empty curated source/);
} finally {
rmSync(root, { recursive: true, force: true });
diff --git a/scripts/ci/check-storage-bypass.mjs b/scripts/ci/check-storage-bypass.mjs
index 054510b56a..71aa55b757 100755
--- a/scripts/ci/check-storage-bypass.mjs
+++ b/scripts/ci/check-storage-bypass.mjs
@@ -261,8 +261,12 @@ export async function collectFindings(root, { includeAllowed = false } = {}) {
const files = (
await Promise.all(roots.map((path) => rustFiles(path)))
).flat();
- for (const path of CURATED_VENDOR_ROOTS)
- files.push(...(await rustFiles(resolve(root, path), realCheckout)));
+ for (const path of CURATED_VENDOR_ROOTS) {
+ const sources = await rustFiles(resolve(root, path), realCheckout);
+ if (realCheckout && sources.length === 0)
+ throw new Error("Empty curated source: " + path);
+ files.push(...sources);
+ }
for (const path of files) {
const rel = relative(root, path).split(sep).join("/");
if (isTestFile(rel)) continue;