Merged
Conversation
4c07823 to
8467387
Compare
Changed the way that the CLI implements rate limits and the back off. We've removed the dependency on `roko`, which shouldn't be required with the availability of the `RateLimit-` headers that we can get from client calls.
a1b7ebe to
901b59c
Compare
Comment on lines
+61
to
+65
| func WithTransport(t http.RoundTripper) FactoryOpt { | ||
| return func(c *factoryConfig) { | ||
| c.transport = t | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Does this overwrite the retry behaviour for 429s in https://github.com/buildkite/go-buildkite/blob/main/buildkite.go#L383-L403? Could there be two backoff loops on top of each other for 429s if it doesn't?
Contributor
Author
There was a problem hiding this comment.
@matthewborden it does; go-buildkite uses a generic exponential backoff which will act as a fallback if our checks fail for some reason (missing headers or something)
We're using the RateLimit-Reset, which will mean we have an exact time for retrying, rather than the exponential value that go-buildkite might use
Contributor
There was a problem hiding this comment.
Let's address this in a followup PR, I'd prefer to have one backoff loop managing rate limit retries.
matthewborden
approved these changes
Apr 10, 2026
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
Changed the way that the CLI implements rate limits and the back off. We've removed the dependency on
roko, which shouldn't be required with the availability of theRateLimit-headers that we can get from client calls.Moves the logic in to a reusable HTTP transport so commands/clients can share it.
Changes
Caveats
Testing
go test ./...)go fmt ./...)Disclosures / Credits
I used AI assistance (OpenCode / GPT-5.3 Codex) to review the diff, it highlighted a regression in some logic I'd written where if
RateLimit-Resetwas equal to0on check it would wait 10s.