Repository navigation
Conversation
…tic-ips list These three commands made a single request without page[size] or page[number], so they showed only the API's first page (20 items) and ignored --page-size, --max-items and --no-paginate. A team with more than 20 firewalls, assignments or Elastic IPs never saw the rest. Request --page-size items per page and drive the SDK Next closures with pagination.Walk, like servers and user-data list already do. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lsh firewalls list,lsh firewalls assignments list(both the team-wide and the--firewallform) andlsh elastic-ips listmake a single request with nopage[size]/page[number], so they only show the API's first page (20 items) and ignore the global--page-size,--max-itemsand--no-paginateflags. A team with more than 20 firewalls, assignments or Elastic IPs never sees the rest, and nothing tells the user the list was cut.Fix
Each command now requests
--page-sizeitems per page and walks the SDKNextclosures withpagination.Walk, the same wayservers listanduser-data listalready do.--max-itemscaps the total, and--no-paginatestops after the first page and prints the "Next page" hint to stderr. The request building moved into smalllistFirewalls/listAssignments/listElasticIPshelpers that take the SDK client, so they can be tested against a local server. Filters (--project,--server,--status) are kept on every page.Testing
TestListFirewallsWalksEveryPage: anhttptestserver that pages like the API serves 5 firewalls; with--page-size 2all 5 come back from pages 1, 2, 3 withpage[size]=2on each request;--max-items 3stops after page 2 and--no-paginateafter page 1, both reporting more results.TestListAssignmentsWalksEveryPage: 45 assignments over 3 pages, team-wide and for one firewall.TestListElasticIPsWalksEveryPage: 45 Elastic IPs over 3 pages, withfilter[server]sent on every page.mainvs this branch:mainfirewalls listfirewalls assignments listelastic-ips list(Pointing the CLI at the local server needs #99; I built both binaries with it applied.)
go vet ./cmd/... ./internal/...,go test ./...andgolangci-lint run ./cmd/firewalls ./cmd/elasticipspass.AI disclosure: written with the help of Claude Code, reviewed and tested by me.
Note
Low Risk
CLI-only listing behavior with established pagination helpers; no auth or mutation paths changed.
Overview
Fixes incomplete listings for
lsh firewalls list,lsh firewalls assignments list(team-wide and--firewall), andlsh elastic-ips list, which previously issued a single API call and only showed the first page (~20 items), ignoring global--page-size,--max-items, and--no-paginate.Each command now resolves pagination options, sets
page[size]/page[number]on requests, and usespagination.Walkwith the SDK’sNexthandlers—matching other list commands. Filters (--project,--server,--status) stay on every page; when--no-paginateis set and more pages exist,pagination.PrintNextCursorprints the next page hint.Logic moves into testable helpers
listFirewalls,listAssignments, andlistElasticIPs. Newhttptestcases verify multi-page fetching,max-items/no-paginatebehavior, and that filters are sent on each request.Reviewed by Cursor Bugbot for commit 831428a. Bugbot is set up for automated code reviews on this repo. Configure here.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Adds pagination to firewall, firewall assignment, and Elastic IP lists.
Reviews (1) · Last reviewed commit: "fix(cli): walk every page in firewalls, ..." · Reviewed by Greptile