- Reorder stdlib imports in review_test.go to alphabetical (goimports convention)
- Restore explanatory comment for nil body in DeleteReview
Addresses review comments #20533, #20534 on PR #119
F1: Add comprehensive pagination tests for ListReviews covering:
- Multi-page behaviour (2 full + 1 partial page)
- Exact-multiple-of-pageSize (extra empty-page round-trip)
- maxReviewPages cutoff (cap hit, results still returned)
- Empty first page (PR with no reviews)
F2: Fix truncation warning logic by moving it outside the loop with
a 'truncated' flag. Previously, the warning fired inline at page==maxPages
which could miss the case where the short-page break fires first on the
cap page. Now it only fires when the loop exits because the cap was reached
and the last page was full (indicating more data likely exists).
Also adds SetReviewPagination to Client for test-time override of page
size and max pages, following the existing SetRetryBackoff pattern.
Remove github/review.go and github/identity.go, replacing them with a
consolidated github/reviews.go that:
- Uses doJSONRequest for PostReview and DismissReview (cleaner than
manual marshal + doRequestWithBody)
- Adds paginated ListReviews with per_page=100 and max 100 pages
- Consolidates GetAuthenticatedUser and userResponse type (previously
duplicated in identity.go)
- Preserves all sentinel errors (ErrCannotDeleteSubmittedReview,
ErrConflictingCommitIDs), state translation, commit ID validation,
and SupersedeReviews
This prevents the redeclaration errors that occur when both review.go
and reviews.go exist in the same package, as described in issue #116.
Closes#116