diff mrjunejune/test/production_inference_bundle_test.sh @ 268:f7b1188d5fb1

support repo rules Copilot bundle path Match both +_repo_rules2+ and +http_archive+ Copilot CLI repository layouts during deployment and production startup. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Fri, 07 Aug 2026 13:02:41 -0700
parents a78f5986011f
children 13d61401c57d
line wrap: on
line diff
--- a/mrjunejune/test/production_inference_bundle_test.sh	Fri Aug 07 12:58:55 2026 -0700
+++ b/mrjunejune/test/production_inference_bundle_test.sh	Fri Aug 07 13:02:41 2026 -0700
@@ -41,12 +41,9 @@
 entrypoint="$(find -L "$bundle" -type f -name production_entrypoint.sh -print -quit)"
 bash -n "$entrypoint"
 grep -q 'mrjunejune_server_binary' "$entrypoint"
-grep -q "copilot_cli_linux_x86_64/copilot" "$entrypoint"
+grep -q "+_repo_rules2+copilot_cli_linux_x86_64/copilot" "$entrypoint"
+grep -q "+http_archive+copilot_cli_linux_x86_64/copilot" "$entrypoint"
 grep -q "rules_python++python+python_3_11_x86_64-unknown-linux-gnu/bin/python3" "$entrypoint"
-if grep -q '+http_archive+copilot_cli_linux_x86_64' "$entrypoint"; then
-  echo "Production entrypoint hardcodes one Bazel repository prefix" >&2
-  exit 1
-fi
 if grep -q 'MRJUNEJUNE_ALLOW_.*INFERENCE' "$entrypoint"; then
   echo "Production entrypoint must not override guest policy from .config" >&2
   exit 1
@@ -54,7 +51,13 @@
 
 sidecar="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/copilot_sidecar.zip' -print -quit)"
 litellm="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/litellm_proxy.zip' -print -quit)"
-copilot_cli="$(find -L "$bundle" -type f -path '*/+http_archive+copilot_cli_linux_x86_64/copilot' -print -quit)"
+copilot_cli="$(
+  find -L "$bundle" -type f \
+    \( \
+      -path '*+_repo_rules2+copilot_cli_linux_x86_64/copilot' -o \
+      -path '*+http_archive+copilot_cli_linux_x86_64/copilot' \
+    \) -print -quit
+)"
 python="$(find -L "$bundle" -type f -path '*/rules_python++python+python_3_11_*/bin/python3' -print -quit)"
 state="$(mktemp -d)"
 trap 'rm -rf "$state"' EXIT