Repository navigation
feat: Refactor new client - #3739
Merged
Merged
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
stevehipwell
force-pushed
the
stevehipwell/refactor-new-client
branch
2 times, most recently
from
November 19, 2026 16:23
f2496c9 to
85cc582
Compare
Signed-off-by: Steve Hipwell <[email protected]>
stevehipwell
force-pushed
the
stevehipwell/refactor-new-client
branch
from
November 19, 2026 16:30
85cc582 to
71ea44c
Compare
Collaborator
Author
|
The acceptance tests still need fixing (I'm working on that), but they all ran in 30 mins on this branch which looks promising to me. |
robert-crandall
approved these changes
Nov 19, 2026
robert-crandall
left a comment
Contributor
There was a problem hiding this comment.
Thanks for putting this together! Splitting httpx, ghratelimit, and ghclient makes the transport stack much easier to follow, and moving the throttle inside the retry and rate-limit waits is a great fix. Looks good to ship!
This was referenced Nov 23, 2026
Closed
4 of 5 tasks
4 of 5 tasks
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.
Closes #3703
Closes #3660
Closes #3562
Refactors the new client implementation (
legacy_client = false) to re-aligned it to the original code it was based off. The legacy client is unchanged.Before the change?
legacy_client = false) lived entirely ininternal/ghclientand was configured through option structs.gofri/go-github-ratelimit, and the REST and GraphQL clients each had their own separate rate-limit state.retry_delay_ms, so retries effectively used a fixed delay.cache_pathit fell back to a temporary directory. If the cache file was already in use, opening it could block indefinitely.After the change?
internal/httpx(general HTTP transports),internal/ghratelimit(GitHub rate limiting) andinternal/ghclient(client and auth wiring), configured through validated option functions.gofri/go-github-ratelimit. It understands GitHub's rate-limit categories, waits instead of failing once a limit is used up, handles secondary limits, and caps how long it will wait. REST and GraphQL share its state.retry_delay_msup to 5 minutes), honoursRetry-After, and stops before the context deadline. Retries resend the original request body (if a body can't be replayed directly, it's rewound or buffered as a fallback).cache_pathis set, and is REST-only. A cache error never fails a request, and a clear error is returned if the cache is already in use by another configuration.gofri/go-github-ratelimitandhashicorp/golang-lrudependencies.github.com/go-jose/go-jose/v4,github.com/hashicorp/terraform-plugin-sdk/v2,github.com/jferrl/go-githubauth,github.com/sethvargo/go-retry,golang.org/x/crypto,golang.org/x/oauth2&golang.org/x/syncdpendenciescache_pathmust be unique per provider configuration, including aliases and concurrent runs. The docs are updated to say so.POST, GraphQL requests are not retried on 500/502/504. This can be addressed as a followup.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!