fix: pagination loop termination and issue de-duplication#4
Open
Codimow wants to merge 1 commit into
Open
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.
🎯 Fix: Pagination Loop Termination with
SinceFilterCloses #1
Issue
Issue #1 — Pagination fails when fetching repository issues with the
Sincefilter.Root Causes Found
1. Wrong API Method Name (Critical — Code Did Not Compile)
The code called
f.client.Issues.ListByRepository(...)which does not exist ingo-githubv57. The correct method isListByRepo.2. Missing
go.sumThe repository was missing
go.sum, preventing dependency resolution.3.
main.goImport IssuesThe original
main.gohad a broken import alias and used an unauthenticated client despite requiring aGITHUB_TOKEN.Files Changed
pkg/github/client.goListByRepository→ListByRepo, added context cancellation checks, max-page safety bound, defensiveperPagedefault, and comprehensive documentationpkg/github/client_test.gomain.gogo.sumgo mod tidyAcceptance Criteria Verification
SinceactiveTestFetchIssuesWithSincePaginationNextPagefrom response, not slice lengthTestFetchIssuesWithSincePagination(page 2 returns 1 item < PerPage)Sincepreserved across all paginated callsTestFetchIssues_SincePreservedAcrossPagesNextPagelinkTestFetchIssues_EmptyPageWithNextLinkTestFetchIssues_NoDuplicatesAdditional Quality Tests
TestFetchIssues_SinglePageTestFetchIssues_RateLimitTestFetchIssues_ContextCancellationTestFetchIssues_DefaultPerPageperPage <= 0defaults to 30 instead of sending invalid valueTestFetchIssues_IntegrationAll tests pass ✅ | Race detector clean ✅ |
go vetclean ✅