Skip to content

The headless browser for AI agents and web scraping

ci: discard incomplete archives and reject directory cache paths

SGavrla8814c4064a7
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d91fb23e..39d97063 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -160,7 +160,7 @@ jobs:
run: |
# rust-cache removes gn_out but can retain V8's build-script metadata.
if [[ ! -f target/release/gn_out/obj/librusty_v8.a || ! -s target/release/gn_out/obj/librusty_v8.a ]]; then
- rm -f -- target/release/gn_out/obj/librusty_v8.sum
+ rm -f -- target/release/gn_out/obj/librusty_v8.a target/release/gn_out/obj/librusty_v8.sum
cargo clean --release -p v8
fi
@@ -284,7 +284,7 @@ jobs:
run: |
# This checkout is the trusted base, so keep the repair self-contained.
if [[ ! -f target/release/gn_out/obj/librusty_v8.a || ! -s target/release/gn_out/obj/librusty_v8.a ]]; then
- rm -f -- target/release/gn_out/obj/librusty_v8.sum
+ rm -f -- target/release/gn_out/obj/librusty_v8.a target/release/gn_out/obj/librusty_v8.sum
cargo clean --release -p v8
fi
diff --git a/scripts/ci/test_repair_v8_cache.py b/scripts/ci/test_repair_v8_cache.py
index 19b627ed..876f26bc 100644
--- a/scripts/ci/test_repair_v8_cache.py
+++ b/scripts/ci/test_repair_v8_cache.py
@@ -44,8 +44,11 @@ class RepairV8CacheTests(unittest.TestCase):
checksum = archive.with_suffix(".sum")
checksum.write_text("cached URL")
run = subprocess.run(["bash", "-euc", script], cwd=root, env=environment, capture_output=True, text=True)
- self.assertEqual(run.returncode, clean_exit if should_clean else 0, run.stderr)
- self.assertEqual(checksum.exists(), not should_clean)
+ blocked = kind == "directory"
+ self.assertEqual(run.returncode, 1 if blocked else clean_exit if should_clean else 0, run.stderr)
+ self.assertEqual(checksum.exists(), not should_clean and not blocked)
+ if blocked:
+ self.assertIn("directory", run.stderr.lower())
if should_clean:
self.assertEqual(calls.read_text().splitlines(), ["clean", "--release", "-p", "v8"])
else:
@@ -57,8 +60,8 @@ class RepairV8CacheTests(unittest.TestCase):
def test_empty_archive_invalidates_only_v8(self):
self.check_archive("empty", True)
- def test_directory_is_not_an_archive(self):
- self.check_archive("directory", True)
+ def test_directory_fails_without_cleaning_dependencies(self):
+ self.check_archive("directory", False)
def test_valid_archive_preserves_warm_cache(self):
self.check_archive("valid", False)