From 1a9cf80b8e20c52a1707049331fd33289f770ea2 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Tue, 19 May 2026 18:17:35 +0200 Subject: [PATCH] fix(argo): force-checkout in ensure-binary to handle dirty Cargo.lock The cargo-target-cuda PVC persists `$BUILD` across runs. cargo build mutates Cargo.lock, so the next run's `git checkout $SHA` fails with "Your local changes to the following files would be overwritten by checkout: Cargo.lock". Same pattern alpha-perception-template uses (`git checkout --force $SHA; git clean -fd`) handles this cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) --- infra/k8s/argo/lob-backtest-sweep-template.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/infra/k8s/argo/lob-backtest-sweep-template.yaml b/infra/k8s/argo/lob-backtest-sweep-template.yaml index b571b2cb0..71573053f 100644 --- a/infra/k8s/argo/lob-backtest-sweep-template.yaml +++ b/infra/k8s/argo/lob-backtest-sweep-template.yaml @@ -216,7 +216,13 @@ spec: echo "=== Cache MISS: compiling fxt-backtest for $SHORT_SHA ===" if [ -d "$BUILD/.git" ]; then - cd "$BUILD"; git fetch origin; git checkout "$SHA" + # Same pattern as alpha-perception-template.yaml: prior + # cargo build mutates Cargo.lock (and sometimes other + # generated files); --force checkout overwrites them, + # `git clean -fd` drops untracked. Without this, the + # second SHA's checkout fails on dirty working tree. + cd "$BUILD"; git fetch origin + git checkout --force "$SHA"; git clean -fd else git clone --filter=blob:none "$REPO" "$BUILD" cd "$BUILD"; git checkout "$SHA"