Skip to content

feat(miners): add cursor pagination to pulls and issues endpoints#126

Open
Yurii214 wants to merge 1 commit into
entrius:testfrom
Yurii214:feat/100-miner-pagination
Open

feat(miners): add cursor pagination to pulls and issues endpoints#126
Yurii214 wants to merge 1 commit into
entrius:testfrom
Yurii214:feat/100-miner-pagination

Conversation

@Yurii214
Copy link
Copy Markdown

Closes #100

Summary

  • Add cursor-based keyset pagination to GET /miners/:githubId/pulls and GET /miners/:githubId/issues
  • New cursor and limit query params; responses include next_cursor
  • Default page size 50, hard cap 200

Why

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 lint passes
  • npm run build passes

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 24, 2026
@Yurii214
Copy link
Copy Markdown
Author

Added cursor-based pagination for both miner endpoints with bounded page size and next_cursor support.
Lint/build are passing locally, and I’m happy to make any adjustments if you’d prefer a different cursor shape or limit policy.

@Yurii214
Copy link
Copy Markdown
Author

Built against the current test branch and adds cursor pagination for both miner endpoints with bounded page size and next_cursor support.
Happy to adjust the cursor format or limit behavior if you'd prefer a different API shape.

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@Yurii214 Yurii214 force-pushed the feat/100-miner-pagination branch from 7feb817 to 5cb92b0 Compare May 29, 2026 21:45
@Yurii214
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pagination for /miners/:githubId/pulls and /issues

2 participants