Honor per-operation retry policies in the generated client - #94
Draft
code-monger-givenall wants to merge 1 commit into
Draft
Honor per-operation retry policies in the generated client#94code-monger-givenall wants to merge 1 commit into
code-monger-givenall wants to merge 1 commit into
Conversation
Merged
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.
What changed
The generated Go client now follows each operation's
x-hey-retrycontract.maxAttempts,baseDelayMs,backoff, andretryOnfrom generated operation metadata.WithMaxRetriesandWithBaseDelayremain explicit overrides. Default client settings no longer replace operation defaults.UpdateClearanceexports its natural idempotency into OpenAPI, so the generated PATCH method uses its retry policy.WithBodymethods buffer their input before retrying, so every attempt sends the complete body.Why
Smithy says
UpdateClearancegets two attempts and retries only 429 and 503. The generated client was not enforcing that contract. On currentmain, the new typed Screener operation also lost its idempotency marker during OpenAPI projection, which meant it did not retry at all.Validation
env GOWORK=off mise x -- make checkSummary by cubic
Honor per-operation retry policies in the generated Go client and mark
UpdateClearanceas naturally idempotent. This aligns client retries with the API contract and avoids unintended retries.x-hey-retrysettings (maxAttempts,baseDelayMs,backoff,retryOn). The old global retryable statuses are gone; undeclared statuses (e.g., 500) no longer retry.generated.WithMaxRetries,generated.WithBaseDelay, andgenerated.WithRetryConfigoverride attempts and initial delay only. Retryable statuses always come from the operation’s policy.*WithBodymethods buffer the request body so each retry sends the complete body.UpdateClearanceexports idempotency in Smithy/OpenAPI; the generated PATCH now follows its policy (2 attempts, retry on 429 and 503).Migration
retryOnor stop relying on those retries.UpdateClearancewill not retry 500.generated.WithMaxRetriesorgenerated.WithBaseDelay(orWithRetryConfig); these do not change which statuses retry.heyclient,WithMaxRetriesandWithBaseDelayapply only when set. Without overrides, per-operation defaults take effect.Written for commit 148c20c. Summary will update on new commits.