Repurpose fizzy search to call the dedicated FTS endpoint#160
Merged
Repurpose fizzy search to call the dedicated FTS endpoint#160
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/commands/search.go">
<violation number="1" location="internal/commands/search.go:40">
P2: Escape the query in the breadcrumb command; raw interpolation inside manual quotes can produce broken commands for queries containing quotes or backslashes.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The previous `fizzy search` was a misnomer: it called /cards.json?terms[]= — the multi-criteria filter endpoint with the terms[] param, identical to `fizzy card list --search "QUERY"`. That duplicated `card list` and isn't what /search.json does in the Fizzy app. Now `fizzy search QUERY` calls SearchService.Search → /search.json?q=, which is the dedicated full-text search endpoint. It takes a single query string and returns ranked results; if the query exactly matches a card ID, that card is returned directly. Breaking changes (intentional, ahead of the major version bump): - `--board`, `--tag`, `--assignee`, `--indexed-by`, `--sort`, `--page`, `--all` removed from `fizzy search`. They don't apply to /search.json and are still available on `fizzy card list`, which is the right home for filter semantics. Updated unit tests, e2e tests, in-cli help examples, and the agent skill docs to point filter use cases at `card list --search`.
Use %q instead of \"%s\" so queries containing quotes or backslashes produce a copy-pasteable command rather than broken shell input.
golangci-lint v2.10.1 (used in CI) trips SA5011 on this pattern even though t.Fatal halts — newer staticcheck versions handle it correctly. Adding the explicit return is harmless and unblocks the lint check.
a149bb4 to
8e7fb98
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review carefully before merging. Consider a major version bump. |
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
fizzy search QUERYto callSearchService.Search(GET /search.json?q=...), the dedicated full-text search endpoint.--board,--tag,--assignee,--indexed-by,--sort,--page,--all) fromfizzy search. They don't apply to/search.jsonand are already available onfizzy card list.Why
fizzy searchwas misnamed. It was calling/cards.json?terms[]=...— the multi-criteria filter endpoint withterms[]as one filter dimension. That's a duplicate offizzy card list --search "QUERY", which exposes the same endpoint with the same filter flags.Inspecting the Fizzy app:
/cards.json(cards#indexviaFilterScoped) is the filter — chainsterms.reduce { |r, term| r.mentioning(term, user:) }for eachterms[]entry, plus board/tag/assignee/dates/status/sort/column criteria./search.json(searches#show) is the search — singleqparam, dedicatedSearch::RecordFTS table, plus a card-ID lookup shortcut (accessible_cards.find_by_id(q)runs first).These are genuinely different operations. The CLI now matches the domain:
searchsearches;card listfilters.Breaking changes
Intentional, ahead of the major version bump:
fizzy search --board ...→fizzy card list --search "..." --board ...fizzy search --tag ...→fizzy card list --search "..." --tag ...fizzy search --assignee ...→fizzy card list --search "..." --assignee ...fizzy search --indexed-by ...→fizzy card list --search "..." --indexed-by ...fizzy search --sort ...→fizzy card list --search "..." --sort ...fizzy search --page N/--all→fizzy card list --search "..." --page N/--allTests
q=..., multi-arg join → singleqstring, URL-encoding of special chars, no default-board injection, missing-query rejection, auth failure propagation, server not-found propagation.TestSearchexercises single-word and multi-word queries; newTestCardListWithSearchcovers the filter use cases that moved offsearch.SURFACE.txtregenerated (loses the removed flags).skills/fizzy/SKILL.mdupdated to point filter use cases atcard list --search.Summary by cubic
Repurposes
fizzy searchto call the full‑text search endpoint (/search.json?q=...) for ranked results and card‑ID lookup. Removes filter/pagination flags fromsearch(usefizzy card list --search), fixes the breadcrumb to safely quote queries, and adds a small test fix for the linter.Refactors
fizzy search QUERYnow callsSearchService.Search; multi-word args join into a singleqstring and are URL-encoded.%qto safely quote queries in the suggestedcard listcommand.SURFACE.txt.returnaftert.Fatalin an agent test to satisfygolangci-lintv2.10.1.Migration
fizzy card list --search "QUERY"when you need--board,--tag,--assignee,--indexed-by,--sort,--page, or--all.fizzy card list --search "bug" --board <id> --sort newest.Written for commit a149bb4. Summary will update on new commits. Review in cubic