Skip to content

[Fabric] Add submit-only workspace capacity assignment - #3850

Closed
Amos Hersch (AmosHersch) wants to merge 2 commits into
amoshersch-fabric-delete-workspacefrom
amoshersch-fabric-assign-workspace-capacity
Closed

Amos Hersch (AmosHersch) wants to merge 2 commits into
amoshersch-fabric-delete-workspacefrom
amoshersch-fabric-assign-workspace-capacity

Conversation

@AmosHersch

@AmosHersch Amos Hersch (AmosHersch) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds only core_assign-workspace-to-capacity relative to its immediate parent, #3847 (Delete Workspace). This existing draft is the final tool layer of the conflict-prevention chain; its base is amoshersch-fabric-delete-workspace at 83da05281e680f9716b1408f710a8a0aa308d8da, with ultimate target main.

Uses the documented Assign To Capacity API: validates both required, nonempty GUIDs before authentication, then sends exactly one application-level body-bearing POST. Only 202 Accepted produces the typed receipt containing the requested workspace/capacity IDs, accepted: true, and state: "Pending". The capacity ID is the requested target, not a verified current assignment. Acceptance never means completion.

No polling, operation handle, automatic retry, preflight, follow-up request, fallback capacity, workspace creation, or capacity lifecycle operation is added. The response body is not required or read, even when Location/operation headers appear. Later inspection through Get Workspace remains caller-driven; assignment does not invoke that tool.

Stack adaptation

  • Uses the inherited SendFabricHttpRequestAsync helper with explicit ResponseHeadersRead and named cancellation propagation. The inherited post-credential cancellation check and IAzureTokenCredentialProvider -> ProviderDelegatingCredential -> TokenCredential -> Fabric Core bridge remain unchanged.
  • Preserves the original command/options/request/result/exception contracts. Retry-After remains nullable long seconds and ignores dates. The original BCL parsing limits still apply; the local projection is retained because the shared helper rejects multiple headers that the original typed getter can accept. Boundary/date/multiple-header regressions cover this distinction.
  • Reuses the shared thread-safe FabricCoreHttpMessageHandler, retains UnreadableHttpContent, and preserves every predecessor operation suite and Delete Item's explicit-value/repetition guard.
  • Keeps destructive, non-read-only, non-idempotent metadata and existing consent gates. The existing single-proxy local-command text-only fallback is unchanged.
  • Changes no shared core, engineering, production host/auth/proxy, project, or dependency files relative to the parent. Host-test assertions are extended to include assignment without removing the five existing default/all-mode cases.

The verified bottom-to-top ancestry is #3854, #3855, #3846, #3852, #3841, #3842, #3843, #3853, #3851, #3849, #3848, #3847, #3850. No core_get-item is introduced; #3701 remains separate. This session did not register native stack metadata or merge any PR.

Final head: 0efab0df92cf1cb1f7adac94dc533f4114ed4326. Layer-relative delta: two commits, 23 files. The original single tool commit was rebased onto the frozen parent; the second commit formats the new registration coverage.

Cumulative validation

All results below cover the combined inherited stack and assignment, not just the original independent branch.

Command Result
dotnet build tools\Fabric.Mcp.Tools.Core\src --nologo --verbosity quiet Passed; 0 warnings/errors.
dotnet build tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests --nologo --verbosity quiet -m:1 -nr:false Passed; 0 warnings/errors.
dotnet build servers\Fabric.Mcp.Server\src --nologo --verbosity quiet -m:1 -nr:false Passed; 0 warnings/errors.
dotnet build servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests --nologo --verbosity quiet -m:1 -nr:false Passed; 0 warnings/errors.
dotnet build tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests --nologo --verbosity quiet -m:1 -nr:false Passed; 0 warnings/errors.
dotnet test --project tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --no-build 1,578 passed, 0 failed/skipped: all 1,468 inherited cases plus 110 assignment cases.
dotnet test --project servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --no-build 5 passed, including both default/all discovery variants and legacy initialization.
dotnet test --project tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj --no-build --filter-class '*ProviderDelegatingCredentialTests' 2 passed; both existing credential-bridge cases.
dotnet format tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --no-restore --verify-no-changes --include $sourceFiles --verbosity quiet Passed for layer-changed source files.
dotnet format tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --no-restore --verify-no-changes --include $testFiles --verbosity quiet Passed for layer-changed Core tests.
dotnet format servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --no-restore --verify-no-changes --include servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Infrastructure\ServerStartupTests.cs --verbosity quiet Passed.
.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $files -PackageInstallCache '.work\assignment-stack-cspell' Passed: 23 files, 0 spelling issues.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath 'servers\Fabric.Mcp.Server\README.md' Exit 0; the same 14 inherited heading-level warnings also occur on the frozen parent's README.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName Fabric.Mcp.Server -OutputPath '.work\assignment-stack-prompt-validation' Passed against freshly published cumulative artifacts: 59 tools, 37 prompts, 1 server tested, 0 skipped, 0 violations. The inherited #3854 fix resolves the previous mixed-stream failure; no new engineering workaround was added here.
.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe tools list --name-only Passed: 59 Fabric tools / 13 Core tools, including all 11 new tools plus create-item/search-catalog; no get-item. Metadata enumeration only.
git merge-tree --write-tree --name-only --messages 0fa879ecf7c51946fa17e73304e468558c351b6c 0efab0df92cf1cb1f7adac94dc533f4114ed4326 Exit 0: no conflicts with observed current main. Read-only compatibility inspection; main was not imported.
git diff --check 83da05281e680f9716b1408f710a8a0aa308d8da HEAD Passed.

File selections are layer-relative:

$files = @(git diff --name-only '83da05281e680f9716b1408f710a8a0aa308d8da' HEAD) | ForEach-Object { $_.Replace('/', '\') }
$sourceFiles = @($files | Where-Object { $_.StartsWith('tools\Fabric.Mcp.Tools.Core\src\') -and $_.EndsWith('.cs') })
$testFiles = @($files | Where-Object { $_.StartsWith('tools\Fabric.Mcp.Tools.Core\tests\') -and $_.EndsWith('.cs') })

An initial parallel-worker host build encountered MSB4166. The scoped retry with -m:1 -nr:false passed without code/configuration changes. All inherited named command/service/MCP suites remain present; coverage was not reduced to obtain these totals. Registered checks cover the 13 Core names, input/output schemas, six-tool read-only set, assignment consent rejection before authentication, and accepted/pending behavior in output modes.

Evidence limits and CI

No actual Fabric assignment or other resource operation was executed. API tests use fake credentials/HTTP or substituted services. Host discovery tests exercise only local stdio/HTTP metadata enumeration, not real Fabric permissions or OBO. No live/recorded infrastructure was added; live service, real OBO/RBAC, service-principal/managed-identity permissions, and playback remain unexercised. Broad native/NPX builds and repository-wide tests were not run; the scoped prompt-validator publish is not a native-AOT claim.

ToolDescriptionEvaluator: not run; maintainer exemption. The Fabric MCP maintainer has waived the score/ranking requirement for this PR. Configuration is unavailable; no score or top-three ranking is claimed. The checkbox remains unchecked because the evaluator was not run. Normal code review and required CI still apply.

Required CI still applies; local results do not claim a green merge gate. The post-retarget snapshot showed SpellCheck and license/cla successful, Verify Links in progress, and the Azure Pipelines aggregate queued with Initialize/SDL Sources subchecks cancelled. Consult the current linked checks for subsequent state; no CI bypass or automatic merge was requested.

The Azure-only checklist items and Azure consolidated-tools registration do not apply to this Fabric-only layer; Fabric uses NullConsolidatedToolDefinitionProvider. No tool is renamed.

GitHub issue number?

N/A. User-requested tool addition and in-place stack adaptation; no issue was created. Immediate PR dependency: #3847, ultimate target main.

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts - Not run; score/ranking requirement waived for this PR by the Fabric MCP maintainer.
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

@azure-pipelines

azure-pipelines Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the server-Fabric.Mcp Microsoft Fabric MCP Server label Oct 5, 2026
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-assign-workspace-capacity branch from 7dfd216 to 0efab0d Compare October 6, 2026 00:44
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-delete-workspace October 6, 2026 00:45
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-assign-workspace-capacity branch 2 times, most recently from ac0ab2a to 026f232 Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-assign-workspace-capacity branch from 026f232 to efef50c Compare October 7, 2026 09:39
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-assign-workspace-capacity branch from efef50c to 07a5d88 Compare October 7, 2026 11:49
@AmosHersch
Amos Hersch (AmosHersch) marked this pull request as ready for review October 7, 2026 12:53
@AmosHersch
Amos Hersch (AmosHersch) requested a review from a team as a code owner October 7, 2026 12:53
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches the documented API contract and includes complete registration, serialization, safety, documentation, and offline test coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds the Fabric core_assign-workspace-to-capacity tool for submit-only capacity assignment.

Changes:

  • Implements validated, single-request assignment with a typed pending receipt.
  • Registers the tool and adds comprehensive offline coverage.
  • Updates Fabric documentation, prompts, and changelog.
File Description
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​WorkspaceUpdateToolRegistrationTests.cs Extends read-only filtering assertions.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​WorkspaceCreateToolRegistrationTests.cs Updates expected tool discovery.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​WorkspaceAssignToCapacityToolRegistrationTests.cs Tests registration, consent, schemas, and validation.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​UnreadableHttpContent.cs Adds a response-body-read guard.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​WorkspaceCapacityAssignmentServiceTests.cs Tests HTTP, errors, cancellation, and disposal.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​README.md Documents assignment test coverage.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​ItemUpdateToolRegistrationTests.cs Extends read-only filtering assertions.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​FabricCoreSetupTests.cs Verifies service and command registration.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​WorkspaceAssignToCapacityMcpTests.cs Tests MCP modes and output contracts.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​WorkspaceAssignToCapacityCommandTests.cs Tests command validation and errors.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​WorkspaceCapacityAssignmentException.cs Adds sanitized assignment failures.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​IFabricCoreService.cs Exposes the assignment operation.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricCoreService.cs Implements the submit-only POST.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​WorkspaceAssignToCapacityOptions.cs Defines required identifiers.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​WorkspaceAssignToCapacityCommandResult.cs Defines the pending receipt.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CoreJsonContext.cs Registers source-generated JSON models.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​AssignWorkspaceToCapacityRequest.cs Defines the API request body.
tools/​Fabric.Mcp.Tools.Core/​src/​FabricCoreSetup.cs Registers and exposes the command.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​WorkspaceAssignToCapacityCommand.cs Implements command behavior and metadata.
servers/​Fabric.Mcp.Server/​tests/​Fabric.Mcp.Server.Tests/​Infrastructure/​ServerStartupTests.cs Verifies host discovery and annotations.
servers/​Fabric.Mcp.Server/​README.md Documents assignment usage and limitations.
servers/​Fabric.Mcp.Server/​docs/​e2eTestPrompts.md Adds tool-selection prompts.
servers/​Fabric.Mcp.Server/​changelog-entries/​amhersch-fabric-assign-workspace-capacity.yaml Records the new feature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AmosHersch

Copy link
Copy Markdown
Contributor Author

Superseded by #3887, which has merged into main with this layer's changes and the associated fixes. Closing this PR to avoid merging the same work again; its original review history is preserved.

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

Labels

server-Fabric.Mcp Microsoft Fabric MCP Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants