feat: add support for environment definitions#212
Open
v-alexmoraru wants to merge 7 commits intomicrosoft:mainfrom
Open
feat: add support for environment definitions#212v-alexmoraru wants to merge 7 commits intomicrosoft:mainfrom
v-alexmoraru wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for Environment item definitions in Fabric CLI, removing prior Environment-specific import workarounds and updating recorded command tests to reflect the new behavior.
Changes:
- Simplifies import payload generation and import flow by removing Environment-only branching/patch logic.
- Enables Environment definition format handling and marks Environment as supported for
export/importin command support config. - Updates/records CLI test fixtures and VCR recordings (including new export coverage for Environment invalid output path).
Reviewed changes
Copilot reviewed 36 out of 59 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_commands/test_import.py | Removes Environment-specific assertion branching to align with unified import behavior. |
| tests/test_commands/conftest.py | Expands test parametrization to include Environment in supported import/export scenarios. |
| tests/test_commands/recordings/test_commands/test_mkdir/class_setup.yaml | Updates VCR recording metadata for mkdir test setup. |
| tests/test_commands/recordings/test_commands/test_import/class_setup.yaml | Updates VCR recording metadata and item listings for import test setup. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[SparkJobDefinition].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[Reflex].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[MirroredDatabase].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[Lakehouse].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[KQLQueryset].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[KQLDashboard].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[DataPipeline].yaml | Updates VCR recording to reflect current API responses for import update flow. |
| tests/test_commands/recordings/test_commands/test_import/test_import_create_new_item_fail[Warehouse].yaml | Updates VCR recording to reflect current API responses for import create-fail scenario. |
| tests/test_commands/recordings/test_commands/test_import/test_import_create_new_item_fail[MLExperiment].yaml | Updates VCR recording to reflect current API responses for import create-fail scenario. |
| tests/test_commands/recordings/test_commands/test_get/class_setup.yaml | Updates VCR recording metadata for get test setup. |
| tests/test_commands/recordings/test_commands/test_export/test_export_item_invalid_output_path_failure[Environment].yaml | Adds a new recording covering Environment export invalid output path behavior. |
| tests/test_commands/recordings/test_commands/test_export/class_setup.yaml | Updates VCR recording metadata for export test setup. |
| src/fabric_cli/utils/fab_cmd_import_utils.py | Removes Environment-special payload logic; always builds standard definition payloads. |
| src/fabric_cli/core/fab_types.py | Adds Environment to definition_format_mapping default handling. |
| src/fabric_cli/core/fab_config/command_support.yaml | Adds Environment to export supported items list. |
| src/fabric_cli/commands/fs/impor/fab_fs_import_item.py | Removes Environment-special import create/update logic; uses standard create/updateDefinition path. |
| .changes/unreleased/added-20260417-105920.yaml | Adds release note entry for Environment definition support. |
ayeshurun
reviewed
Apr 20, 2026
| _import_update_environment_item(args, payload) | ||
| else: | ||
| _import_update_item(args, payload) | ||
| _import_update_item(args, payload) |
Collaborator
There was a problem hiding this comment.
What are the implications of moving to the definitions approach? with the current approach we are doing some manual stuff, and at the end publishing the environment.
Did we compare the end result of two approaches? Perhaps we should keep support somehow of these two
ayeshurun
reviewed
Apr 20, 2026
| response = _import_create_environment_item(item, args, payload) | ||
| else: | ||
| response = _import_create_item(args, payload) | ||
| response = _import_create_item(args, payload) |
Collaborator
There was a problem hiding this comment.
same question as above.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes the environment workarounds and records new tests for the enabled commands.