Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Oct 29, 2025

Add cursor-based pagination to the /api/v1/trusted_publishing/github_configs endpoint using the id field as the cursor. Pagination is always enabled with a default of 10 items per page (following the codebase standard).

The implementation follows existing pagination patterns from the versions endpoint, using the seek!() macro for type-safe cursor serialization.

@Turbo87 Turbo87 requested a review from a team October 29, 2025 14:07
Add cursor-based pagination to the `/api/v1/trusted_publishing/github_configs`
endpoint using the `id` field as the cursor. Pagination is always enabled with
a default of 10 items per page (following the codebase standard).

Key changes:
- Add `ListResponseMeta` with `total` and `next_page` fields
- Implement seek-based pagination ordered by `id` ascending
- Support `?per_page=N` (max 100) and `?seek=<encoded>` query parameters
- Optimize to avoid COUNT query when first page fits all results
- Add comprehensive pagination test covering multiple pages

The implementation follows existing pagination patterns from the versions
endpoint, using the `seek!()` macro for type-safe cursor serialization.
@Turbo87 Turbo87 force-pushed the trustpub-list-pagination branch from f8607ae to 850e434 Compare October 29, 2025 14:58
Copy link
Contributor

@eth3lbert eth3lbert left a comment

Choose a reason for hiding this comment

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

Only a little nit about the PR title, the implementation LGTM 👍 Thanks!

@Turbo87 Turbo87 merged commit b214731 into rust-lang:main Nov 3, 2025
10 checks passed
@Turbo87 Turbo87 deleted the trustpub-list-pagination branch November 3, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants