changeset 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 de291f396881
files mrjunejune/deploy.sh mrjunejune/production_entrypoint.sh mrjunejune/test/production_inference_bundle_test.sh
diffstat 3 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mrjunejune/deploy.sh	Fri Aug 07 12:58:55 2026 -0700
+++ b/mrjunejune/deploy.sh	Fri Aug 07 13:02:41 2026 -0700
@@ -21,7 +21,10 @@
 
 copilot_cli="$(
   sudo find -L "$staging" -type f \
-    -path '*/copilot_cli_linux_x86_64/copilot' -print -quit
+    \( \
+      -path '*+_repo_rules2+copilot_cli_linux_x86_64/copilot' -o \
+      -path '*+http_archive+copilot_cli_linux_x86_64/copilot' \
+    \) -print -quit
 )"
 python_runtime="$(
   sudo find -L "$staging" -type f \
--- a/mrjunejune/production_entrypoint.sh	Fri Aug 07 12:58:55 2026 -0700
+++ b/mrjunejune/production_entrypoint.sh	Fri Aug 07 13:02:41 2026 -0700
@@ -6,7 +6,10 @@
 
 copilot_cli="$(
   find -L "$bundle_root" -type f \
-    -path '*/copilot_cli_linux_x86_64/copilot' -print -quit
+    \( \
+      -path '*+_repo_rules2+copilot_cli_linux_x86_64/copilot' -o \
+      -path '*+http_archive+copilot_cli_linux_x86_64/copilot' \
+    \) -print -quit
 )"
 python_runtime="$(
   find -L "$bundle_root" -type f \
--- 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