From a19ab2f74aecfea075ccb79eb930c120e8de429d Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:21:49 +0000 Subject: [PATCH] fix(#6828): add retry with backoff for openshell install The install-openshell.sh script had no retry logic for the curl | sh pipeline that downloads and runs the upstream OpenShell installer. The upstream install.sh internally downloads the .deb from GitHub Releases, which can fail on transient CDN errors (as observed in E2E run 33432918746). Retrying only the outer curl would not cover that inner download. Wrap the entire install pipeline in a retry loop with exponential backoff (3 attempts, 5s/15s delays), matching the retry_curl() pattern already used in action.yml. Also add curl --retry 3 --retry-delay 5 to the outer download for additional resilience on the install.sh fetch from raw.githubusercontent.com. Diagnostic output uses stderr per shell-scripting.md to avoid stdout contamination if the script is ever called inside command substitution. Note: pre-commit hooks could not run in sandbox (network restriction blocked git fetch for hook repos). shellcheck was run directly and passed. The post-script runs an authoritative pre-commit check. Closes #6828 --- .github/scripts/install-openshell.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/scripts/install-openshell.sh b/.github/scripts/install-openshell.sh index 0fb298cb82..15e0cf380b 100755 --- a/.github/scripts/install-openshell.sh +++ b/.github/scripts/install-openshell.sh @@ -12,7 +12,28 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" source "${SCRIPT_DIR}/openshell-version.sh" echo "Installing OpenShell ${OPENSHELL_VERSION} (${OPENSHELL_SHA})" -curl -LsSf "https://raw.githubusercontent.com/NVIDIA/OpenShell/${OPENSHELL_SHA}/install.sh" \ - | OPENSHELL_VERSION="v${OPENSHELL_VERSION}" sh + +# Retry the entire install pipeline (curl | sh) with exponential backoff. +# The upstream install.sh internally downloads the .deb from GitHub Releases, +# which can fail on transient CDN errors. Retrying only the outer curl would +# not cover that inner download, so we retry the full pipeline. +max_attempts=3 +attempt=1 +delay=5 +while true; do + if curl -LsSf --retry 3 --retry-delay 5 \ + "https://raw.githubusercontent.com/NVIDIA/OpenShell/${OPENSHELL_SHA}/install.sh" \ + | OPENSHELL_VERSION="v${OPENSHELL_VERSION}" sh; then + break + fi + if (( attempt >= max_attempts )); then + echo "::error::OpenShell install failed after ${max_attempts} attempts" >&2 + exit 1 + fi + echo "::warning::OpenShell install attempt ${attempt}/${max_attempts} failed, retrying in ${delay}s..." >&2 + sleep "${delay}" + (( attempt++ )) + (( delay *= 3 )) +done openshell --version