Skip to content

feat(cli): add server-side pagination - #708

Merged
pcfreak30 merged 3 commits into
developfrom
feat/cli-server-pagination
Sep 15, 2026
Merged

pcfreak30 merged 3 commits into
developfrom
feat/cli-server-pagination

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Reworks admin platform-domain and social-provider lookups, DNS zone resolution, and API-key listing to use the paged list APIs from the latest pinner, ipfs-sdk, and portal-sdk releases.

Bumps ipfs-sdk to v0.1.99, portal-sdk to v0.1.74, and pinner to the current develop head, and regenerates the API-key service mock for the paginated signature.


Pull Request Description

Title: feat(cli): add server-side pagination

Summary:

The backend APIs used by several CLI commands now apply a default 10-row window to their list endpoints. Previously, CLI flows that resolved resources by name read only the first page returned, so any item beyond the first 10 rows was silently missed. This PR updates those flows to support server-side pagination.

Key changes:

  • Platform domain and social provider resolution (internal/cli/catalog_admin_wiring.go): Name/ID lookups for platform domains and social providers now page through the entire dataset using _start/_end window parameters (100 items per page) until the backend-reported total is reached. This ensures items past the first default window can still be resolved.
  • DNS zone-by-domain resolution (internal/cli/dns.go): Zone lookup now pages through ListZonesPage with start/limit options instead of relying on the non-paginated ListZones wrapper, which only returns the first window.
  • API key listing (internal/cli/account_api_keys.go): The ListAPIKeys interface now accepts start and limit parameters, and the list/delete flows pass pagination arguments through to the service.
  • Test and mock updates: Mock services and tests were updated to match the new paginated signatures (ListAPIKeys with start/limit, ListPlatformDomains with params, plus new ListZonesPage/ListKeysPage mock methods).

Known review findings:

  • [critical] The new allPlatformDomains/allSocialProviders pagination loops can iterate forever and grow the accumulated result slice unboundedly when the backend reports no global total or returns full pages regardless of the requested window; the break condition relies entirely on total > 0.
  • [high] The API-key list/delete flows now call the paginated ListAPIKeys with a zero window (0, 0), which returns only the default 10-row window while still reporting the full total, truncating any keys past the first 10.

- Pages platform-domain and social-provider resolution via admin list APIs
- Resolves DNS zones by paging ListZonesPage instead of the first page
- Passes paging through API-key service listing
- Bumps ipfs-sdk, portal-sdk, and pinner to the paged list releases
- Regenerates the API-key service mock for the paginated signature
@kody-ai

This comment has been minimized.

Comment thread internal/cli/account_api_keys.go Outdated
Comment thread internal/cli/catalog_admin_wiring.go

@kody-ai kody-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 55.3%

Generated from commit: 9c3332c
Repository: LumeWeb/pinner-cli

The account api-keys list and delete-by-name paths called ListAPIKeys
with a zero window, so the backend's default 10-row page truncated
results: the list rendered only the first page while reporting the
full count, and deleting a key by name past the first page failed.

- Add an allAPIKeys full-scan helper that walks explicit start/limit
  windows until every key is collected, mirroring the
  allPlatformDomains/allSocialProviders pattern
- Use it in the list handler so all keys are shown
- Use it in delete-by-name resolution so keys beyond the first page
  resolve to their UUID before deletion
- Add regression tests covering a >10-key list and name resolution
  past the first page
@kody-ai

This comment has been minimized.

@pcfreak30
pcfreak30 marked this pull request as ready for review September 15, 2026 20:05
Comment thread internal/cli/account_api_keys.go
Comment thread internal/cli/account_api_keys.go Outdated
Comment thread internal/cli/account_api_keys_test.go
…scanning

accountAPIKeysDelete resolved a name to its UUID by full-scanning every API
key (allAPIKeys with an empty search), so the backend returned the account's
whole key set. Pass the provided name as the backend search filter so the
backend narrows the pages, while keeping allAPIKeys' paginated scan (explicit
start/limit windows plus the short-page/total termination guards) so a match
past the backend's default first page still resolves before deletion.

Update the regression test to prove filtered paging reaches a key beyond the
first page: keys share a common prefix so the name search returns multiple
full pages of filtered rows, the exact-name target sits past the first page,
and every paged request carries the name as the search filter.
@kody-ai

kody-ai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@pcfreak30
pcfreak30 merged commit 30b6422 into develop Sep 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant