Skip to content

feat: add pagination to miner PRs and issues endpoints#112

Open
Kelvinchen03 wants to merge 2 commits into
entrius:testfrom
Kelvinchen03:feat/pagination-for-miner-pulls-and-issues
Open

feat: add pagination to miner PRs and issues endpoints#112
Kelvinchen03 wants to merge 2 commits into
entrius:testfrom
Kelvinchen03:feat/pagination-for-miner-pulls-and-issues

Conversation

@Kelvinchen03
Copy link
Copy Markdown

Summary

Implements cursor-based pagination with hard result caps for the /miners/:githubId/pulls and /miners/:githubId/issues endpoints. Adds cursor and limit query parameters to prevent unbounded responses while maintaining backward compatibility. Results default to 50 per page with a maximum cap of 200.

Related Issues

Closes #100

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  1. Started dev server: npm run dev in d:/Projects/gittensor/das-github-mirror/packages/das

  2. Tested first page: GET /api/v1/miners/:githubId/pulls?limit=10

  • Returns ≤10 results with next_cursor field
  1. Tested pagination: GET /api/v1/miners/:githubId/pulls?cursor=&limit=10
  • No duplicate results between pages
  • Proper ordering by created_at DESC
  1. Tested limit cap: GET /api/v1/miners/:githubId/pulls?limit=500
  • Returns max 200 results (hard cap enforced)
  1. Tested backward compatibility: GET /api/v1/miners/:githubId/pulls
  • Works without pagination params, returns first 50 results
  1. Ran automated test script: node test-pagination.js
  • All pagination scenarios pass

Checklist

  • I have read the Contributing Guide
  • Code builds without errors
  • New and existing tests pass (if applicable)
  • Documentation updated (if applicable)
  • No unnecessary dependencies added

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 19, 2026
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

1 participant