Skip to content

Add pagination support to ingress list#915

Merged
milos-lk merged 2 commits into
mainfrom
milos/ingress-list-pagination
Jul 16, 2026
Merged

Add pagination support to ingress list#915
milos-lk merged 2 commits into
mainfrom
milos/ingress-list-pagination

Conversation

@milos-lk

Copy link
Copy Markdown
Contributor

Summary

  • Adds a --limit flag to lk ingress list and walks NextPageToken pages until the limit is reached or pages run out, mirroring lk egress list (Add pagination support to egress list #851).
  • Pages are prepended as they arrive (each successive page is older, items within a page are oldest-first), so the final output is chronological oldest-first across page boundaries; overshoot on the last fetched page keeps its newest tail.
  • Without --limit, behavior is unchanged: a single request returning one API page. The --id path is also unchanged (single request with id + room filters).
  • JSON output keeps the existing {"items": [...]} response-object shape (unlike egress's bare array) for compatibility with existing consumers; the deprecated list-ingress command has no limit flag and keeps single-page behavior.
  • Tests mirror egress_test.go: fake twirp Ingress service covering token walking, limit truncation, stop-on-empty-token, single-page default, and cross-page ordering.

Part of CS-1185.

Test plan

  • go test ./cmd/lk/
  • Manual: lk ingress list --limit N against a project with >1 page of ingresses; confirm no overlap and chronological ordering.

🤖 Generated with Claude Code

Mirror the egress list pagination: a new --limit flag walks pages via
NextPageToken, prepending each older page so output stays in
chronological oldest-first order. Without --limit, behavior is
unchanged (single API page). JSON output keeps the response-object
shape for compatibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@milos-lk
milos-lk requested a review from a team July 16, 2026 17:08
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@biglittlebigben biglittlebigben left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@milos-lk
milos-lk merged commit 401af7b into main Jul 16, 2026
22 checks passed
@milos-lk
milos-lk deleted the milos/ingress-list-pagination branch July 16, 2026 21:58
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.

3 participants