Repository navigation
[W-11] Harden the GitHub REST client - #334
Merged
Merged
Conversation
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.
What
Route both GitHub review-state and SCM requests through one internal REST client with consistent API/auth headers, bounded JSON reads, same-origin redirects, Link pagination, and rate-limit handling.
Why
GitHub pagination and primary/secondary rate limits were handled differently between the two modules, and list calls could silently stop at the first page. The request path now honors Retry-After and x-ratelimit-reset for rate-limited GETs while keeping writes single-attempt.
How
src/github-api-client.tshelper and use@agentskit/net0.2.2 retry and bounded-read primitives.Link: rel="next"links for pull requests, file lists, comments, reviews, check runs, and commit statuses, with existing safety caps preserved.node:httpcoverage for three-page pagination, 429 and secondary 403 recovery, primary reset handling, no POST retry, oversized bodies, and redirects.Reuse
Published
@agentskit/net0.2.2 providesfetchWithRetry,retry,parseRetryAfter, andreadJson;@agentskit/integrations0.8.1 has GitHub service descriptors and generic HTTP projection, but no GitHub-specific REST client. The shared primitives cover this change, so no Octokit dependency is needed.Validation
npm ciandnpm ci --prefix apps/docsnpm run check— passed; 327 tests and all configured docs, public API snapshot, CLI help, and README gates passed.npm pack --dry-run— passed.git diff --check— passed.