Skip to content

feat(ticketing): unified search (search/count/export)#98

Merged
lmeilibr merged 1 commit into
mainfrom
feature/unified-search
Apr 22, 2026
Merged

feat(ticketing): unified search (search/count/export)#98
lmeilibr merged 1 commit into
mainfrom
feature/unified-search

Conversation

@lmeilibr
Copy link
Copy Markdown
Contributor

Summary

  • Adds SearchApiClient and SearchService covering /api/v2/search, /api/v2/search/count and cursor-paginated /api/v2/search/export (with filter[type] and page[size]).
  • Wires ticketing.search into the Ticketing facade.
  • Results are returned as raw dicts because unified search is intentionally heterogeneous (tickets/users/orgs/groups).

Refs #79.

Test plan

  • uv run --python 3.12 pytest tests/unit/ — 1868 passed
  • 100% coverage across search_api_client / search_service
  • Live integration tests on a real tenant

🤖 Generated with Claude Code

Exposes Zendesk unified Search with sort params, count, and cursor-
paginated export filtered by entity type. Wires SearchService into the
Ticketing facade.

Refs #79.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@serenakeyitan serenakeyitan left a comment

Choose a reason for hiding this comment

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

Review

LGTM — clean, consistent addition that mirrors the existing api_client / service split.

What I checked

  • SearchApiClient follows the same yield_items cursor-pagination pattern as MacroApiClient.search and the rest of the ticketing clients.
  • SearchService is a thin pass-through, which is appropriate for unified search where results are intentionally heterogeneous (raw dicts).
  • Facade wiring in application/services/ticketing/__init__.py matches the convention used for siblings.
  • Query-string assembly via urlencode correctly handles filter[type] / page[size] bracket encoding (verified by the unit assertions).
  • Unit tests cover param presence/absence, count default, export filter, page_size, and error propagation. Integration tests are thin smoke checks, which is the established style here.

Nits (non-blocking)

  • Worth a one-line docstring note on search() that Zendesk's unified search caps results at ~1000 / 11 pages (already called out in pagination.py); callers iterating without bounds may otherwise be surprised.
  • count() does int(data.get("count", 0)) — if the API ever returns count: null this will raise TypeError. int(data.get("count") or 0) would be marginally more defensive, but current behavior is fine for now.

No required changes. Approving.

This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.

@lmeilibr lmeilibr merged commit a05d5d6 into main Apr 22, 2026
3 checks passed
@lmeilibr lmeilibr deleted the feature/unified-search branch April 22, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants