chore: fix retry logic in check-kilo-version workflow#258
Merged
Conversation
GitHub Actions runs bash with -eo pipefail by default. The bare LATEST=$(...) assignment triggered set -e on curl failure, killing the script before the $? check was reached. Wrap the assignment in an if-condition to suppress errexit, add authentication header, and add jitter to backoff.
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.
Problem
The
check-kilo-versionworkflow has been failing with exit code 22 (curl HTTP error). The retry loop with exponential backoff was structured correctly but never actually retried — the script died on the first failure.Root Cause
GitHub Actions runs bash with
-eo pipefailby default. The original code used a bare assignment:When
curl -sSfreturned a non-zero exit code,set -ekilled the script immediately at the assignment — the$?check was never reached. The CI log confirmed this: exit code 22 (from curl) instead of exit code 1 (from the explicitexit 1).Fix
if-condition — this suppressesset -efor the tested command, which is the idiomatic bash pattern for retry loops under errexitAuthorization: Bearerheader — authenticated requests get higher rate limits (5,000/hr vs 60/hr)RANDOM % 5prevents thundering herd on coinciding scheduled runs