Repository navigation
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. |
kosli-cli 2.26.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## Notable changes - `attest jira`: documented automatic exclusion of Jira-like tokens that are immediately followed by a hyphen and digit (e.g. CVE identifiers) - `delete api-key`: confirmation prompt now appears inline (answer typed on the same line); cancellation and deletion messages use consistent capitalisation and punctuation ## What's Changed * feat(list flows): add `--name` and `--ignore-case` search flags by @mbevc1 in kosli-dev/cli#947 * docs(attest jira): improve CVE/multi-segment filtering help text by @jbrejner in kosli-dev/cli#950 * chore: remove obsolete Claude instruction by @mbevc1 in kosli-dev/cli#952 * fix(api-keys): inline confirmation prompt and unify message style by @mbevc1 in kosli-dev/cli#948 * feat(environments): add new filtering and pagination flags by @mbevc1 in kosli-dev/cli#951 * chore(deps): bump planetscale/ghcommit-action from 0.2.21 to 0.2.22 in the github-actions-dependencies group by @dependabot[bot] in kosli-dev/cli#954 * chore(deps): bump the go-dependencies group with 5 updates by @dependabot[bot] in kosli-dev/cli#955 **Full Changelog**: https://github.com/kosli-dev/cli/compare/v2.25.0...v2.26.0</pre> <p>View the full release notes at <a href="https://github.com/kosli-dev/cli/releases/tag/v2.26.0">https://github.com/kosli-dev/cli/releases/tag/v2.26.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!11308
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