feat(list flows): add --name and --ignore-case search flags#947
Merged
Conversation
Wire the API's `search_by_name` and `case_sensitive` query parameters into kosli list flows via new `--name` and `--ignore-case` flags. The change is additive: when no `--name` is given the request URL is unchanged. Closes #943
Contributor
|
Claude finished @mbevc1's task in 1m 44s —— View job Review: PR #947 —
|
| Check | Result |
|---|---|
go build ./... |
✅ pass |
go vet ./cmd/... |
✅ pass |
What's good
- Consistent with the codebase. The
params := url.Values{}→base + "?" + params.Encode()pattern matcheslistSnapshots.go,listRepos.go, andlistApprovals.go. The extraif encoded := params.Encode(); encoded != ""guard is actually a small improvement over those — it avoids emitting a bare trailing?when no search term is given, keeping the no---namerequest URL byte-identical to before (matches the "additive, URL unchanged" promise in the PR description). - Prior feedback resolved. The earlier note about
o.name != ""being evaluated twice is fixed — theignoreCasecheck is now nested under the name check, with a comment explaining why (case_sensitiveonly matters alongside a search term). The help text was also softened to "The Kosli API supports alphanumeric characters and '-'", so it no longer implies the CLI enforces a constraint it doesn't validate. Good resolution on both counts. - Thorough tests. Five new cases cover the matrix that matters: substring match, no-match → empty list, case-sensitive-by-default,
--ignore-caseoverride, and short flags-n/-i. TheSetupTestseeds a deterministic flow name with an explanatory comment.goldenJson"non-empty"assertions follow the existing convention (getAttestation_test.go,listEnvironments_test.go).
Minor (non-blocking) observations
case_sensitiveis only ever sent as"false"(when--ignore-caseis set); the case-sensitive path relies on the server default. That's a reasonable choice and the comment documents it — just worth confirming the API default is indeed case-sensitive, which the "case sensitive by default" test exercises end-to-end. 👍- The
--namehelp mentions the alphanumeric/-rule but there's still no client-side validation. Given the softened wording this is fine as-is; if you ever want a friendlier early error for invalid input, a small validation slice + error-case test would lock it in — but it's optional and out of scope for this PR.
Nice, tidy PR. No changes requested.
--name and --ignore-case search flags
dangrondahl
approved these changes
Jun 9, 2026
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.
Wire the API's
search_by_nameandcase_sensitivequery parameters into kosli list flows via new--nameand--ignore-caseflags. The change is additive: when no--nameis given the request URL is unchanged.Closes #943