Skip to content

Commit 0b08c9f

Browse files
sjarmakclaude
andcommitted
fix: harness-agnostic repo_full fallback in backup verifier libs
answer_json_verifier_lib.sh in backup tasks now falls back to TASK_REPO_ROOT / VERIFY_REPO / /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses like OpenHands). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4cd7eb9 commit 0b08c9f

File tree

63 files changed

+378
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+378
-504
lines changed

benchmarks/backups/csb_org_compliance/ccx-compliance-115/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_org_compliance/ccx-compliance-118/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_org_domain/ccx-domain-120/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_org_platform/ccx-platform-119/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/envoy-duplicate-headers-debug-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/grafana-table-panel-regression-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/istio-xds-destrul-debug-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/prometheus-queue-reshard-debug-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/terraform-phantom-update-debug-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

benchmarks/backups/csb_sdlc_debug/tutanota-search-regression-prove-001/tests/answer_json_verifier_lib.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ if not changes:
207207
208208
# Apply diffs in-place — container is ephemeral, no need to preserve /repo_full
209209
repo_full = "/repo_full"
210-
verify_repo = repo_full
211-
212210
if not os.path.isdir(repo_full):
213-
print(f"[answer_json_verifier] WARNING: {repo_full} not found. Cannot apply diffs.")
211+
# Fallback to /workspace when /repo_full is unavailable (e.g. non-Harbor harnesses)
212+
repo_full = os.environ.get("TASK_REPO_ROOT") or os.environ.get("VERIFY_REPO") or "/workspace"
213+
if not os.path.isdir(repo_full):
214+
print(f"[answer_json_verifier] WARNING: neither /repo_full nor /workspace found. Cannot apply diffs.")
214215
with open("/tmp/.answer_json_no_changes", "w") as f:
215216
f.write("1")
216217
sys.exit(0)
218+
verify_repo = repo_full
217219
218220
# Ensure verifier (root) can write to repo_full
219221
subprocess.run(["chmod", "-R", "u+w", repo_full], capture_output=True)
@@ -290,11 +292,7 @@ if [ -f /tmp/.answer_json_verify_repo ]; then
290292
echo "[answer_json_verifier] VERIFY_REPO set to $VERIFY_REPO"
291293
elif [ -f /tmp/.answer_json_no_changes ]; then
292294
# Analysis-only: no repo copy needed, use /workspace or /repo_full as fallback
293-
if [ -d /repo_full ]; then
294-
export VERIFY_REPO="/repo_full"
295-
else
296-
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
297-
fi
295+
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"
298296
echo "[answer_json_verifier] Analysis-only mode, VERIFY_REPO=$VERIFY_REPO"
299297
else
300298
export VERIFY_REPO="${VERIFY_REPO:-/workspace}"

0 commit comments

Comments
 (0)