fix(github): keep exact page-limit fetches complete instead of capped#1385
Open
Dexterity104 wants to merge 1 commit into
Open
fix(github): keep exact page-limit fetches complete instead of capped#1385Dexterity104 wants to merge 1 commit into
Dexterity104 wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1385 +/- ##
==========================================
- Coverage 95.35% 95.35% -0.01%
==========================================
Files 191 191
Lines 20711 20709 -2
Branches 7488 7487 -1
==========================================
- Hits 19750 19748 -2
Misses 380 380
Partials 581 581
🚀 New features to boost your workflow:
|
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.
Summary
The REST paginator
githubPagedflagged a sync segment ascappedwhenever a fetch ended withitems.length >= limit, even when the repository had already returned its entire set in a full final page with norel="next"link. A repo with exactlylimitopen issues or pull requests was reported as truncated: the publicdataQuality.cappedflag was set and a wasteful resume fetch was scheduled against a fabricated cursor that pointed at an empty page.Genuine overflow is already handled inside the pagination loop, where a real next page sets
status = "capped"together with its true resume cursor, so the post-loop block could only ever fire on the false positive. The fix drops the speculative cursor on a clean, fully drained fetch so an exact-limit final page stayscomplete. It also prevents a later resume from starting at page two and skipping page one, becausegithubPagedreads the stored cursor without checking the prior status.No issue is linked: this is a small, self-contained correctness fix confined to the backfill paginator and its tests.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragenpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/github/backfill.tsand its unit tests, so the UI, MCP, and OpenAPI surfaces are unaffected and their checks pass unchanged.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable. This change is backend-only and has no visible UI, frontend, docs, or extension surface.
Notes
completerather thancapped, and updated the existing cap test to model genuine overflow with a realrel="next"link.