From 356951f346c4ddc82a1b40c00eb32d83fa721b8a Mon Sep 17 00:00:00 2001 From: fargito Date: Tue, 1 Dec 2026 12:09:24 +0000 Subject: [PATCH 1/2] fix: retry the CLI installer download GitHub Releases can redirect to a signed link that has already expired, and that link answers HTTP 618, which `curl --retry` does not retry. One such answer failed the whole job before any benchmark ran. Download the installer with `curl --retry 5 --retry-all-errors`: each retry starts again from codspeed.io, so github.com issues a fresh link. `latest` and prereleases are now downloaded the same way instead of being piped into bash, since curl can send duplicate data down a pipe when it retries. Once the retries run out, the error says the installer is hosted on GitHub Releases. Refs COD-4520 --- action.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/action.yml b/action.yml index 0864e9e..a3b594f 100644 --- a/action.yml +++ b/action.yml @@ -206,17 +206,31 @@ runs: SKIP_HASH_CHECK_WARNING="${{ inputs.skip-hash-check-warning }}" + INSTALLER_TMP=$(mktemp) + CURL_ERR=$(mktemp) + trap 'rm -f "$INSTALLER_TMP" "$CURL_ERR"' EXIT + # GitHub Releases fails transiently (5xx, HTTP 618 for an expired signed link). Each retry + # starts again from the codspeed.io URL, so GitHub issues a fresh link. + download_installer() { + if ! curl -fsSL --retry 5 --retry-all-errors -o "$INSTALLER_TMP" "$1" 2>"$CURL_ERR"; then + echo "::error title=Failed to install CodSpeed CLI::Failed to download $1 after 6 attempts: $(tail -n 1 "$CURL_ERR").%0AThe installer is hosted on GitHub Releases. Re-run the job, and check https://www.githubstatus.com if it keeps failing." + exit 1 + fi + } + if [ "$VERSION_TYPE" = "latest" ]; then if [ "$SKIP_HASH_CHECK_WARNING" != "true" ]; then echo "::warning::Hash verification is not available when using 'latest' version. Consider pinning a specific version for supply chain security." fi - curl -fsSL https://codspeed.io/install.sh | bash -s -- --quiet + download_installer https://codspeed.io/install.sh + bash "$INSTALLER_TMP" --quiet elif [ "$VERSION_TYPE" = "prerelease" ]; then # Prereleases are not pinned, so install from the versioned installer without hash verification. if [ "$SKIP_HASH_CHECK_WARNING" != "true" ]; then echo "::warning::Hash verification is not available for prerelease version $RUNNER_VERSION." fi - curl -fsSL "https://codspeed.io/v$RUNNER_VERSION/install.sh" | bash -s -- --quiet + download_installer "https://codspeed.io/v$RUNNER_VERSION/install.sh" + bash "$INSTALLER_TMP" --quiet elif [ "$VERSION_TYPE" = "branch" ]; then # Install from specific branch using cargo if [ "$SKIP_HASH_CHECK_WARNING" != "true" ]; then @@ -233,20 +247,7 @@ runs: cargo install --locked --git https://github.com/CodSpeedHQ/codspeed --rev "$RUNNER_VERSION" codspeed-runner else # Release version - download to temp file and verify hash - INSTALLER_URL="https://codspeed.io/v$RUNNER_VERSION/install.sh" - INSTALLER_TMP=$(mktemp) - trap "rm -f $INSTALLER_TMP" EXIT - - CURL_ERR=$(mktemp) - if ! HTTP_CODE=$(curl -sSL -o "$INSTALLER_TMP" -w "%{http_code}" "$INSTALLER_URL" 2>"$CURL_ERR"); then - echo "::error title=Failed to install CodSpeed CLI::Installation of CodSpeed CLI with version $RUNNER_VERSION failed.%0AReason: $(cat "$CURL_ERR")" - exit 1 - fi - if [ "$HTTP_CODE" -ge 400 ]; then - error_body=$(cat "$INSTALLER_TMP") - echo "::error title=Failed to install CodSpeed CLI::Installation of CodSpeed CLI with version $RUNNER_VERSION failed.%0AReason: HTTP $HTTP_CODE - ${error_body:-no response body}" - exit 1 - fi + download_installer "https://codspeed.io/v$RUNNER_VERSION/install.sh" EXPECTED_HASH="${{ steps.installer-hash.outputs.hash }}" if [ -z "$EXPECTED_HASH" ]; then From fa55c2f047e03d6cb43ffa850bc32fc73d056341 Mon Sep 17 00:00:00 2001 From: fargito Date: Tue, 1 Dec 2026 13:47:53 +0000 Subject: [PATCH 2/2] ci: retry the installer downloads in check-hashes.sh check-installer-hashes failed 3 of its 72 downloads once on this PR, then passed on a rerun: GitHub Releases fails transiently. Refs COD-4520 --- scripts/check-hashes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-hashes.sh b/scripts/check-hashes.sh index acd45d5..f5b20d3 100755 --- a/scripts/check-hashes.sh +++ b/scripts/check-hashes.sh @@ -27,7 +27,7 @@ for VERSION in $VERSIONS; do INSTALLER_TMP=$(mktemp) trap 'rm -f $INSTALLER_TMP' EXIT - if ! curl -fsSL "$URL" -o "$INSTALLER_TMP" 2>/dev/null; then + if ! curl -fsSL --retry 5 --retry-all-errors "$URL" -o "$INSTALLER_TMP" 2>/dev/null; then echo "FAIL $VERSION - download failed ($URL)" FAILED=$((FAILED + 1)) continue