feat(environments): add new filtering and pagination flags#951
Conversation
Fixes #934 * Pagination params are only sent to the API when the user explicitly sets --page or --page-limit, preserving the existing full-list behaviour when no flags are passed. * The table printer handles both the legacy array response and the paginated response shape, appending a pagination footer for the latter. * Filters map to the corresponding query params on `GET /api/v2/environments/{org}`: name, type, space_id and tag are repeatable with OR semantics. As with pagination, nothing is sent when the flags are not used (#934). * Adds a TagEnv test helper mirroring TagFlow. * Map to the sort and sort_direction query params; sent only when set, so the API defaults (name, asc) apply otherwise. Valid values are enforced by the API, not the CLI. * The `unknown-space-id` case is blocked on the server returning a `5xx` instead of an empty list, reported upstream in kosli-dev/server#5858. Re-enable the commented-out case once that is fixed.
|
Claude finished @mbevc1's task in 2m 21s —— View job Claude PR Review
Static analysis: This is a clean, well-scoped PR. The conditional-params design (nothing sent unless the flag is set) is the right call for preserving existing behaviour, and it's applied consistently across pagination, filters, and sort. Good test coverage with deterministic, uniquely-prefixed fixtures. What's done well 👍
Suggestions (non-blocking)
No correctness or security concerns found. Nice work. |
Fixes #934
GET /api/v2/environments/{org}: name, type, space_id and tag are repeatable with OR semantics. As with pagination, nothing is sent when the flags are not used (feat:kosli list environments: add pagination and filtering flags #934).unknown-space-idcase is blocked on the server returning a5xxinstead of an empty list, reported upstream in kosli-dev/server#5858. Re-enable the commented-out case once that is fixed.cloud-run