[FEATURE] Preserve Workspace Folder Structure on 'export'
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với việc xử lý đối số export trong src/fabric_cli/parsers/fab_fs_parser.py, sau đó đọc các client cho folder, workspace item và item definition trong src/fabric_cli/client/fab_api_folders.py, fab_api_workspace.py và fab_api_item.py. Công việc hoàn tất khi --preserve-folders tái tạo các đường dẫn folder của item, trong khi export mặc định vẫn phẳng, bao gồm cả các item ở cấp root.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Use Case / Problem
Problem Statement
I'm exporting a Fabric workspace to my local filesystem for backup and version control. My workspace uses folders to organize items logically—by feature, department, or data source—but the current export functionality strips away this structure entirely.
Current Limitation
The export command flattens the folder hierarchy. When I export an item located at MyWorkspace/Sales Reports/Q1_Report.Report, it creates Q1_Report.Report/ directly in the output directory, completely discarding the Sales Reports/ parent folder. This eliminates the organizational context that's critical for understanding the project.
Impact on Workflow
This limitation breaks DevOps and GitOps practices. In code-managed Fabric environments, folder structure isn't just organizational—it's fundamental to the project architecture. Without it, I can't:
- Navigate locally: The flat structure makes it nearly impossible to find items quickly or understand relationships between assets.
- Conduct meaningful code reviews: Git diffs lose context when the logical grouping disappears, making it harder for teams to review changes effectively.
- Automate deployments: Re-importing assets while preserving the intended workspace organization becomes manual and error-prone.
Requested Enhancement
Preserve the full folder hierarchy during workspace export. If an item exists at MyWorkspace/Sales Reports/Q1_Report.Report, the export should create Sales Reports/Q1_Report.Report/ in the output directory, maintaining the complete path structure.
This would enable seamless integration with modern development workflows and make Fabric workspaces truly manageable as code.
Proposed Solution
Specific commands or functionality:
Extend the existing export command with a --preserve-folders flag to maintain the workspace's folder hierarchy during export.
fab export <workspace_name> -o <output_path> --preserve-folders
Expected behavior and output:
With the --preserve-folders flag enabled, the export command replicates the complete folder structure from the Fabric workspace to the local filesystem.
Example:
Starting with this workspace structure in Fabric:
/MyWorkspace.Workspace/
├── Reports/
│ └── Sales_Report.Report
└── Notebooks/
└── Data_Processing.Notebook
Current Behavior (fab export MyWorkspace.Workspace -o ./local_export --all):
./local_export/
├── Sales_Report.Report/
│ └── ... (item files)
└── Data_Processing.Notebook/
└── ... (item files)
All items export to a flat structure, losing the original folder organization.
Expected Behavior (fab export MyWorkspace.Workspace -o ./local_export --all --preserve-folders):
./local_export/
├── Reports/
│ └── Sales_Report.Report/
│ └── ... (item files)
└── Notebooks/
└── Data_Processing.Notebook/
└── ... (item files)
The original folder hierarchy is preserved, making it easier to understand project organization.
Integration with existing fabric-cli features:
This enhancement naturally extends the export command and strengthens the CLI's filesystem metaphor established by commands like ls, cd, and mkdir. It also sets the foundation for a complementary import enhancement that could automatically recreate folder structures in target workspaces, enabling true round-trip workflows.
Alternatives Considered
No response
Impact Assessment
- This would help me personally
- This would help my team/organization
- This would help the broader fabric-cli community
- This aligns with Microsoft Fabric roadmap items
Implementation Attestation
- I understand this feature should maintain backward compatibility with existing commands
- I confirm this feature request does not introduce performance regressions for existing workflows
- I acknowledge that new features must follow fabric-cli's established patterns and conventions
Implementation Notes
- Relevant Fabric REST APIs:
This feature can be efficiently implemented using three core APIs that minimize the number of calls needed:
-
GET /v1/workspaces/{workspaceId}/folders?recursive=True: Found insrc/fabric_cli/client/fab_api_folders.py, this single call retrieves the entire folder hierarchy for a workspace—no recursiveGET /folders/{folderId}calls required. The response includes each folder'sid,displayName, andparentFolderId. -
GET /v1/workspaces/{workspaceId}/items: This API (infab_api_workspace.py) returns a flat list of all workspace items. The critical property isfolderId, which links each item to its parent folder in the hierarchy. Root-level items won't have afolderId. -
POST /v1/workspaces/{workspaceId}/items/{itemId}/getDefinition: The existing API used by theexportcommand (fab_api_item.py) to fetch an item's actual definition content. This part of the logic would remain unchanged.
-
Command Structure or Argument Patterns:
A new optional flag should be added to the
exportcommand insrc/fabric_cli/parsers/fab_fs_parser.py. A good name would be--preserve-folders. -
Compatibility Concerns:
To ensure backward compatibility, this new behavior should only be triggered when the
--preserve-foldersflag is present. The default behavior of theexportcommand (flattening the directory structure) should remain unchanged to avoid breaking existing user scripts and workflows.
- Ngôn ngữ chính
- Python
- Star
- 174
- Fork
- 64
- Merge trung bình
- 6 ngày 38 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/fabric-cli
-
[FEATURE] Loosen strict dependency pins to improve compatibility with newer `fabric-cicd` versionsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởai:feature-triage:unable-to-process enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
microsoft/fabric-cli#294 · 1 bình luận · 1 reaction ·
-
[BUG] bulk-export errors with "[NotSupported] Only supported for Lakehouse/Files"Có thể làm lại được @rksharma-owg đã nhận 39 ngày trước và không có pull request nào đang mở. Đang mởai:bug-triage:unable-to-process bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/fabric-cli#287 · 2 bình luận ·
-
ai:feature-triage:unable-to-process enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
microsoft/fabric-cli#292 · 1 bình luận ·
-
ai:question-triage:unable-to-process question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
microsoft/fabric-cli#288 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
microsoft/fabric-cli#286 · 3 bình luận ·
Tất cả issue của microsoft/fabric-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CLIMADA-project/climada_python#1337 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
tail without reverseĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
8go/matrix-commander#233 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
documentation enhancement priority:high size:M
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Validate non-divisible effective batch sizes in the Unsloth LoRA backendCó thể đã có người làm @debesh-biswas đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100