-
Notifications
You must be signed in to change notification settings - Fork 28
Architecture Overview
Fabric CLI is designed with a modular architecture centered around these key concepts:
Fabric CLI uses an element hierarchy system:
- Tenants - Top-level containers (capacities, gateways, domains)
- Workspaces - Project containers within tenants
- Folders - Organizational containers within workspaces for grouping items
- Items - Fabric entities (notebooks, datasets, reports, etc.)
- OneLake - File storage within items
Each element type has specific supported operations and properties.
When developing new commands, it's important to consider the supported output formats and use the appropriate print functions for displaying command results (print_output_format, print_error_format) and for user-facing messages during execution (print_info, print_warning, etc.). Currently, we support two formats: json and text (default).
Fabric CLI errors should be raised using the FabricCLIError type. Use this for user-facing errors that need to be reported to the CLI user, not for internal exceptions. All Fabric CLI commands are wrapped to handle this error type, printing the error message and error code to the user.
- Create new error messages under the
errorsfolder inside a module relevant to the error. - Before creating a new error message, check if an existing one can be reused.
- Error messages should be clear, user-friendly, and avoid technical jargon unless necessary.
- Where possible, include actionable advice (e.g., "Check your network connection").
- All error codes should be created inside the
constant.pymodule under the error codes region. - Before creating a new error code, check for reusing an existing one.
from fabric_cli.core import fab_constant
from fabric_cli.core.fab_exceptions import FabricCLIError
from fabric_cli.errors import ErrorMessages
# Example of raising an error
raise FabricCLIError(ErrorMessages.Common.file_or_directory_not_exists(), fab_constant.ERROR_INVALID_PATH)