feat: show rate-limit UI feedback during 429 retry backoff#612
Open
danskmt wants to merge 1 commit into
Open
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
4 tasks
This comment has been minimized.
This comment has been minimized.
d01c9f2 to
3e467d9
Compare
This comment has been minimized.
This comment has been minimized.
danskmt
commented
May 22, 2026
3e467d9 to
72ba2b7
Compare
This comment has been minimized.
This comment has been minimized.
robertolopezlopez
approved these changes
May 22, 2026
72ba2b7 to
db8094f
Compare
This comment has been minimized.
This comment has been minimized.
db8094f to
0619f04
Compare
0619f04 to
158a66d
Compare
This comment has been minimized.
This comment has been minimized.
158a66d to
7deee91
Compare
This comment has been minimized.
This comment has been minimized.
7deee91 to
948059b
Compare
This comment has been minimized.
This comment has been minimized.
948059b to
e6185df
Compare
This comment has been minimized.
This comment has been minimized.
e6185df to
b2a5217
Compare
PR Reviewer Guide 🔍
|
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.
Description
When the CLI is rate-limited (HTTP 429), retry backoff previously happened silently, making the CLI look hung. This PR adds user-visible feedback during 429 retry waits and records retry rate-limit events in v2 instrumentation.
During 429 backoff (between attempts):
RetryMiddlewarewraps retry failures inRetryAttemptErrorand invokes an optionalRetryNotifyFuncviabackoff.WithNotify.networkImpl.handleRetryNotifymaps 429 attempts to a catalogTooManyRequestsError(Level: warn, detail:Waiting up to Xs before retry (attempt N/M).) and shows it viaOutputError.Telemetry:
engineimpl.gowiresSetRetryNotifyon the cloned network access to callAddErrorwith the catalog 429 warn, which appears in v2interaction.errorsas SNYK-0001.When 429 retries are exhausted:
RetryMiddlewarestill returns the last 429 response withnilerror (unchanged).ResponseMiddlewaremaps 429 to SNYK-0001 (TooManyRequestsError, levelerror) — covered by an added test inresponse_test.go;response.gois unchanged.Plumbing:
retry_middleware.go:RetryAttemptError,RetryNotifyFunc, optional callback onNewRetryMiddleware,notifyRetrynetworking.go:RetryFeedbackNetworkAccessoptional interface,handleRetryNotify,CatalogNotificationFromRetryAttempt, UI + callback wiring onnetworkImplengineimpl.go:SetUserInterfaceon network access; per-invocationSetRetryNotifyfor instrumentationpkg/mocks/networking.go:MockRetryFeedbackNetworkAccessTestCatalogNotificationFromRetryAttempt, retry callback/exhaustion tests, 429 mapping inresponse_test.goChecklist
make test)make generate)make lint)go get github.com/snyk/go-application-framework@b2a5217339f862aaabf928c17c1429a0cec9b549in thecliv2directory.go.modto point to your local GAF code.go mod tidyin thecliv2directory.go.modandgo.sumchanges.CLI PR: snyk/cli#6836