Skip to content

Conversation

@Shailin
Copy link

@Shailin Shailin commented Nov 18, 2025

  • Implemented workspace creation, assignment to capacity, and role assignment functions in workspace_management.py.
  • Added a YAML configuration example for bulk workspace creation in workspace_config_example.yml.
  • Developed unit tests for workspace management functions in test_workspace_management.py, covering various scenarios including invalid inputs and role assignments.

Description

Briefly describe what this PR does and why.

Linked Issue (REQUIRED)

Fixes #635

- Implemented workspace creation, assignment to capacity, and role assignment functions in `workspace_management.py`.
- Added a YAML configuration example for bulk workspace creation in `workspace_config_example.yml`.
- Developed unit tests for workspace management functions in `test_workspace_management.py`, covering various scenarios including invalid inputs and role assignments.
Copilot AI review requested due to automatic review settings November 18, 2025 11:31
@Shailin Shailin requested a review from a team as a code owner November 18, 2025 11:31
Copy link
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 comprehensive workspace management functionality to enable programmatic workspace creation, capacity assignment, and role management - particularly designed for ISV scenarios requiring large-scale deployments (e.g., 500+ workspaces).

  • Implements four main functions: create_workspace, assign_workspace_to_capacity, add_workspace_role_assignment, and create_workspaces_from_config
  • Adds GUID validation utility and workspace-related constants
  • Includes comprehensive test coverage with 499 lines of tests covering various scenarios

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fabric_cicd/workspace_management.py Core implementation of workspace management functions with API integration
tests/test_workspace_management.py Comprehensive unit tests covering all functions and edge cases
src/fabric_cicd/constants.py Adds workspace role and principal type constants
src/fabric_cicd/_common/_check_utils.py Adds GUID validation utility function
src/fabric_cicd/init.py Exports new workspace management functions
sample/workspace_config_example.yml Provides example YAML configuration for bulk workspace creation
docs/how_to/workspace_management.md Detailed documentation with usage examples and best practices

Comment on lines 459 to 468
For detailed API documentation, see the [Code Reference](../code_reference.md#workspace-management) section.

### Related Functions

- [`create_workspace`](../code_reference.md#create_workspace): Create a single workspace
- [`create_workspaces_from_config`](../code_reference.md#create_workspaces_from_config): Create multiple workspaces from YAML config
- [`assign_workspace_to_capacity`](../code_reference.md#assign_workspace_to_capacity): Assign workspace to capacity
- [`add_workspace_role_assignment`](../code_reference.md#add_workspace_role_assignment): Add user/group/SP to workspace
- [`FabricWorkspace`](../code_reference.md#fabricworkspace): Initialize workspace for deployment
- [`publish_all_items`](../code_reference.md#publish_all_items): Deploy items to workspace
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The documentation references a 'Code Reference' section with anchor links to the new functions (e.g., #workspace-management, #create_workspace), but these anchors likely don't exist yet in the code_reference.md file. Either remove these specific anchor references or ensure the corresponding API reference documentation is added to code_reference.md.

Suggested change
For detailed API documentation, see the [Code Reference](../code_reference.md#workspace-management) section.
### Related Functions
- [`create_workspace`](../code_reference.md#create_workspace): Create a single workspace
- [`create_workspaces_from_config`](../code_reference.md#create_workspaces_from_config): Create multiple workspaces from YAML config
- [`assign_workspace_to_capacity`](../code_reference.md#assign_workspace_to_capacity): Assign workspace to capacity
- [`add_workspace_role_assignment`](../code_reference.md#add_workspace_role_assignment): Add user/group/SP to workspace
- [`FabricWorkspace`](../code_reference.md#fabricworkspace): Initialize workspace for deployment
- [`publish_all_items`](../code_reference.md#publish_all_items): Deploy items to workspace
For detailed API documentation, see the [Code Reference](../code_reference.md) section.
### Related Functions
- [`create_workspace`](../code_reference.md): Create a single workspace
- [`create_workspaces_from_config`](../code_reference.md): Create multiple workspaces from YAML config
- [`assign_workspace_to_capacity`](../code_reference.md): Assign workspace to capacity
- [`add_workspace_role_assignment`](../code_reference.md): Add user/group/SP to workspace
- [`FabricWorkspace`](../code_reference.md): Initialize workspace for deployment
- [`publish_all_items`](../code_reference.md): Deploy items to workspace

Copilot uses AI. Check for mistakes.
@Shailin
Copy link
Author

Shailin commented Nov 18, 2025

@microsoft-github-policy-service agree

@Shailin Shailin changed the title Add workspace management functionality and configuration example Add workspace creation functionality Nov 18, 2025
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.

Feature Request: Add option to create workspace function and deploy artifacts

1 participant