feat(ticketing): unified search (search/count/export)#98
Merged
Conversation
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>
|
serenakeyitan
approved these changes
Apr 21, 2026
serenakeyitan
left a comment
There was a problem hiding this comment.
Review
LGTM — clean, consistent addition that mirrors the existing api_client / service split.
What I checked
SearchApiClientfollows the sameyield_itemscursor-pagination pattern asMacroApiClient.searchand the rest of the ticketing clients.SearchServiceis a thin pass-through, which is appropriate for unified search where results are intentionally heterogeneous (raw dicts).- Facade wiring in
application/services/ticketing/__init__.pymatches the convention used for siblings. - Query-string assembly via
urlencodecorrectly handlesfilter[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 inpagination.py); callers iterating without bounds may otherwise be surprised. count()doesint(data.get("count", 0))— if the API ever returnscount: nullthis will raiseTypeError.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.
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
SearchApiClientandSearchServicecovering/api/v2/search,/api/v2/search/countand cursor-paginated/api/v2/search/export(withfilter[type]andpage[size]).ticketing.searchinto theTicketingfacade.Refs #79.
Test plan
uv run --python 3.12 pytest tests/unit/— 1868 passed🤖 Generated with Claude Code