Retry prek hook installation in CI when toolchain downloads fail - #72382
Draft
rjgoyln wants to merge 1 commit into
Draft
Retry prek hook installation in CI when toolchain downloads fail#72382rjgoyln wants to merge 1 commit into
rjgoyln wants to merge 1 commit into
Conversation
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.
rjgoyln
force-pushed
the
fix/ci-retry-prek-install-hooks
branch
from
September 1, 2026 17:11
fcb5f88 to
0575b26
Compare
rjgoyln
marked this pull request as ready for review
September 1, 2026 17:49
1 task
rjgoyln
marked this pull request as draft
September 3, 2026 16:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prek install-hooksdownloads hook toolchains without retrying. A transient 5xx therefore fails the job before any work starts.The prek cache step already retries its downloads, leaving hook installation as the last unguarded external dependency. Upgrading prek does not fix this: the download path is unchanged between 0.4.14 and 0.5.1 and still uses
go.dev.#72489 addresses how often this path is reached: a cache key mismatch currently leaves four job groups reinstalling every hook on every run. It does not remove the need for a retry, since hook installation still has to happen whenever a
.pre-commit-config.yamlor uv version change invalidates the key.Tests
Reproduced the same
go.devHTTP 500 failure with prek 0.4.14 and verified:tools/, so retries safely re-download the toolchain.The retry budget covers roughly two minutes, which is sufficient for the observed outage.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines