This is an automated email from the ASF dual-hosted git repository.

vatsrahul1001 pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-3-test by this push:
     new d9b248a33c2 [v3-3-test] Retry prek hook installation when a toolchain 
download fails (#72382) (#72748)
d9b248a33c2 is described below

commit d9b248a33c21dd8e739b37dff248ab99eb2227b6
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 10 08:12:50 2026 +0530

    [v3-3-test] Retry prek hook installation when a toolchain download fails 
(#72382) (#72748)
    
    prek provisions hook toolchains by downloading them and does not retry, so a
    transient 5xx from an upstream download host fails the job before it does 
any
    work. Only the jobs that reach this step before the prek cache tarball is
    written are exposed, which is why it lands on unrelated PRs at random.
    
    The cache restore step in this action is pinned to a revision that retries 
its
    own download for the same class of failure; hook installation was the last
    external dependency here without a guard.
    (cherry picked from commit 67522f253bdeb122c2174a89023938c210c6fef5)
    
    Co-authored-by: rjgoyln <[email protected]>
    Co-authored-by: Rahul Vats <[email protected]>
---
 .github/actions/install-prek/action.yml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/.github/actions/install-prek/action.yml 
b/.github/actions/install-prek/action.yml
index ad592947586..0987f69162b 100644
--- a/.github/actions/install-prek/action.yml
+++ b/.github/actions/install-prek/action.yml
@@ -107,7 +107,23 @@ runs:
       if: steps.restore-prek-cache.outputs.stash-hit != 'true' || 
steps.restore-prek-tar.outputs.tar-restored != 'true'
     - name: Install prek hooks
       shell: bash
-      run: prek install-hooks
+      # prek downloads the toolchains its hooks need and does not retry, so a 
transient 5xx
+      # from a download host fails the job before it does any work.
+      run: |
+        max_attempts=4
+        for attempt in $(seq 1 "${max_attempts}"); do
+          if prek install-hooks; then
+            exit 0
+          fi
+          if [[ "${attempt}" -eq "${max_attempts}" ]]; then
+            break
+          fi
+          delay=$((attempt * 20))
+          echo "prek install-hooks failed (attempt 
${attempt}/${max_attempts}), retrying in ${delay}s"
+          sleep "${delay}"
+        done
+        echo "prek install-hooks failed after ${max_attempts} attempts" >&2
+        exit 1
       working-directory: ${{ github.workspace }}
     - name: "Show prek log"
       shell: bash

Reply via email to