Skip to content

Repurpose fizzy search to call the dedicated FTS endpoint#160

Merged
robzolkos merged 4 commits intomasterfrom
adopt-search-service
Apr 30, 2026
Merged

Repurpose fizzy search to call the dedicated FTS endpoint#160
robzolkos merged 4 commits intomasterfrom
adopt-search-service

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 29, 2026

Summary

  • Repurposes fizzy search QUERY to call SearchService.Search (GET /search.json?q=...), the dedicated full-text search endpoint.
  • Removes the filter flags (--board, --tag, --assignee, --indexed-by, --sort, --page, --all) from fizzy search. They don't apply to /search.json and are already available on fizzy card list.

Why

fizzy search was misnamed. It was calling /cards.json?terms[]=... — the multi-criteria filter endpoint with terms[] as one filter dimension. That's a duplicate of fizzy card list --search "QUERY", which exposes the same endpoint with the same filter flags.

Inspecting the Fizzy app:

  • /cards.json (cards#index via FilterScoped) is the filter — chains terms.reduce { |r, term| r.mentioning(term, user:) } for each terms[] entry, plus board/tag/assignee/dates/status/sort/column criteria.
  • /search.json (searches#show) is the search — single q param, dedicated Search::Record FTS 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: search searches; card list filters.

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 / --allfizzy card list --search "..." --page N / --all

Tests

  • New unit suite covers: single-word query → q=..., multi-arg join → single q string, URL-encoding of special chars, no default-board injection, missing-query rejection, auth failure propagation, server not-found propagation.
  • E2e: TestSearch exercises single-word and multi-word queries; new TestCardListWithSearch covers the filter use cases that moved off search.
  • SURFACE.txt regenerated (loses the removed flags).
  • In-CLI help example and skills/fizzy/SKILL.md updated to point filter use cases at card list --search.

Summary by cubic

Repurposes fizzy search to call the full‑text search endpoint (/search.json?q=...) for ranked results and card‑ID lookup. Removes filter/pagination flags from search (use fizzy card list --search), fixes the breadcrumb to safely quote queries, and adds a small test fix for the linter.

  • Refactors

    • fizzy search QUERY now calls SearchService.Search; multi-word args join into a single q string and are URL-encoded.
    • Breadcrumb tip now uses %q to safely quote queries in the suggested card list command.
    • Updated CLI help, docs, tests, and regenerated SURFACE.txt.
    • Added explicit return after t.Fatal in an agent test to satisfy golangci-lint v2.10.1.
  • Migration

    • Use fizzy card list --search "QUERY" when you need --board, --tag, --assignee, --indexed-by, --sort, --page, or --all.
    • Example: fizzy card list --search "bug" --board <id> --sort newest.

Written for commit a149bb4. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings April 29, 2026 20:44
@github-actions github-actions Bot added the enhancement New feature or request label Apr 29, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/commands/search.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting 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.
Copilot AI review requested due to automatic review settings April 30, 2026 13:37
@robzolkos robzolkos force-pushed the adopt-search-service branch from a149bb4 to 8e7fb98 Compare April 30, 2026 13:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/commands/search_test.go
Comment thread internal/commands/help.go Outdated
Comment thread internal/commands/search.go Outdated
Comment thread internal/commands/search.go Outdated
Comment thread internal/commands/search_test.go
Comment thread internal/commands/search_test.go
@github-actions
Copy link
Copy Markdown

⚠️ Potential breaking changes detected:

  • The fizzy search command no longer supports the '--board', '--tag', '--assignee', '--indexed-by', '--sort', '--page', and '--all' flags, which were removed without a replacement.
  • The second argument of the fizzy search command has been changed from '' to '' in the help examples, potentially altering user expectations for its usage.
  • The output behavior of the fizzy search command has been modified (e.g., breadcrumb updates), which may break scripts relying on the old output format.

Review carefully before merging. Consider a major version bump.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@robzolkos robzolkos merged commit cdc4894 into master Apr 30, 2026
28 checks passed
@robzolkos robzolkos deleted the adopt-search-service branch April 30, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants