Extract shared GitHubApiTransport for the GitHub API services - #3849
Merged
Conversation
cotti
force-pushed
the
feature/github-api-transport
branch
from
August 13, 2026 08:47
abb27d5 to
eb2d195
Compare
Mpdreamz
approved these changes
Aug 13, 2026
cotti
force-pushed
the
feature/github-api-transport
branch
2 times, most recently
from
August 13, 2026 09:38
83a57ba to
c3b1652
Compare
Base automatically changed from
feature/changelog-commit-range-bundling
to
main
August 13, 2026 11:49
GitHubPrService, GitHubReleaseService, and GitHubCommitRangeService each duplicated HttpClient setup, User-Agent/Accept headers, and GITHUB_TOKEN bearer attachment; the two older services used a static client that could not be faked at the HTTP level. The shared transport centralizes those concerns and gives every consumer an injectable HttpMessageHandler for fake-HTTP tests, while each service keeps its own response policy (lenient warn-and-null vs strict fail-the-run). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
cotti
force-pushed
the
feature/github-api-transport
branch
from
August 13, 2026 11:49
c3b1652 to
05d47bd
Compare
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.
Why
GitHubPrService,GitHubReleaseService, and the newGitHubCommitRangeServiceeach duplicated the same HTTP plumbing (client setup,User-Agent/Acceptheaders,GITHUB_TOKENbearer attachment), and the two older services used a process-wide staticHttpClientthat could not be faked at the HTTP level — they were only testable behind FakeItEasy interface fakes.What
A shared
GitHubApiTransportowns the client lifetime, headers, token resolution, and GraphQL POSTs, with an injectableHttpMessageHandler(the same patternCdnChangelogEntryFetcheruses) so every GitHub service is now testable with fake HTTP. Response-handling policy intentionally stays with each service: the PR/release services keep their lenient warn-and-return-null behavior, the commit-range service keeps its strict fail-the-run behavior. No behavior change.Stack: 3/3 — based on the commit-range bundling PR.