Skip to content

feat: add support for environment definitions#212

Open
v-alexmoraru wants to merge 7 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/support-environment-definitions
Open

feat: add support for environment definitions#212
v-alexmoraru wants to merge 7 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/support-environment-definitions

Conversation

@v-alexmoraru
Copy link
Copy Markdown
Member

Removes the environment workarounds and records new tests for the enabled commands.

@v-alexmoraru v-alexmoraru marked this pull request as ready for review April 17, 2026 09:06
@v-alexmoraru v-alexmoraru requested a review from a team as a code owner April 17, 2026 09:06
Copilot AI review requested due to automatic review settings April 17, 2026 09:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/import in 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.

_import_update_environment_item(args, payload)
else:
_import_update_item(args, payload)
_import_update_item(args, payload)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

response = _import_create_environment_item(item, args, payload)
else:
response = _import_create_item(args, payload)
response = _import_create_item(args, payload)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants