From 30a5e7fbe7541f87cb4c2aca328edf0bf6785e1c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:30:23 +0000 Subject: [PATCH 1/2] Initial plan From 45728ffff077476d6fda6bce18762adaacf481d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:47:26 +0000 Subject: [PATCH 2/2] fix: add retry logic with exponential backoff to install-packs.sh The GitHub Actions integration test was failing on windows-latest with HTTP 503 "Egress is over the account limit" when downloading CodeQL packs from GHCR.io. Add a run_with_retry() helper function that retries a command up to 3 times with exponential backoff (10s, 20s, 40s). Both codeql pack install calls in install_packs() now use run_with_retry to handle transient network errors gracefully. Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --- server/scripts/install-packs.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/server/scripts/install-packs.sh b/server/scripts/install-packs.sh index 069672d8..e488d130 100755 --- a/server/scripts/install-packs.sh +++ b/server/scripts/install-packs.sh @@ -63,13 +63,35 @@ REPO_ROOT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" ## Explicitly set the cwd to the REPO_ROOT_DIR. cd "${REPO_ROOT_DIR}" +## Define a helper to run a command with exponential-backoff retry. +## Usage: run_with_retry [args...] +run_with_retry() { + local _max_attempts="$1" + local _delay="$2" + shift 2 + local _attempt=1 + while true; do + if "$@"; then + return 0 + fi + if [ "${_attempt}" -ge "${_max_attempts}" ]; then + echo "ERROR: Command failed after ${_max_attempts} attempt(s): $*" >&2 + return 1 + fi + echo "WARNING: Command failed (attempt ${_attempt}/${_max_attempts}). Retrying in ${_delay}s..." >&2 + sleep "${_delay}" + _attempt=$((_attempt + 1)) + _delay=$((_delay * 2)) + done +} + ## Define a function to install the src and test packs for a given parent directory. install_packs() { local _parent_dir="$1" echo "INFO: Running 'codeql pack install' for '${_parent_dir}/src' directory..." - codeql pack install --no-strict-mode --additional-packs="${_parent_dir}" -- "${_parent_dir}/src" + run_with_retry 3 10 codeql pack install --no-strict-mode --additional-packs="${_parent_dir}" -- "${_parent_dir}/src" echo "INFO: Running 'codeql pack install' for '${_parent_dir}/test' directory..." - codeql pack install --no-strict-mode --additional-packs="${_parent_dir}" -- "${_parent_dir}/test" + run_with_retry 3 10 codeql pack install --no-strict-mode --additional-packs="${_parent_dir}" -- "${_parent_dir}/test" } ## Install codeql packs needed for integration tests.