fix(ci): retry only the answers that can change on a second attempt - #14
Merged
Merged
Conversation
Treating every 4xx as final would have failed a release on a 429 rate limit or a 408 timeout, which are both worth another attempt. Retry those two along with 5xx and transport failures, and report anything else immediately. The retry bookkeeping now lives after the case statement rather than inside a branch, so a retryable status cannot leave the loop spinning without a delay or an attempt count.
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 previous change classified every
4xxas final. A429rate limit or a408timeout would then fail the release on the first answer, even though bothcan succeed moments later.
An intermediate version tried to handle this with an empty
408 | 429)branch,which does not work:
;;ends the branch instead of falling through, so aretryable status would have left the
whileloop spinning with no delay and noattempt counter.
Changes
000(transport failure),408,429, and5xx; report anything else at once.casestatement, so no status can skip the delay or the attempt count.Verification
The retry loop was extracted from the parsed workflow with the HTTP call
replaced by a stub that returns a scripted sequence of status codes:
npm run lintclean,npm test140/140.