-
Notifications
You must be signed in to change notification settings - Fork 36
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
29
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.
+901
β0
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0582bb1
Add fab find command for catalog search API
c72b18c
feat(find): address feedback - nargs+, remove endpoint, add error hanβ¦
6b8c5f1
feat(find): add tab-completion for --type flag
d2cac8c
feat(find): add --limit validation (1-1000)
b732c0b
feat(find): use custom validation for cleaner error messages
fb3871b
fix(find): fix API integration issues
30e34a5
fix(find): correct print_output_format call for table display
56f8a6b
feat(find): add key-value layout for --detailed flag
7c231bc
refactor(find): change --detailed to -l/--long to match CLI convention
fb64188
feat(find): hide empty keys in long output
30507c7
refactor(find): reorder long output fields (name, id, type, workspaceβ¦
a7e1f90
feat(find): add blank line separator before results
16941b7
feat(find): add blank line before count message
7f3bdb3
feat(find): add --continue flag for pagination
5fa2c6b
fix(find): fix --continue to not duplicate search/filter params
d45eb13
refactor(find): rename flags to --max-items and --next-token
6dca122
feat(find): hide description column when all descriptions are empty
f68abf3
fix(find): remove Scorecard from unsupported types (returned as Report)
d55a386
fix(find): remove Dataflow from unsupported types (Gen2 CI/CD is searβ¦
eb0bd4e
docs(find): clarify Dataflow Gen1/Gen2 are not searchable
c7d2c55
docs(find): add 'currently' to Dataflow note
1f8a80e
refactor(find): replace --next-token/--type/--max-items with auto-pagβ¦
3c60e96
test(find): update tests for pagination and -P params refactor
88cf988
fix(find): make -P type filter case-insensitive
e050589
fix(find): treat empty continuation token as end of results
458137f
fix(find): truncate descriptions to fit terminal width
c143d16
feat(find): paginate all results in command-line mode
320bfc6
fix(find): improve error messages per Microsoft Writing Style Guide
42b7432
Delete issue-172.md
nadavs123 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 |
|---|---|---|
| @@ -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 catalog_search(args: Namespace, payload: dict) -> ApiResponse: | ||
| """Search the Fabric catalog for items. | ||
|
|
||
| https://learn.microsoft.com/en-us/rest/api/fabric/core/catalog/search | ||
|
|
||
| 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" | ||
| # Use raw_response to avoid auto-pagination (we handle pagination in display) | ||
| 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. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add documentation for this new command - under docs folder. |
||
| # 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - since we are in catalog_api consider rename to search(args: Namespace, payload: dict)