Skip to content

Extract shared GitHubApiTransport for the GitHub API services - #3849

Merged
cotti merged 1 commit into
mainfrom
feature/github-api-transport
Aug 13, 2026
Merged

Extract shared GitHubApiTransport for the GitHub API services#3849
cotti merged 1 commit into
mainfrom
feature/github-api-transport

Conversation

@cotti

@cotti cotti commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Why

GitHubPrService, GitHubReleaseService, and the new GitHubCommitRangeService each duplicated the same HTTP plumbing (client setup, User-Agent/Accept headers, GITHUB_TOKEN bearer attachment), and the two older services used a process-wide static HttpClient that could not be faked at the HTTP level — they were only testable behind FakeItEasy interface fakes.

What

A shared GitHubApiTransport owns the client lifetime, headers, token resolution, and GraphQL POSTs, with an injectable HttpMessageHandler (the same pattern CdnChangelogEntryFetcher uses) 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.

@cotti
cotti requested a review from a team as a code owner August 13, 2026 08:33
@cotti cotti added the chore label Aug 13, 2026
@cotti
cotti requested a review from reakaleek August 13, 2026 08:33
@cotti cotti added the chore label Aug 13, 2026
@cotti
cotti force-pushed the feature/github-api-transport branch from abb27d5 to eb2d195 Compare August 13, 2026 08:47
@cotti
cotti force-pushed the feature/github-api-transport branch 2 times, most recently from 83a57ba to c3b1652 Compare August 13, 2026 09:38
Base automatically changed from feature/changelog-commit-range-bundling to main August 13, 2026 11:49
@cotti
cotti requested a review from a team as a code owner 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
cotti force-pushed the feature/github-api-transport branch from c3b1652 to 05d47bd Compare August 13, 2026 11:49
@cotti
cotti merged commit 3faec45 into main Aug 13, 2026
25 checks passed
@cotti
cotti deleted the feature/github-api-transport branch August 13, 2026 12:49
@cotti
cotti restored the feature/github-api-transport branch August 13, 2026 12:51
@cotti
cotti deleted the feature/github-api-transport branch August 13, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants