fix(search): server-side type filter so --max applies after --type#126
fix(search): server-side type filter so --max applies after --type#126frd1201 wants to merge 3 commits into
Conversation
…pe filter vsp search "Z*" --type CLAS --max 50 returned only 9 results (issue oisee#119) because --type was applied client-side after the request. The ADT API returned up to 50 mixed-type Z* objects and the CLI then kept only CLAS rows, so any classes outside the first 50 mixed results were silently dropped. Add SearchObjectByType that sends objectType on the informationsystem/ search endpoint; SearchObject becomes a thin shim, leaving the other 33 existing callers untouched. In runSearch, canonicalize the documented short forms (CLAS→CLAS/OC, INTF→INTF/OI, ...) at the CLI boundary and print the effective query when --verbose is set.
…ee#121 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Tested on-prem (on-premise SAP). Two follow-up points worth noting for whoever merges this: 1. MCP handler was not wired up The fix in Fix: wire 2. Having it in Both changes are in my branch if useful: https://github.com/txape10/vibing-steampunk/tree/fix/lock-nomodification-with-transport |
…e#126 review) - Export adt.CanonicalObjectType and apply it inside SearchObjectByType so CLI, MCP and direct API callers all get short-form expansion (+INCL, TTYP, ENQU) - MCP search (handleSearchObject/routeSearchAction) now uses SearchObjectByType and accepts type/objectType + max/maxResults, so max applies after the type filter - CLI post-filter compares against the canonical type (fixes --type FUNC/INCL) - Tests: TestCanonicalObjectType, SearchObjectByType short-form cases, MCP handler test
…er + MCP wiring (PR oisee#126) # Conflicts: # cmd/vsp/cli.go # pkg/adt/client.go # pkg/adt/client_test.go
|
Thanks @txape10, this was really helpful — appreciate you testing on-prem and pinning down both the MCP wiring gap and the package placement. Implemented both: the MCP path ( |
Problem
vsp search "Z*" --type CLAS --max 50returned fewer results than expected (issue #119).The ADT server returned up to
--maxmixed-type objects, and--typewas applied client-side afterwards — so any CLAS objects outside the first 50 mixed results were silently dropped.Solution
Add
SearchObjectByTypethat passesobjectTypeto the ADTinformationsystem/searchendpoint so the server filters before applyingmaxResults.SearchObjectbecomes a thin shim, leaving all existing callers untouched.Short-form types are canonicalized at the CLI boundary (
CLAS→CLAS/OC,INTF→INTF/OI,PROG→PROG/P, etc.) viacanonicalObjectType.--verboseprints the effective query for debugging.Test plan
vsp search "Z*" --type CLAS --max 50returns up to 50 CLAS objectsvsp search "Z*"(no--type) still works unchangedpkg/adt/client_test.gopassCloses #119