From 75233fdf14c1f59c47d244a886ba121b91bdd5c0 Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Tue, 24 Nov 2026 20:40:48 +0100 Subject: [PATCH] ci(dagger): give the mounted tree a git index The dagger job mounts the checkout without `.git` (excluded from the synced directory), and eleven tests need it. The detection-core final gate and ten tests in the migration files list tracked Python files with `git ls-files` under check=True, so in run 45352669096 each failed for want of that index soon after it started, while the job's 52 performance tests passed. The container now trusts the worktree, which can be owned by another user than the container's, and builds an index of the mounted tree before uv runs. In python:3.11-bookworm the final gate then passes (1 passed in 358 s) and the index holds the same 1031 Python files as on the host; without the index the final gate fails in 12 s. --- dagger/ci.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dagger/ci.py b/dagger/ci.py index 80197cab..92b38533 100644 --- a/dagger/ci.py +++ b/dagger/ci.py @@ -44,6 +44,12 @@ async def _run_checks() -> None: .from_("python:3.11-bookworm") .with_directory("/src", source) .with_workdir("/src") + # The mounted tree carries no `.git` (excluded above), and tests that enumerate tracked + # files, such as the detection-core migration gate, need an index: give them this tree's. + # The tree can be owned by another user than the container's, so git must trust it first. + .with_exec(["git", "config", "--system", "--add", "safe.directory", "/src"]) + .with_exec(["git", "init", "-q"]) + .with_exec(["git", "add", "-A"]) .with_exec(["python", "-m", "pip", "install", "uv"]) # uv run re-syncs the environment to the lockfile's default extras unless told not to, which silently # removed the extras below before pytest ran.