From 56d3d7a777b819b7bfcfd26f7975ae5733d1fad6 Mon Sep 17 00:00:00 2001 From: hessjc Date: Tue, 13 Jan 2026 00:35:54 +0000 Subject: [PATCH 1/2] chore: Fix the build script so it works consistently with other projects. --- build.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index d3800a29..fba53f25 100755 --- a/build.sh +++ b/build.sh @@ -23,6 +23,7 @@ SCRIPT_FILE="${SCRIPT_DIR}/$(basename "$0")" ## ## These functions should be used to run the local development process ## +function init_venv() { if [[ ! -d venv ]] ; then echo "./venv not found. Setting up venv" @@ -30,6 +31,7 @@ if [[ ! -d venv ]] ; then fi source "$PWD/venv/bin/activate" +python --version if which pip3 ; then PIP_CMD=pip3 @@ -39,10 +41,12 @@ else echo "pip not found. Please add pip to your path." exit 1 fi + if ! which nox ; then - python3 -m pip install nox + $PIP_CMD install nox fi +} ## clean - Cleans the build output @@ -130,6 +134,7 @@ function write_e2e_env(){ echo "the e2e test suite secrets." exit 1 fi + local_user=$(gcloud auth list --format 'value(account)' | grep '@google.com' | tr -d '\n') echo "Getting test secrets from $TEST_PROJECT into $1" { @@ -140,10 +145,15 @@ function write_e2e_env(){ val=$(gcloud secrets versions access latest --project "$TEST_PROJECT" --secret="$secret_name") echo "export $env_var_name='$val'" done + + # Set IAM User env vars to the local gcloud user + echo "export MYSQL_IAM_USER='${local_user%%@*}'" + echo "export MYSQL_USER_IAM='${local_user%%@*}'" + echo "export POSTGRES_IAM_USER='$local_user'" + echo "export POSTGRES_USER_IAM='$local_user'" + # Aliases for python e2e tests echo "export POSTGRES_CUSTOMER_CAS_PASS_VALID_DOMAIN_NAME=\"\$POSTGRES_CUSTOMER_CAS_DOMAIN_NAME\"" - echo "export POSTGRES_IAM_USER=\"\$POSTGRES_USER_IAM\"" - echo "export MYSQL_IAM_USER=\"\$MYSQL_USER_IAM\"" } > "$1" } @@ -172,6 +182,7 @@ if [[ "$#" -lt 1 ]] ; then fi cd "$SCRIPT_DIR" +init_venv "$@" From 71653e1ace91ea14ce4a9169934b93e5cdba66c8 Mon Sep 17 00:00:00 2001 From: hessjc Date: Thu, 22 Jan 2026 17:20:48 +0000 Subject: [PATCH 2/2] build: Add PyPI to PIP_EXTRA_INDEX_URL to fix package resolution --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index fba53f25..d8e6396d 100755 --- a/build.sh +++ b/build.sh @@ -33,6 +33,9 @@ fi source "$PWD/venv/bin/activate" python --version +# Add PyPI as an extra index to find packages missing from the internal mirror +export PIP_EXTRA_INDEX_URL=https://pypi.org/simple + if which pip3 ; then PIP_CMD=pip3 elif which pip ; then