Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix: validate the Minikube desktop handoff flag

Josué884caeae43a1
diff --git a/scripts/minikube/build-images.sh b/scripts/minikube/build-images.sh
index daad9bccf..af75fb00c 100755
--- a/scripts/minikube/build-images.sh
+++ b/scripts/minikube/build-images.sh
@@ -114,6 +114,9 @@
# airtable-server.yaml) still names the
# local ref, and full-setup.sh sets this
# flag for exactly that case.
+# PROFILE_DESKTOP_HANDOFF_ENABLED=true|false
+# Build Profile UI with desktop handoff
+# links enabled (default: false).
# ======================================================================
set -euo pipefail
@@ -144,6 +147,7 @@ MINIKUBE_REUSE_PLAYWRIGHT_MCP_IMAGE="${MINIKUBE_REUSE_PLAYWRIGHT_MCP_IMAGE:-true
MINIKUBE_PLAYWRIGHT_MCP_SOURCE_IMAGE="${MINIKUBE_PLAYWRIGHT_MCP_SOURCE_IMAGE:-us-central1-docker.pkg.dev/your-gcp-project/clerum/playwright-server:latest}"
MINIKUBE_PLAYWRIGHT_MCP_SOURCE_VISIBILITY="${MINIKUBE_PLAYWRIGHT_MCP_SOURCE_VISIBILITY:-private}"
MINIKUBE_BUILD_AIRTABLE_MCP_IMAGE="${MINIKUBE_BUILD_AIRTABLE_MCP_IMAGE:-false}"
+PROFILE_DESKTOP_HANDOFF_ENABLED="${PROFILE_DESKTOP_HANDOFF_ENABLED:-false}"
MINIKUBE_IMAGE_INVENTORY_TIMEOUT_SECONDS="${MINIKUBE_IMAGE_INVENTORY_TIMEOUT_SECONDS:-30}"
SKIP_UIS="${MINIKUBE_SKIP_UIS:-false}"
@@ -459,6 +463,13 @@ validate_build_configuration() {
printf '%s\n' 'PROFILE_LOCK_REQUIRED: Minikube profile and Kubernetes context must match' >&2
return 1
fi
+ case "$PROFILE_DESKTOP_HANDOFF_ENABLED" in
+ true|false) ;;
+ *)
+ printf '%s\n' 'PROFILE_DESKTOP_HANDOFF_INVALID: expected true or false' >&2
+ return 2
+ ;;
+ esac
docker_cli_env_validate_deadlines || return $?
docker_cli_env_validate_seconds MINIKUBE_STATUS_TIMEOUT_SECONDS \
diff --git a/scripts/tests/test-minikube-build-images-hardening.sh b/scripts/tests/test-minikube-build-images-hardening.sh
index 0e6724d4c..390057056 100755
--- a/scripts/tests/test-minikube-build-images-hardening.sh
+++ b/scripts/tests/test-minikube-build-images-hardening.sh
@@ -312,6 +312,24 @@ assert_invalid_knob retry-over-max MINIKUBE_BASE_IMAGE_PULL_RETRIES=11
assert_invalid_knob delay-over-max MINIKUBE_BASE_IMAGE_PULL_DELAY_SECS=301
assert_invalid_knob delay-not-numeric MINIKUBE_BASE_IMAGE_PULL_DELAY_SECS=forever
+assert_invalid_handoff_flag() {
+ local value="$1" output status=0
+ output="$TMP_DIR/handoff-${value}.out"
+ clear_runtime_state
+ run_build "$output" valid "PROFILE_DESKTOP_HANDOFF_ENABLED=$value" \
+ bash "$BUILD_SCRIPT" --only=profile-ui || status=$?
+ if [[ "$status" -eq 2 ]] \
+ && grep -Fq 'PROFILE_DESKTOP_HANDOFF_INVALID: expected true or false' "$output" \
+ && runtime_logs_are_empty; then
+ pass "PROFILE_DESKTOP_HANDOFF_ENABLED=$value is rejected before runtime"
+ else
+ fail "PROFILE_DESKTOP_HANDOFF_ENABLED=$value was accepted or reached runtime (status=$status)"
+ fi
+}
+
+assert_invalid_handoff_flag 1
+assert_invalid_handoff_flag yes
+
assert_lease_failure() {
local mode="$1" name="$2" status=0
local output="$TMP_DIR/lease-${mode}.out"
@@ -342,6 +360,21 @@ else
fail "the valid inherited lease was rejected (status=$valid_status)"
fi
+for handoff_flag in true false; do
+ clear_runtime_state
+ handoff_output="$TMP_DIR/handoff-${handoff_flag}.out"
+ handoff_status=0
+ run_build "$handoff_output" valid \
+ "PROFILE_DESKTOP_HANDOFF_ENABLED=$handoff_flag" \
+ FAKE_MINIKUBE_STATUS_MODE=exit-47 \
+ bash "$BUILD_SCRIPT" --only=profile-ui || handoff_status=$?
+ if [[ "$handoff_status" -eq 47 ]] && grep -Fq -- "-p $PROFILE status" "$MINIKUBE_LOG"; then
+ pass "PROFILE_DESKTOP_HANDOFF_ENABLED=$handoff_flag is accepted"
+ else
+ fail "PROFILE_DESKTOP_HANDOFF_ENABLED=$handoff_flag was rejected (status=$handoff_status)"
+ fi
+done
+
clear_runtime_state
verify_output="$TMP_DIR/verify-only.out"
verify_status=0