feat(miners): add cursor pagination to pulls and issues endpoints#126
feat(miners): add cursor pagination to pulls and issues endpoints#126Yurii214 wants to merge 1 commit into
Conversation
|
Added cursor-based pagination for both miner endpoints with bounded page size and next_cursor support. |
|
Built against the current test branch and adds cursor pagination for both miner endpoints with bounded page size and next_cursor support. |
anderdc
left a comment
There was a problem hiding this comment.
Clean implementation — shared module, input validation, and the keyset casing is consistent across cursor/predicate/order. One blocker: these endpoints are validator-facing and currently return all rows, and this flips the default to 50 unconditionally, which silently truncates what validators score on until they're updated to follow next_cursor. Gate the bounded default behind a MINERS_PAGINATION_ENABLED flag (default off) — via ConfigService/process.env, matching the existing config pattern — as #100's Backward-compatibility section specifies. The pagination params can stay live; just don't change the default page behavior until the flag is on.
Add cursor-based pagination support for miner pull and issue endpoints while preserving unbounded default responses unless MINERS_PAGINATION_ENABLED is enabled. Explicit cursor/limit requests can page immediately, and default bounded pagination can be turned on after validators follow next_cursor. Closes entrius#100 Co-authored-by: Cursor <cursoragent@cursor.com>
7feb817 to
5cb92b0
Compare
|
Updated. Default unbounded responses are preserved unless MINERS_PAGINATION_ENABLED is enabled. Explicit cursor / limit requests still paginate, so validators won't be silently truncated before they follow next_cursor. |
Closes #100
Summary
GET /miners/:githubId/pullsandGET /miners/:githubId/issuescursorandlimitquery params; responses includenext_cursorWhy
Unbounded miner endpoint responses can return hundreds of nested PR/issue rows. Pagination bounds payload size while keeping backward-compatible response shape.
Test plan
npm run lintpassesnpm run buildpasses