-
Notifications
You must be signed in to change notification settings - Fork 41
feat: add find command for catalog search
#174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nadavs123
wants to merge
54
commits into
microsoft:main
Choose a base branch
from
nadavs123:feature/catalog-search-find-command
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
d1675c2
Add fab find command for catalog search API
ab0d8f5
feat(find): address feedback - nargs+, remove endpoint, add error han…
e8c0c3e
feat(find): add tab-completion for --type flag
8e215d7
feat(find): add --limit validation (1-1000)
51d4102
feat(find): use custom validation for cleaner error messages
e03159c
fix(find): fix API integration issues
fba2856
fix(find): correct print_output_format call for table display
94b9baf
feat(find): add key-value layout for --detailed flag
235a93f
refactor(find): change --detailed to -l/--long to match CLI convention
8455e26
feat(find): hide empty keys in long output
9d02732
refactor(find): reorder long output fields (name, id, type, workspace…
78e2c70
feat(find): add blank line separator before results
16d4ac1
feat(find): add blank line before count message
e18c7dc
feat(find): add --continue flag for pagination
5eedfd2
fix(find): fix --continue to not duplicate search/filter params
de710cb
refactor(find): rename flags to --max-items and --next-token
8654d39
feat(find): hide description column when all descriptions are empty
40224e1
fix(find): remove Scorecard from unsupported types (returned as Report)
e546cc6
fix(find): remove Dataflow from unsupported types (Gen2 CI/CD is sear…
767b22c
docs(find): clarify Dataflow Gen1/Gen2 are not searchable
21664e5
docs(find): add 'currently' to Dataflow note
cba4884
refactor(find): replace --next-token/--type/--max-items with auto-pag…
b7fc99c
test(find): update tests for pagination and -P params refactor
090711c
fix(find): make -P type filter case-insensitive
73230bc
fix(find): treat empty continuation token as end of results
1eacc56
fix(find): truncate descriptions to fit terminal width
596f799
feat(find): paginate all results in command-line mode
03e00f9
fix(find): improve error messages per Microsoft Writing Style Guide
3872f30
Delete issue-172.md
nadavs123 8025c05
Address PR #174 review feedback
f9e82ae
Add e2e VCR test skeleton for find command
494e0e9
fix: patch PromptSession before singleton instantiation on Windows
f25c08b
fix: e2e tests — mock input, normalize cassette URLs, fix assertions
7fc29a0
test: remove TestFindCommandline and TestFindInteractive (covered by …
fa04acd
refactor: use table output for -l instead of key-value list
05c2ecd
docs: update find.md for table-based -l output
3ccb430
Address round 2 review: adopt get_dict_from_params, common errors, te…
531c42a
Convert unit tests to e2e: param validation and JMESPath
748db99
Expand e2e coverage, remove redundant unit tests
fe0f483
Address round 3 review: max_depth, cassette sanitization, config cleanup
be2fb2e
Add forward-compatible workspace hierarchy parsing
1dc4528
Smart column truncation and running total for pagination
a2b398a
Address review rounds 3-4: restructure tests, source improvements
3ad3074
Polish: pagination, summary count, error hints, empty line after table
eae5f44
Address PR review: fix bugs, packaging, and code quality
d22206f
Simplify search status message to 'Searching...'
66ff3de
Tighten fab_find: simplify filter builder, dedup pagination, remove d…
028bef1
Address reviewer feedback: loops, _parse_response, output_format
6022c7f
Address Copilot review: truncation in fab_ui, padding fix, UTF-8
4f6a14c
refactor: restructure fetch loops and handle empty JMESPath results
09005a5
Refine _display_page helper and add pagination e2e tests
9540d57
Skip synthetic cassette tests during VCR re-recording
e658e68
Re-record VCR cassettes with scrubbed tenant data
eea31f9
Remove unused imports in test_find.py
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: added | ||
| body: Add new 'fab find' command for searching the Fabric catalog across workspaces | ||
| time: 2026-02-09T17:16:17.2056327+02:00 | ||
| custom: | ||
| Author: nschachter | ||
| AuthorLink: https://github.com/nschachter |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| include src/fabric_cli/core/fab_config/command_support.yaml | ||
| include src/fabric_cli/commands/find/type_supported.yaml | ||
| recursive-include src/fabric_cli/commands/fs/payloads * |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # `find` Command | ||
|
|
||
| Search the Fabric catalog for items across all workspaces. | ||
|
|
||
| **Usage:** | ||
|
|
||
| ``` | ||
| fab find <query> [-P <params>] [-l] [-q <query>] | ||
| ``` | ||
|
|
||
| **Parameters:** | ||
|
|
||
| - `<query>`: Search text. Matches display name, description, and workspace name. | ||
| - `-P, --params`: Filter parameters in `key=value` or `key!=value` format. Use brackets for multiple values: `type=[Lakehouse,Notebook]`. Use `!=` to exclude: `type!=Dashboard`. | ||
| - `-l, --long`: Show detailed table with IDs (name, id, type, workspace, workspace_id, description). Optional. | ||
| - `-q, --query`: JMESPath query to filter results client-side. Optional. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ``` | ||
| # search for items by name or description | ||
| fab find 'sales report' | ||
|
|
||
| # search for lakehouses only | ||
| fab find 'data' -P type=Lakehouse | ||
|
|
||
| # search for multiple item types (bracket syntax) | ||
| fab find 'dashboard' -P type=[Report,SemanticModel] | ||
|
|
||
| # exclude a type | ||
| fab find 'data' -P type!=Dashboard | ||
|
|
||
| # show detailed output with IDs | ||
| fab find 'sales' -l | ||
|
|
||
| # combine filters | ||
| fab find 'finance' -P type=[Warehouse,Lakehouse] -l | ||
|
|
||
| # project specific fields | ||
| fab find 'data' -q "[].{name: name, workspace: workspace}" | ||
| ``` | ||
|
|
||
| **Behavior:** | ||
|
|
||
| - In interactive mode (`fab` shell), results are paged 50 at a time with "Press Enter to continue..." prompts. | ||
| - In command-line mode (`fab find ...`), all results are fetched in a single pass (up to 1000 per API call). | ||
| - Type names are case-insensitive. `type=lakehouse` matches `Lakehouse`. | ||
| - The `-q` JMESPath filter is applied client-side after results are returned from the API. | ||
|
|
||
| **Supported filter parameters:** | ||
|
|
||
| | Parameter | Description | | ||
| |-----------|-------------| | ||
| | `type` | Filter by item type. Supports `eq` (default) and `ne` (`!=`) operators. | | ||
|
|
||
|
nadavs123 marked this conversation as resolved.
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| """Catalog API client for searching Fabric items across workspaces. | ||
|
|
||
| API Reference: POST https://api.fabric.microsoft.com/v1/catalog/search | ||
| Required Scope: Catalog.Read.All | ||
| """ | ||
|
|
||
| from argparse import Namespace | ||
|
|
||
| from fabric_cli.client import fab_api_client as fabric_api | ||
| from fabric_cli.client.fab_api_types import ApiResponse | ||
|
|
||
|
|
||
| def search(args: Namespace, payload: dict) -> ApiResponse: | ||
| """Search the Fabric catalog for items. | ||
|
|
||
| https://learn.microsoft.com/en-us/rest/api/fabric/core/catalog/search | ||
|
aviatco marked this conversation as resolved.
|
||
|
|
||
| Args: | ||
| args: Namespace with request configuration | ||
| payload: Dict with search request body: | ||
| - search (required): Text to search across displayName, description, workspaceName | ||
| - pageSize: Number of results per page | ||
| - continuationToken: Token for pagination | ||
| - filter: OData filter string, e.g., "Type eq 'Report' or Type eq 'Lakehouse'" | ||
|
|
||
| Returns: | ||
| ApiResponse with search results containing: | ||
| - value: List of ItemCatalogEntry objects | ||
| - continuationToken: Token for next page (if more results exist) | ||
|
|
||
| Note: | ||
| The following item types are NOT searchable via this API: | ||
| Dashboard | ||
|
|
||
| Note: Dataflow Gen1 and Gen2 are currently not searchable; only Dataflow Gen2 | ||
| CI/CD items are returned (as type 'Dataflow'). | ||
| Scorecards are returned as type 'Report'. | ||
| """ | ||
| args.uri = "catalog/search" | ||
| args.method = "post" | ||
| # raw_response=True so we handle pagination ourselves in fab_find | ||
| args.raw_response = True | ||
| return fabric_api.do_request(args, json=payload) | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
|
aviatco marked this conversation as resolved.
|
||
| # Licensed under the MIT License. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.